Search in sources :

Example 66 with ProcessVO

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());
    }
}
Also used : ProcessVO(com.centurylink.mdw.model.value.process.ProcessVO) IWorkbenchPage(org.eclipse.ui.IWorkbenchPage) WorkflowProcess(com.centurylink.mdw.plugin.designer.model.WorkflowProcess) JSONException(org.json.JSONException) PartInitException(org.eclipse.ui.PartInitException) InvocationTargetException(java.lang.reflect.InvocationTargetException)

Example 67 with ProcessVO

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;
}
Also used : ProcessVO(com.centurylink.mdw.model.value.process.ProcessVO) DataAccessException(com.centurylink.mdw.common.exception.DataAccessException) RemoteException(java.rmi.RemoteException) ValidationException(com.centurylink.mdw.designer.utils.ValidationException)

Example 68 with ProcessVO

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;
}
Also used : Graph(com.centurylink.mdw.designer.display.Graph) SubGraph(com.centurylink.mdw.designer.display.SubGraph) ProcessVO(com.centurylink.mdw.model.value.process.ProcessVO) DataAccessException(com.centurylink.mdw.common.exception.DataAccessException) RemoteException(java.rmi.RemoteException) ValidationException(com.centurylink.mdw.designer.utils.ValidationException)

Example 69 with ProcessVO

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);
}
Also used : ProcessVO(com.centurylink.mdw.model.value.process.ProcessVO)

Example 70 with ProcessVO

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);
    }
}
Also used : ActivityImplementorVO(com.centurylink.mdw.model.value.activity.ActivityImplementorVO) ExternalEventVO(com.centurylink.mdw.model.value.event.ExternalEventVO) ArrayList(java.util.ArrayList) ProcessVO(com.centurylink.mdw.model.value.process.ProcessVO) RuleSetVO(com.centurylink.mdw.model.value.attribute.RuleSetVO)

Aggregations

ProcessVO (com.centurylink.mdw.model.value.process.ProcessVO)92 ArrayList (java.util.ArrayList)29 WorkflowProcess (com.centurylink.mdw.plugin.designer.model.WorkflowProcess)28 DataAccessException (com.centurylink.mdw.common.exception.DataAccessException)25 ValidationException (com.centurylink.mdw.designer.utils.ValidationException)17 IOException (java.io.IOException)17 HashMap (java.util.HashMap)15 RemoteException (java.rmi.RemoteException)14 ProcessWorker (com.centurylink.mdw.designer.utils.ProcessWorker)12 ActivityVO (com.centurylink.mdw.model.value.activity.ActivityVO)11 PackageVO (com.centurylink.mdw.model.value.process.PackageVO)11 JSONException (org.json.JSONException)11 RuleSetVO (com.centurylink.mdw.model.value.attribute.RuleSetVO)10 XmlException (org.apache.xmlbeans.XmlException)10 ActivityImplementorVO (com.centurylink.mdw.model.value.activity.ActivityImplementorVO)9 ProcessInstanceVO (com.centurylink.mdw.model.value.process.ProcessInstanceVO)9 DataAccessOfflineException (com.centurylink.mdw.dataaccess.DataAccessOfflineException)8 ExternalEventVO (com.centurylink.mdw.model.value.event.ExternalEventVO)8 VariableVO (com.centurylink.mdw.model.value.variable.VariableVO)7 AuthenticationException (com.centurylink.mdw.auth.AuthenticationException)5