Search in sources :

Example 61 with WorkflowProcess

use of com.centurylink.mdw.plugin.designer.model.WorkflowProcess in project mdw-designer by CenturyLinkCloud.

the class ProcessSearchQuery method handleOpen.

@Override
public void handleOpen(WorkflowElement workflowElement) {
    WorkflowProcess processVersion = (WorkflowProcess) workflowElement;
    IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
    try {
        ProcessEditor processEditor = (ProcessEditor) page.openEditor(processVersion, "mdw.editors.process");
        processEditor.setFocus();
    } catch (PartInitException ex) {
        showError(ex, "Open Process", workflowElement.getProject());
    }
}
Also used : IWorkbenchPage(org.eclipse.ui.IWorkbenchPage) PartInitException(org.eclipse.ui.PartInitException) WorkflowProcess(com.centurylink.mdw.plugin.designer.model.WorkflowProcess) ProcessEditor(com.centurylink.mdw.plugin.designer.editors.ProcessEditor)

Example 62 with WorkflowProcess

use of com.centurylink.mdw.plugin.designer.model.WorkflowProcess 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 63 with WorkflowProcess

use of com.centurylink.mdw.plugin.designer.model.WorkflowProcess 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 64 with WorkflowProcess

use of com.centurylink.mdw.plugin.designer.model.WorkflowProcess 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 65 with WorkflowProcess

use of com.centurylink.mdw.plugin.designer.model.WorkflowProcess 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

WorkflowProcess (com.centurylink.mdw.plugin.designer.model.WorkflowProcess)85 ProcessVO (com.centurylink.mdw.model.value.process.ProcessVO)28 WorkflowPackage (com.centurylink.mdw.plugin.designer.model.WorkflowPackage)21 WorkflowProject (com.centurylink.mdw.plugin.project.model.WorkflowProject)21 PartInitException (org.eclipse.ui.PartInitException)20 ArrayList (java.util.ArrayList)17 WorkflowAsset (com.centurylink.mdw.plugin.designer.model.WorkflowAsset)15 IWorkbenchPage (org.eclipse.ui.IWorkbenchPage)12 ExternalEvent (com.centurylink.mdw.plugin.designer.model.ExternalEvent)11 WorkflowElement (com.centurylink.mdw.plugin.designer.model.WorkflowElement)11 ProcessInstanceVO (com.centurylink.mdw.model.value.process.ProcessInstanceVO)10 DataAccessException (com.centurylink.mdw.common.exception.DataAccessException)9 IEditorPart (org.eclipse.ui.IEditorPart)9 ProcessEditor (com.centurylink.mdw.plugin.designer.editors.ProcessEditor)8 IFile (org.eclipse.core.resources.IFile)8 CoreException (org.eclipse.core.runtime.CoreException)8 SelectionEvent (org.eclipse.swt.events.SelectionEvent)8 IOException (java.io.IOException)7 ValidationException (com.centurylink.mdw.designer.utils.ValidationException)6 Activity (com.centurylink.mdw.plugin.designer.model.Activity)6