use of com.centurylink.mdw.designer.pages.FlowchartPage in project mdw-designer by CenturyLinkCloud.
the class DesignerProxy method saveProcessAs.
public void saveProcessAs(final WorkflowProcess processVersion, final WorkflowPackage targetPackage, final String newName) {
String progressMsg = SAVING + newName + "'";
String errorMsg = "Save Process";
designerRunner = new DesignerRunner(progressMsg, errorMsg, project) {
public void perform() throws ValidationException, DataAccessException, RemoteException {
ProcessVO origProcVO = processVersion.getProcessVO();
ProcessVO newProcVO = new ProcessVO(-1L, newName, origProcVO.getProcessDescription(), null);
newProcVO.set(origProcVO.getAttributes(), origProcVO.getVariables(), origProcVO.getTransitions(), origProcVO.getSubProcesses(), origProcVO.getActivities());
newProcVO.setVersion(1);
newProcVO.setInRuleSet(origProcVO.isInRuleSet());
WorkflowProcess newProcess = new WorkflowProcess(targetPackage.getProject(), newProcVO);
newProcess.setPackage(targetPackage);
Graph process = new Graph(newProcVO, dataAccess.getDesignerDataModel().getNodeMetaInfo(), getIconFactory());
process.dirtyLevel = Graph.NEW;
FlowchartPage flowchartPage = FlowchartPage.newPage(mainFrame);
flowchartPage.setProcess(process);
saveProcess(newProcess, flowchartPage, PersistType.CREATE, 0, false, false);
toggleProcessLock(newProcess, true);
// why?
newProcess.getProcessVO().setVersion(1);
dataAccess.getProcesses(false).add(newProcess.getProcessVO());
targetPackage.addProcess(newProcess);
newProcess.setPackage(targetPackage);
if (!newProcess.isInDefaultPackage())
savePackage(newProcess.getPackage());
}
};
designerRunner.run();
}
use of com.centurylink.mdw.designer.pages.FlowchartPage in project mdw-designer by CenturyLinkCloud.
the class DesignerProxy method copyProcess.
public void copyProcess(final String originalName, final String originalVersion, final String newName, final WorkflowPackage targetPackage) {
String progressMsg = "Creating process '" + newName + "'\nin package '" + targetPackage.getName() + "'";
String errorMsg = "Create Process";
designerRunner = new DesignerRunner(progressMsg, errorMsg, project) {
public void perform() throws ValidationException, DataAccessException, RemoteException {
int dotIdx = originalVersion.indexOf('.');
int major = Integer.parseInt(originalVersion.substring(0, dotIdx));
int minor = Integer.parseInt(originalVersion.substring(dotIdx + 1));
ProcessVO origProcVO = dataAccess.getDesignerDataAccess().getProcessDefinition(originalName, major * 1000 + minor);
origProcVO = dataAccess.getDesignerDataAccess().getProcess(origProcVO.getProcessId(), origProcVO);
new ProcessWorker().convert_to_designer(origProcVO);
ProcessVO newProcVO = new ProcessVO(-1L, newName, origProcVO.getProcessDescription(), null);
newProcVO.set(origProcVO.getAttributes(), origProcVO.getVariables(), origProcVO.getTransitions(), origProcVO.getSubProcesses(), origProcVO.getActivities());
newProcVO.setVersion(1);
newProcVO.setInRuleSet(origProcVO.isInRuleSet());
WorkflowProcess newProcess = new WorkflowProcess(targetPackage.getProject(), newProcVO);
newProcess.setPackage(targetPackage);
Graph process = new Graph(newProcVO, dataAccess.getDesignerDataModel().getNodeMetaInfo(), getIconFactory());
process.dirtyLevel = Graph.NEW;
FlowchartPage flowchartPage = FlowchartPage.newPage(mainFrame);
flowchartPage.setProcess(process);
saveProcess(newProcess, flowchartPage, PersistType.CREATE, 0, false, false);
toggleProcessLock(newProcess, true);
// why?
newProcess.getProcessVO().setVersion(1);
dataAccess.getProcesses(false).add(newProcess.getProcessVO());
targetPackage.addProcess(newProcess);
newProcess.setPackage(targetPackage);
if (!newProcess.isInDefaultPackage())
savePackage(newProcess.getPackage());
}
};
designerRunner.run();
}
use of com.centurylink.mdw.designer.pages.FlowchartPage in project mdw-designer by CenturyLinkCloud.
the class DesignerProxy method createNewProcess.
public void createNewProcess(final WorkflowProcess processVersion) {
String progressMsg = "Creating '" + processVersion.getName() + "'";
String errorMsg = "Create Process";
designerRunner = new DesignerRunner(progressMsg, errorMsg, project) {
public void perform() throws ValidationException, DataAccessException, RemoteException {
if (dataAccess.getDesignerDataModel().getNodeMetaInfo().getStartActivity() == null)
throw new ValidationException("Please import the MDW Baseline Package corresponding to your MDW framework version.");
Graph process = new Graph(processVersion.getName(), ProcessVisibilityConstant.PUBLIC, dataAccess.getDesignerDataModel().getNodeMetaInfo(), getIconFactory());
process.setDescription(processVersion.getDescription());
process.getProcessVO().setInRuleSet(processVersion.isInRuleSet());
if (project.isFilePersist())
process.getProcessVO().setRawFile(new File(project.getAssetDir() + "/" + processVersion.getPackage().getName() + "/" + processVersion.getName() + ".proc"));
if (!processVersion.isInDefaultPackage())
process.getProcessVO().setPackageName(processVersion.getPackage().getName());
final FlowchartPage flowchartPage = FlowchartPage.newPage(mainFrame);
flowchartPage.setProcess(process);
saveProcess(processVersion, flowchartPage, PersistType.CREATE, 0, false, false);
toggleProcessLock(processVersion, true);
if (processVersion.isInRuleSet())
dataAccess.getAllRuleSets(false).add(processVersion.getProcessVO());
// update the process tree
if (!processVersion.isInDefaultPackage()) {
processVersion.getPackage().addProcess(processVersion);
savePackage(processVersion.getPackage());
} else {
processVersion.getProject().getDefaultPackage().addProcess(processVersion);
}
// add to the mainFrame process list
dataAccess.getDesignerDataModel().addProcess(processVersion.getProcessVO());
}
};
designerRunner.run();
}
Aggregations