use of com.liferay.ide.kaleo.ui.wizard.NewNodeOpWizard in project liferay-ide by liferay.
the class NewNodeAddActionHandler method run.
@Override
public Object run(Presentation context) {
Object retval = null;
if (canRunWizard(context)) {
NewNodeOp op = createOp(context);
WorkflowDefinition oldWorkflowDefinition = (WorkflowDefinition) getModelElement();
WorkflowDefinition newWorkflowDefinition = op.getWorkflowDefinition().content(true);
newWorkflowDefinition.copy(oldWorkflowDefinition);
// When WorkflowDefinition.getSchemaVersion(),
// VersionedSchemaDefaultValueService.compute()
// can't get the version, always returns the default value, directly
// set the schema version here.
newWorkflowDefinition.setSchemaVersion(oldWorkflowDefinition.getSchemaVersion().content());
NewNodeOpWizard wizard = createNewNodeWizard(op, this, context);
WorkflowDefinitionEditor definitionEditor = context.part().adapt(WorkflowDefinitionEditor.class);
op.setUseNodeWizards(definitionEditor.isNodeWizardsEnabled());
runWizard(context, wizard);
definitionEditor.setNodeWizardsEnabled(op.isUseNodeWizards().content());
} else {
retval = insertDiagramPart(context, true);
}
return retval;
}
Aggregations