use of com.centurylink.mdw.plugin.designer.model.WorkflowProcess in project mdw-designer by CenturyLinkCloud.
the class ProcessSearchQuery method handleOpen.
@Override
public void handleOpen(WorkflowElement workflowElement) {
WorkflowProcess processVersion = (WorkflowProcess) workflowElement;
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
try {
ProcessEditor processEditor = (ProcessEditor) page.openEditor(processVersion, "mdw.editors.process");
processEditor.setFocus();
} catch (PartInitException ex) {
showError(ex, "Open Process", workflowElement.getProject());
}
}
use of com.centurylink.mdw.plugin.designer.model.WorkflowProcess in project mdw-designer by CenturyLinkCloud.
the class DesignerProxy method getProcessesUsingActivityImpl.
public List<WorkflowProcess> getProcessesUsingActivityImpl(Long activityImplId, String implClass) throws DataAccessException {
List<WorkflowProcess> processVersions = new ArrayList<>();
for (ProcessVO processVO : dataAccess.getDesignerDataAccess().getProcessListForImplementor(activityImplId, implClass)) {
WorkflowProcess processVersion = project.getProcess(processVO.getProcessId());
if (// might not be loaded in tree
processVersion == null)
processVersion = new WorkflowProcess(project, processVO);
processVersions.add(processVersion);
}
return processVersions;
}
use of com.centurylink.mdw.plugin.designer.model.WorkflowProcess in project mdw-designer by CenturyLinkCloud.
the class DesignerProxy method findCallingProcesses.
public List<WorkflowProcess> findCallingProcesses(WorkflowProcess subproc) throws DataAccessException, RemoteException {
List<WorkflowProcess> callers = new ArrayList<>();
List<ProcessVO> callingProcVos = dataAccess.getDesignerDataAccess().findCallingProcesses(subproc.getProcessVO());
for (ProcessVO procVo : callingProcVos) {
WorkflowProcess processVersion = project.getProcess(procVo.getProcessId());
if (// might not be loaded in tree
processVersion == null)
processVersion = new WorkflowProcess(project, procVo);
callers.add(processVersion);
}
return callers;
}
use of com.centurylink.mdw.plugin.designer.model.WorkflowProcess 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.plugin.designer.model.WorkflowProcess 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();
}
Aggregations