Search in sources :

Example 1 with NewNodeOpWizard

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;
}
Also used : NewNodeOpWizard(com.liferay.ide.kaleo.ui.wizard.NewNodeOpWizard) NewNodeOp(com.liferay.ide.kaleo.core.op.NewNodeOp) WorkflowDefinition(com.liferay.ide.kaleo.core.model.WorkflowDefinition) WorkflowDefinitionEditor(com.liferay.ide.kaleo.ui.editor.WorkflowDefinitionEditor)

Aggregations

WorkflowDefinition (com.liferay.ide.kaleo.core.model.WorkflowDefinition)1 NewNodeOp (com.liferay.ide.kaleo.core.op.NewNodeOp)1 WorkflowDefinitionEditor (com.liferay.ide.kaleo.ui.editor.WorkflowDefinitionEditor)1 NewNodeOpWizard (com.liferay.ide.kaleo.ui.wizard.NewNodeOpWizard)1