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());
}
}
});
}
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();
}
Aggregations