use of com.centurylink.mdw.model.value.process.ProcessVO in project mdw-designer by CenturyLinkCloud.
the class ProcessCanvasWrapper method openProcessInstance.
private void openProcessInstance(ProcessInstanceVO processInstanceInfo) {
// create a new instance for a new editor
ProcessVO subprocess = new ProcessVO();
subprocess.setProcessId(processInstanceInfo.getProcessId());
try {
ProcessVO def = getDesignerProxy().getDesignerDataAccess().getProcessDefinition(subprocess.getProcessId());
subprocess.setProcessName(def.getName());
subprocess.setVersion(def.getVersion());
WorkflowProcess toOpen = new WorkflowProcess(getProject(), subprocess);
toOpen.setPackage(getProject().getProcessPackage(subprocess.getId()));
toOpen.setProcessInstance(processInstanceInfo);
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
page.openEditor(toOpen, MDW_EDITORS_PROCESS);
} catch (Exception ex) {
PluginMessages.uiError(getDisplay().getActiveShell(), ex, "Open SubProcess Instances", getProject());
}
}
use of com.centurylink.mdw.model.value.process.ProcessVO in project mdw-designer by CenturyLinkCloud.
the class DesignerPage method findProcessDefinition.
/**
* find out process ID of a given process name through the process list. If
* there are more than one version of the process, return the ID of the
* latest version.
*/
private ProcessVO findProcessDefinition(String processName, int version) {
ProcessVO procdef = model.findProcessDefinition(processName, version);
if (procdef != null)
return procdef;
try {
procdef = frame.dao.getProcessDefinition(processName, version);
model.addPrivateProcess(procdef);
} catch (Exception e) {
procdef = null;
}
return procdef;
}
use of com.centurylink.mdw.model.value.process.ProcessVO in project mdw-designer by CenturyLinkCloud.
the class DesignerPage method loadProcess.
/**
* Loads a process for use by Designer.
*/
public Graph loadProcess(Long processId, String server) {
Graph process = model.findProcessGraph(processId, server);
if (process != null)
return process;
ProcessVO procdef = findProcessDefinition(processId, server);
try {
procdef = loadProcess(procdef);
process = new Graph(procdef, model.getNodeMetaInfo(), frame.getIconFactory());
model.addProcessGraph(process);
} catch (Exception ex) {
ex.printStackTrace();
}
return process;
}
use of com.centurylink.mdw.model.value.process.ProcessVO in project mdw-designer by CenturyLinkCloud.
the class DesignerDataModel method insertOrderedByVersion.
private void insertOrderedByVersion(ProcessVO head, ProcessVO one) {
ProcessVO next = head;
while (next.getPrevVersion() != null) {
if (one.getVersion() >= next.getPrevVersion().getVersion())
break;
next = next.getPrevVersion();
}
if (next.getPrevVersion() != null) {
next.getPrevVersion().setNextVersion(one);
}
one.setPrevVersion(next.getPrevVersion());
one.setNextVersion(next);
next.setPrevVersion(one);
}
use of com.centurylink.mdw.model.value.process.ProcessVO in project mdw-designer by CenturyLinkCloud.
the class DesignerDataModel method replaceAliasesInPackage.
private void replaceAliasesInPackage(PackageVO pkg) {
List<ProcessVO> newProcs = new ArrayList<ProcessVO>(pkg.getProcesses().size());
for (ProcessVO proc : pkg.getProcesses()) {
ProcessVO proc1 = this.findProcessDefinition(processes, proc.getProcessId(), null);
if (proc1 != null)
newProcs.add(proc1);
else
newProcs.add(proc);
}
pkg.setProcesses(newProcs);
List<ActivityImplementorVO> newImpls = new ArrayList<ActivityImplementorVO>(pkg.getImplementors().size());
for (ActivityImplementorVO impl : pkg.getImplementors()) {
ActivityImplementorVO impl1 = findActivityImplementorVO(impl.getImplementorClassName());
if (impl1 != null)
newImpls.add(impl1);
else
newImpls.add(impl);
}
pkg.setImplementors(newImpls);
List<ExternalEventVO> newHandlers = new ArrayList<ExternalEventVO>(pkg.getExternalEvents().size());
for (ExternalEventVO hdl : pkg.getExternalEvents()) {
ExternalEventVO hdl1 = findExternalEvent(hdl.getEventName());
if (hdl1 != null)
newHandlers.add(hdl1);
else
newHandlers.add(hdl);
}
pkg.setExternalEvents(newHandlers);
if (pkg.getRuleSets() != null) {
List<RuleSetVO> newRuleSets = new ArrayList<RuleSetVO>(pkg.getRuleSets().size());
for (RuleSetVO hdl : pkg.getRuleSets()) {
RuleSetVO hdl1 = findRuleSet(hdl.getId());
if (hdl1 != null)
newRuleSets.add(hdl1);
else
newRuleSets.add(hdl);
}
pkg.setRuleSets(newRuleSets);
}
}
Aggregations