use of com.centurylink.mdw.model.value.process.ProcessVO in project mdw-designer by CenturyLinkCloud.
the class DesignerProxy method getProcessVO.
public ProcessVO getProcessVO(Long processId) {
ProcessVO processVO = dataAccess.getProcess(processId);
if (processVO != null)
return processVO;
// may be private process -- try loading
try {
processVO = dataAccess.getDesignerDataAccess().getProcessDefinition(processId);
dataAccess.getDesignerDataModel().addPrivateProcess(processVO);
return processVO;
} catch (Exception ex) {
PluginMessages.uiError(ex, "Load Process", project);
}
// not found
return null;
}
use of com.centurylink.mdw.model.value.process.ProcessVO 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.model.value.process.ProcessVO 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.model.value.process.ProcessVO 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.model.value.process.ProcessVO 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