use of org.pentaho.di.engine.configuration.api.RunConfiguration in project pentaho-kettle by pentaho.
the class RunConfigurationViewTreeExtension method refreshTree.
private void refreshTree(SelectionTreeExtension selectionTreeExtension) {
TreeItem tiRootName = selectionTreeExtension.getTiRootName();
GUIResource guiResource = selectionTreeExtension.getGuiResource();
TreeItem tiEETitle = createTreeItem(tiRootName, TREE_LABEL, guiResource.getImageFolder(), 0);
for (RunConfiguration runConfiguration : runConfigurationDelegate.load()) {
String imageFile = runConfiguration.isReadOnly() ? "images/run_tree_disabled.svg" : "images/run_tree.svg";
createTreeItem(tiEETitle, runConfiguration.getName(), getRunConfigurationImage(guiResource, imageFile), -1, runConfiguration.isReadOnly());
}
}
use of org.pentaho.di.engine.configuration.api.RunConfiguration in project pentaho-kettle by pentaho.
the class RunConfigurationViewTreeExtension method callExtensionPoint.
@Override
public void callExtensionPoint(LogChannelInterface log, Object object) throws KettleException {
SelectionTreeExtension selectionTreeExtension = (SelectionTreeExtension) object;
if (selectionTreeExtension.getAction().equals(Spoon.REFRESH_SELECTION_EXTENSION)) {
refreshTree(selectionTreeExtension);
}
if (selectionTreeExtension.getAction().equals(Spoon.EDIT_SELECTION_EXTENSION)) {
if (selectionTreeExtension.getSelection() instanceof RunConfiguration) {
RunConfiguration runConfiguration = (RunConfiguration) selectionTreeExtension.getSelection();
runConfigurationDelegate.edit(runConfiguration);
}
}
}
use of org.pentaho.di.engine.configuration.api.RunConfiguration in project pentaho-kettle by pentaho.
the class RunConfigurationImportExtensionPoint method callExtensionPoint.
@Override
public void callExtensionPoint(LogChannelInterface logChannelInterface, Object o) throws KettleException {
AbstractMeta abstractMeta = (AbstractMeta) o;
final EmbeddedMetaStore embeddedMetaStore = abstractMeta.getEmbeddedMetaStore();
RunConfigurationManager embeddedRunConfigurationManager = EmbeddedRunConfigurationManager.build(embeddedMetaStore);
List<RunConfiguration> runConfigurationList = embeddedRunConfigurationManager.load();
List<String> runConfigurationNames = runConfigurationList.stream().map(RunConfiguration::getName).collect(Collectors.toList());
runConfigurationNames.addAll(runConfigurationManager.getNames());
runConfigurationList.addAll(createSlaveServerRunConfigurations(runConfigurationNames, abstractMeta));
for (RunConfiguration runConfiguration : runConfigurationList) {
if (!runConfiguration.getName().equals(DefaultRunConfigurationProvider.DEFAULT_CONFIG_NAME)) {
runConfigurationManager.save(runConfiguration);
}
}
}
use of org.pentaho.di.engine.configuration.api.RunConfiguration in project pentaho-kettle by pentaho.
the class RunConfigurationInjectExtensionPoint method callExtensionPoint.
@Override
public void callExtensionPoint(LogChannelInterface log, Object object) throws KettleException {
if (!(object instanceof JobExecutionExtension)) {
return;
}
JobExecutionExtension extension = (JobExecutionExtension) object;
Job job = extension.job;
JobMeta jobMeta = job.getJobMeta();
final EmbeddedMetaStore embeddedMetaStore = jobMeta.getEmbeddedMetaStore();
RunConfigurationManager embeddedRunConfigurationManager = EmbeddedRunConfigurationManager.build(embeddedMetaStore);
// will load and save to meta all run configurations
for (JobEntryTrans trans : job.getActiveJobEntryTransformations().values()) {
RunConfiguration loadedRunConfiguration = runConfigurationManager.load(jobMeta.environmentSubstitute(trans.getRunConfiguration()));
embeddedRunConfigurationManager.save(loadedRunConfiguration);
}
for (JobEntryJob subJob : job.getActiveJobEntryJobs().values()) {
RunConfiguration loadedRunConfiguration = runConfigurationManager.load(jobMeta.environmentSubstitute(subJob.getRunConfiguration()));
embeddedRunConfigurationManager.save(loadedRunConfiguration);
}
}
use of org.pentaho.di.engine.configuration.api.RunConfiguration in project pentaho-kettle by pentaho.
the class RunConfigurationRunExtensionPoint method callExtensionPoint.
@Override
public void callExtensionPoint(LogChannelInterface logChannelInterface, Object o) throws KettleException {
ExecutionConfiguration executionConfiguration = (ExecutionConfiguration) ((Object[]) o)[0];
AbstractMeta meta = (AbstractMeta) ((Object[]) o)[1];
VariableSpace variableSpace = (VariableSpace) ((Object[]) o)[2];
Repository repository = (Repository) ((Object[]) o)[3];
EmbeddedMetaStore embeddedMetaStore = meta.getEmbeddedMetaStore();
RunConfiguration runConfiguration = runConfigurationManager.load(executionConfiguration.getRunConfiguration());
if (runConfiguration == null) {
RunConfigurationManager embeddedRunConfigurationManager = EmbeddedRunConfigurationManager.build(embeddedMetaStore);
runConfiguration = embeddedRunConfigurationManager.load(executionConfiguration.getRunConfiguration());
}
if (runConfiguration != null) {
RunConfigurationExecutor runConfigurationExecutor = runConfigurationManager.getExecutor(runConfiguration.getType());
if (runConfigurationExecutor != null) {
runConfigurationExecutor.execute(runConfiguration, executionConfiguration, meta, variableSpace, repository);
}
} else {
String name = "";
if (variableSpace instanceof TransMeta) {
name = ((TransMeta) variableSpace).getFilename();
}
throw new KettleException(BaseMessages.getString(PKG, "RunConfigurationRunExtensionPoint.ConfigNotFound.Error", name, executionConfiguration.getRunConfiguration(), "{0}"));
}
}
Aggregations