use of com.centurylink.mdw.model.value.process.LinkedProcessInstance in project mdw-designer by CenturyLinkCloud.
the class RuntimeDataAccessRest method getProcessInstanceCallHierarchy.
public LinkedProcessInstance getProcessInstanceCallHierarchy(Long processInstanceId) throws DataAccessException {
try {
String pathWithArgs = "Processes?mdw-app=designer&callHierarchyFor=" + processInstanceId;
String response;
if (!getServer().isSchemaVersion61())
pathWithArgs = "ProcessInstances?format=json&callHierarchyFor=" + processInstanceId;
response = invokeResourceService(pathWithArgs);
return new LinkedProcessInstance(response);
} catch (IOException ex) {
throw new DataAccessOfflineException(ex.getMessage(), ex);
} catch (Exception ex) {
throw new DataAccessException(ex.getMessage(), ex);
}
}
use of com.centurylink.mdw.model.value.process.LinkedProcessInstance in project mdw-designer by CenturyLinkCloud.
the class ProcessHierarchyLabelProvider method getText.
public String getText(Object element) {
if (element instanceof LinkedProcessInstance) {
LinkedProcessInstance instance = (LinkedProcessInstance) element;
ProcessInstanceVO procInst = instance.getProcessInstance();
return procInst.getProcessName() + " v" + procInst.getProcessVersion() + " (" + procInst.getId() + ")";
} else if (element instanceof LinkedProcess) {
return ((LinkedProcess) element).getProcess().getLabel();
} else {
return null;
}
}
use of com.centurylink.mdw.model.value.process.LinkedProcessInstance in project mdw-designer by CenturyLinkCloud.
the class ProcessHierarchyView method createPartControl.
public void createPartControl(Composite parent) {
treeViewer = new TreeViewer(parent);
treeViewer.setLabelProvider(new ProcessHierarchyLabelProvider());
// action group
actionGroup = new ProcessHierarchyActionGroup(this);
actionGroup.fillActionBars(getViewSite().getActionBars());
treeViewer.addOpenListener(new IOpenListener() {
public void open(OpenEvent event) {
for (Object item : getSelection().toList()) {
if (item instanceof LinkedProcess)
actionGroup.getActionHandler().open(((LinkedProcess) item).getProcess());
if (item instanceof LinkedProcessInstance) {
ProcessInstanceVO procInst = ((LinkedProcessInstance) item).getProcessInstance();
WorkflowProcess pv = processVersion.getProject().getProcess(procInst.getProcessId());
if (pv != null) {
WorkflowProcess toOpen = new WorkflowProcess(pv);
toOpen.setProcessInstance(procInst);
actionGroup.getActionHandler().open(toOpen);
}
}
}
}
});
}
Aggregations