Search in sources :

Example 91 with ProcessVO

use of com.centurylink.mdw.model.value.process.ProcessVO 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 92 with ProcessVO

use of com.centurylink.mdw.model.value.process.ProcessVO 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)

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