Search in sources :

Example 1 with LinkedProcessInstance

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);
    }
}
Also used : DataAccessOfflineException(com.centurylink.mdw.dataaccess.DataAccessOfflineException) IOException(java.io.IOException) LinkedProcessInstance(com.centurylink.mdw.model.value.process.LinkedProcessInstance) JSONException(org.json.JSONException) DataAccessOfflineException(com.centurylink.mdw.dataaccess.DataAccessOfflineException) DataAccessException(com.centurylink.mdw.common.exception.DataAccessException) IOException(java.io.IOException) XmlException(org.apache.xmlbeans.XmlException) DataAccessException(com.centurylink.mdw.common.exception.DataAccessException)

Example 2 with LinkedProcessInstance

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;
    }
}
Also used : LinkedProcess(com.centurylink.mdw.plugin.designer.views.ProcessHierarchyContentProvider.LinkedProcess) LinkedProcessInstance(com.centurylink.mdw.model.value.process.LinkedProcessInstance) ProcessInstanceVO(com.centurylink.mdw.model.value.process.ProcessInstanceVO)

Example 3 with LinkedProcessInstance

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);
                    }
                }
            }
        }
    });
}
Also used : IOpenListener(org.eclipse.jface.viewers.IOpenListener) LinkedProcess(com.centurylink.mdw.plugin.designer.views.ProcessHierarchyContentProvider.LinkedProcess) TreeViewer(org.eclipse.jface.viewers.TreeViewer) LinkedProcessInstance(com.centurylink.mdw.model.value.process.LinkedProcessInstance) WorkflowProcess(com.centurylink.mdw.plugin.designer.model.WorkflowProcess) ProcessInstanceVO(com.centurylink.mdw.model.value.process.ProcessInstanceVO) OpenEvent(org.eclipse.jface.viewers.OpenEvent)

Aggregations

LinkedProcessInstance (com.centurylink.mdw.model.value.process.LinkedProcessInstance)3 ProcessInstanceVO (com.centurylink.mdw.model.value.process.ProcessInstanceVO)2 LinkedProcess (com.centurylink.mdw.plugin.designer.views.ProcessHierarchyContentProvider.LinkedProcess)2 DataAccessException (com.centurylink.mdw.common.exception.DataAccessException)1 DataAccessOfflineException (com.centurylink.mdw.dataaccess.DataAccessOfflineException)1 WorkflowProcess (com.centurylink.mdw.plugin.designer.model.WorkflowProcess)1 IOException (java.io.IOException)1 XmlException (org.apache.xmlbeans.XmlException)1 IOpenListener (org.eclipse.jface.viewers.IOpenListener)1 OpenEvent (org.eclipse.jface.viewers.OpenEvent)1 TreeViewer (org.eclipse.jface.viewers.TreeViewer)1 JSONException (org.json.JSONException)1