Search in sources :

Example 51 with ProcessVO

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;
}
Also used : ProcessVO(com.centurylink.mdw.model.value.process.ProcessVO) JSONException(org.json.JSONException) TranslationException(com.centurylink.mdw.common.exception.TranslationException) AuthenticationException(com.centurylink.mdw.auth.AuthenticationException) IOException(java.io.IOException) XmlException(org.apache.xmlbeans.XmlException) ValidationException(com.centurylink.mdw.designer.utils.ValidationException) DataAccessOfflineException(com.centurylink.mdw.dataaccess.DataAccessOfflineException) ZipException(java.util.zip.ZipException) DataAccessException(com.centurylink.mdw.common.exception.DataAccessException) FileNotFoundException(java.io.FileNotFoundException) RemoteException(java.rmi.RemoteException)

Example 52 with ProcessVO

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;
}
Also used : ArrayList(java.util.ArrayList) ProcessVO(com.centurylink.mdw.model.value.process.ProcessVO) WorkflowProcess(com.centurylink.mdw.plugin.designer.model.WorkflowProcess)

Example 53 with ProcessVO

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;
}
Also used : ArrayList(java.util.ArrayList) ProcessVO(com.centurylink.mdw.model.value.process.ProcessVO) WorkflowProcess(com.centurylink.mdw.plugin.designer.model.WorkflowProcess)

Example 54 with ProcessVO

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

Example 55 with ProcessVO

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

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