use of com.centurylink.mdw.plugin.designer.model.WorkflowProcess in project mdw-designer by CenturyLinkCloud.
the class LogWatcher method isEmbeddedProcess.
private boolean isEmbeddedProcess(ProcessInstanceVO processInstance) {
if (processInstance.isNewEmbedded())
return true;
if (!processInstance.getOwner().equals(OwnerType.PROCESS_INSTANCE))
return false;
ProcessInstanceVO parentInstance = processInstances.get(processInstance.getOwnerId());
if (parentInstance == null)
// possible when the instance is a subprocess of an
return false;
// embedded
WorkflowProcess parentProcDef = process.getProject().getProcess(parentInstance.getProcessId());
if (parentProcDef.getProcessVO().getSubProcesses() != null) {
for (ProcessVO childproc : parentProcDef.getProcessVO().getSubProcesses()) {
if (childproc.getProcessId().equals(processInstance.getProcessId()))
return true;
}
}
return false;
}
use of com.centurylink.mdw.plugin.designer.model.WorkflowProcess in project mdw-designer by CenturyLinkCloud.
the class ProcessLaunchMainTab method createProcessSection.
protected void createProcessSection(Composite parent) {
Group processVersionGroup = new Group(parent, SWT.NONE);
processVersionGroup.setText("Process Version");
GridLayout gl = new GridLayout();
gl.numColumns = 5;
processVersionGroup.setLayout(gl);
GridData gd = new GridData(GridData.VERTICAL_ALIGN_BEGINNING | GridData.HORIZONTAL_ALIGN_FILL);
gd.horizontalSpan = 2;
gd.grabExcessHorizontalSpace = true;
processVersionGroup.setLayoutData(gd);
new Label(processVersionGroup, SWT.NONE).setText("Process: ");
processNameCombo = new Combo(processVersionGroup, SWT.DROP_DOWN | SWT.READ_ONLY);
gd = new GridData(GridData.BEGINNING);
gd.widthHint = 250;
processNameCombo.setLayoutData(gd);
refreshProcesses();
processNameCombo.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
refreshVersions();
setDirty(true);
validatePage();
}
});
// spacer
new Label(processVersionGroup, SWT.NONE).setText(" ");
new Label(processVersionGroup, SWT.NONE).setText("Version: ");
processVersionCombo = new Combo(processVersionGroup, SWT.DROP_DOWN | SWT.READ_ONLY);
gd = new GridData(GridData.BEGINNING);
gd.widthHint = 35;
processVersionCombo.setLayoutData(gd);
refreshVersions();
processVersionCombo.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
String version = processVersionCombo.getText();
if (version.length() == 0) {
process = null;
} else {
String name = processNameCombo.getText().trim();
if (name.length() == 0) {
process = null;
} else {
ProcessVO processVO = project.getDesignerProxy().getProcessVO(name, version);
if (processVO != null) {
process = new WorkflowProcess(project, processVO);
openProcess(process);
refreshVariables(process);
}
}
}
setDirty(true);
validatePage();
}
});
}
use of com.centurylink.mdw.plugin.designer.model.WorkflowProcess in project mdw-designer by CenturyLinkCloud.
the class ProcessLaunchMainTab method refreshVersions.
private void refreshVersions() {
processVersionCombo.removeAll();
processVersionCombo.add("");
String processName = processNameCombo.getText();
if (processName.length() == 0) {
process = null;
processVersionCombo.select(0);
} else {
ProcessVO processVO = project.getDesignerProxy().getLatestProcessVO(processName);
process = new WorkflowProcess(project, processVO);
for (WorkflowProcess pv : process.getAllProcessVersions()) {
processVersionCombo.add(pv.getVersionString());
}
processVersionCombo.select(1);
}
}
use of com.centurylink.mdw.plugin.designer.model.WorkflowProcess in project mdw-designer by CenturyLinkCloud.
the class ImportProcessWizard method postRunUpdates.
protected void postRunUpdates() {
WorkflowProcess process = getPage().getProcess();
// don't know whether process was newly created or updated with a new
// version -- fire both
getProject().getDataAccess().getDesignerDataModel().addProcess(process.getProcessVO());
process.sync();
process.addElementChangeListener(getProject());
process.fireElementChangeEvent(ChangeType.ELEMENT_CREATE, process);
process.fireElementChangeEvent(ChangeType.VERSION_CHANGE, process.getVersionString());
}
use of com.centurylink.mdw.plugin.designer.model.WorkflowProcess in project mdw-designer by CenturyLinkCloud.
the class WorkflowAssetEditor method openWorkflowAsset.
private void openWorkflowAsset() {
if (workflowAsset instanceof WorkflowProcess) {
IWorkbenchPage page = MdwPlugin.getActivePage();
WorkflowProcess proc = (WorkflowProcess) workflowAsset;
try {
page.openEditor(proc, "mdw.editors.process");
} catch (PartInitException ex) {
PluginMessages.uiError(MdwPlugin.getShell(), ex, "Open Process", getProject());
}
} else if (workflowAsset instanceof TaskTemplate) {
IWorkbenchPage page = MdwPlugin.getActivePage();
TaskTemplate taskTemplate = (TaskTemplate) workflowAsset;
try {
FileEditorInput editorInput = new FileEditorInput(taskTemplate.getAssetFile());
TaskTemplateEditor editor = (TaskTemplateEditor) page.openEditor(editorInput, "mdw.editors.taskTemplate");
editor.setProcess(getProcess());
} catch (PartInitException ex) {
PluginMessages.uiError(MdwPlugin.getShell(), ex, "Open Process", getProject());
}
} else {
((WorkflowAsset) workflowAsset).openFile(new NullProgressMonitor());
}
}
Aggregations