Search in sources :

Example 81 with WorkflowProcess

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

the class ProcessLaunchShortcut method launch.

public void launch(ISelection selection, String mode) {
    Object firstElement = ((StructuredSelection) selection).getFirstElement();
    if (firstElement instanceof WorkflowProcess) {
        WorkflowProcess processVersion = (WorkflowProcess) firstElement;
        try {
            boolean prevEnablement = disableBuildBeforeLaunch();
            performLaunch(processVersion, mode);
            setBuildBeforeLaunch(prevEnablement);
        } catch (Exception ex) {
            PluginMessages.uiError(ex, "Process Launch", processVersion.getProject());
        }
    }
}
Also used : StructuredSelection(org.eclipse.jface.viewers.StructuredSelection) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) WorkflowProcess(com.centurylink.mdw.plugin.designer.model.WorkflowProcess) CoreException(org.eclipse.core.runtime.CoreException)

Example 82 with WorkflowProcess

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

the class EventHandlerPage method fillProcessTreeCombo.

private void fillProcessTreeCombo() {
    processTreeCombo.removeAll();
    List<WorkflowPackage> packages = getProject().getTopLevelUserVisiblePackages();
    for (WorkflowPackage pkg : packages) {
        CTreeComboItem packageItem = new CTreeComboItem(processTreeCombo, SWT.NONE);
        packageItem.setText(pkg.getName());
        packageItem.setImage(pkg.getIconImage());
        for (WorkflowProcess process : pkg.getProcesses()) {
            CTreeComboItem processItem = new CTreeComboItem(packageItem, SWT.NONE);
            processItem.setText(process.getName());
            processItem.setImage(process.getIconImage());
        }
    }
}
Also used : WorkflowPackage(com.centurylink.mdw.plugin.designer.model.WorkflowPackage) CTreeComboItem(com.centurylink.swt.widgets.CTreeComboItem) WorkflowProcess(com.centurylink.mdw.plugin.designer.model.WorkflowProcess)

Example 83 with WorkflowProcess

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

the class LogWatcher method openInstance.

private synchronized void openInstance(final ProcessInstanceVO processInstanceInfo) {
    final WorkflowProcess newProcess = new WorkflowProcess(process);
    if (!processInstanceInfo.getProcessId().equals(process.getId())) {
        // must be a subprocess
        ProcessVO subprocVO = new ProcessVO();
        subprocVO.setProcessId(processInstanceInfo.getProcessId());
        subprocVO.setProcessName(processInstanceInfo.getProcessName());
        newProcess.setProcessVO(subprocVO);
    }
    final boolean isEmbedded = isEmbeddedProcess(processInstanceInfo);
    final ProcessInstanceVO pageInfo = isEmbedded ? processInstances.get(processInstanceInfo.getOwnerId()) : processInstanceInfo;
    newProcess.setProcessInstance(pageInfo);
    display.syncExec(new Runnable() {

        public void run() {
            ProcessInstancePage procInstPage = null;
            try {
                IWorkbenchPage page = MdwPlugin.getActivePage();
                ProcessEditor editor = null;
                if (processInstancePages.get(pageInfo.getId()) == null) {
                    newProcess.setDesignerDataAccess(dataAccess);
                    editor = (ProcessEditor) page.openEditor(newProcess, "mdw.editors.process");
                    procInstPage = editor.getProcessCanvasWrapper().getProcessInstancePage();
                    if (procInstPage != null) {
                        processInstancePages.put(pageInfo.getId(), procInstPage);
                    }
                } else if (isEmbedded && processInstancePages.get(processInstanceInfo.getId()) == null) {
                    newProcess.getProject().getDesignerProxy().loadProcessInstance(newProcess, processInstancePages.get(pageInfo.getId()));
                    processInstancePages.put(processInstanceInfo.getId(), processInstancePages.get(pageInfo.getId()));
                } else {
                    editor = (ProcessEditor) page.findEditor(newProcess);
                    if (editor != null)
                        page.activate(editor);
                }
            } catch (Exception ex) {
                PluginMessages.log(ex);
                processInstancePages.remove(processInstanceInfo.getId());
            }
        }
    });
}
Also used : ProcessInstancePage(com.centurylink.mdw.designer.runtime.ProcessInstancePage) ProcessVO(com.centurylink.mdw.model.value.process.ProcessVO) IWorkbenchPage(org.eclipse.ui.IWorkbenchPage) WorkflowProcess(com.centurylink.mdw.plugin.designer.model.WorkflowProcess) ProcessInstanceVO(com.centurylink.mdw.model.value.process.ProcessInstanceVO) ProcessEditor(com.centurylink.mdw.plugin.designer.editors.ProcessEditor) IOException(java.io.IOException)

Example 84 with WorkflowProcess

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

the class ProcessLaunchMainTab method initializeFrom.

public void initializeFrom(ILaunchConfiguration launchConfig) {
    try {
        String wfProject = launchConfig.getAttribute(ProcessLaunchConfiguration.WORKFLOW_PROJECT, "");
        project = WorkflowProjectManager.getInstance().getWorkflowProject(wfProject);
        if (// may no longer be in workspace
        project == null)
            return;
        workflowProjectCombo.setText(project.getName());
        refreshProcesses();
        if (serverStatusThread != null)
            serverStatusThread.interrupt();
        serverStatusThread = new Thread(new ServerStatusChecker());
        serverStatusThread.start();
        String procName = launchConfig.getAttribute(ProcessLaunchConfiguration.PROCESS_NAME, "");
        if (procName.length() > 0) {
            processNameCombo.setText(procName);
            refreshVersions();
        }
        String procVer = launchConfig.getAttribute(ProcessLaunchConfiguration.PROCESS_VERSION, "");
        if (procVer.length() > 0) {
            processVersionCombo.setText(procVer);
            ProcessVO processVO = project.getDesignerProxy().getProcessVO(processNameCombo.getText(), procVer);
            if (processVO != null) {
                process = new WorkflowProcess(project, processVO);
                openProcess(process);
                refreshVariables(process);
            }
        }
        masterRequestIdText.setText(getMasterRequestId());
        ownerText.setText(DESIGNER);
        ownerIdText.setText(getOwnerId().toString());
        if (execModeAsyncButton != null) {
            boolean synchronous = launchConfig.getAttribute(ProcessLaunchConfiguration.SYNCHRONOUS, false);
            execModeAsyncButton.setSelection(!synchronous);
            execModeSyncButton.setSelection(synchronous);
            String responseVarName = launchConfig.getAttribute(ProcessLaunchConfiguration.RESPONSE_VAR_NAME, "");
            responseVarNameCombo.setText(responseVarName);
            responseVarNameCombo.setEnabled(synchronous);
        }
        boolean showLogs = launchConfig.getAttribute(ProcessLaunchConfiguration.SHOW_LOGS, false);
        showLogOutputCheckbox.setSelection(showLogs);
        int logWatcherPort = launchConfig.getAttribute(ProcessLaunchConfiguration.LOG_WATCHER_PORT, project.getServerSettings().getLogWatcherPort());
        logWatcherPortText.setText(String.valueOf(logWatcherPort));
        if (showLogs) {
            boolean liveView = launchConfig.getAttribute(ProcessLaunchConfiguration.LIVE_VIEW, false);
            liveViewCheckbox.setSelection(liveView);
        } else {
            logWatcherPortLabel.setEnabled(false);
            logWatcherPortText.setEnabled(false);
            liveViewCheckbox.setEnabled(false);
        }
        enableLiveView(!project.isRemote());
    } catch (CoreException ex) {
        PluginMessages.uiError(ex, "Launch Init", project);
    }
    validatePage();
}
Also used : CoreException(org.eclipse.core.runtime.CoreException) ProcessVO(com.centurylink.mdw.model.value.process.ProcessVO) WorkflowProcess(com.centurylink.mdw.plugin.designer.model.WorkflowProcess)

Example 85 with WorkflowProcess

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

the class ImportProcessWizard method performImportExport.

void performImportExport(ProgressMonitor progressMonitor) throws IOException, XmlException, DataAccessException, ValidationException, ActionCancelledException {
    DesignerProxy designerProxy = getProject().getDesignerProxy();
    Importer importer = new Importer(designerProxy.getPluginDataAccess(), getShell());
    progressMonitor.progress(10);
    progressMonitor.subTask("Reading XML file");
    byte[] bytes = readFile(getPage().getFilePath());
    progressMonitor.progress(20);
    if (progressMonitor.isCanceled())
        throw new ActionCancelledException();
    progressMonitor.subTask("Performing Import");
    WorkflowProcess newProc = importer.importProcess(getPackage(), getProcess(), new String(bytes));
    setElement(newProc);
    progressMonitor.progress(30);
    designerProxy.toggleProcessLock(newProc, true);
    designerProxy.savePackage(newProc.getPackage());
}
Also used : DesignerProxy(com.centurylink.mdw.plugin.designer.DesignerProxy) ActionCancelledException(com.centurylink.mdw.common.utilities.timer.ActionCancelledException) WorkflowProcess(com.centurylink.mdw.plugin.designer.model.WorkflowProcess) Importer(com.centurylink.mdw.plugin.designer.Importer)

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