use of com.centurylink.mdw.plugin.designer.dialogs.ProcessSaveAsDialog in project mdw-designer by CenturyLinkCloud.
the class ProcessCanvasWrapper method saveProcessAs.
public void saveProcessAs() {
ProcessSaveAsDialog newProcessDialog = new ProcessSaveAsDialog(getParent().getShell(), getProcess());
if (newProcessDialog.open() != Dialog.OK)
// cancelled
return;
String newName = newProcessDialog.getNewName();
WorkflowPackage newPkg = getProject().getDefaultPackage();
if (!StringHelper.isEmpty(newProcessDialog.getPackageName()))
newPkg = getProject().getPackage(newProcessDialog.getPackageName());
flowchartPage.getProcess().blankOutTaskLogicalId();
flowchartPage.getProcess().save_temp_vars();
getDesignerProxy().saveProcessAs(getProcess(), newPkg, newName);
WorkflowProcess newProc = getProject().getProcess(newName);
if (newProc != null) {
// update the process explorer tree
newProc.sync();
newProc.addElementChangeListener(getProject());
newProc.fireElementChangeEvent(ChangeType.ELEMENT_CREATE, newProc);
// update the canvas editor
openProcessDefinition(newProc);
IWorkbenchPage page = MdwPlugin.getActivePage();
if (page != null) {
ProcessEditor processEditor = (ProcessEditor) page.findEditor(getProcess());
if (processEditor != null)
page.closeEditor(processEditor, false);
}
}
}
Aggregations