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