use of com.centurylink.mdw.model.value.process.ProcessVO 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.model.value.process.ProcessVO 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.model.value.process.ProcessVO 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.model.value.process.ProcessVO in project mdw-designer by CenturyLinkCloud.
the class ActivityLaunchMainTab method initializeFrom.
@Override
public void initializeFrom(ILaunchConfiguration launchConfig) {
super.initializeFrom(launchConfig);
try {
refreshActivities();
String activityIdStr = launchConfig.getAttribute(ActivityLaunchConfiguration.ACTIVITY_ID, "");
Long activityId = new Long(activityIdStr);
ProcessVO processVO = getProcess().getProcessVO();
activityVO = processVO.getActivityVO(activityId);
int selIdx = 0;
for (int i = 0; i < processVO.getActivities().size(); i++) {
if (processVO.getActivities().get(i).getActivityId().equals(activityVO.getActivityId())) {
selIdx = i;
break;
}
}
activityNameCombo.select(selIdx);
} catch (CoreException ex) {
PluginMessages.uiError(ex, "Launch Init", getProject());
}
validatePage();
}
use of com.centurylink.mdw.model.value.process.ProcessVO in project mdw-designer by CenturyLinkCloud.
the class ImageServletHelper method generateImage.
/**
* Generate a process image from the designer server.
*/
private BufferedImage generateImage(ProcessInstanceVO pProcInst, DesignerDataAccess dao) throws ServletException {
try {
log("Loading Process " + pProcInst.getProcessId());
NodeMetaInfo metainfo = new NodeMetaInfo();
metainfo.init(dao.getActivityImplementors(), DataAccess.currentSchemaVersion);
ProcessVO processVO = dao.getProcess(new Long(pProcInst.getProcessId()), null);
new ProcessWorker().convert_to_designer(processVO);
pProcInst.setProcessName(processVO.getProcessName());
Graph graph = loadCompletionMap(processVO, pProcInst, dao, metainfo);
Dimension graphsize = graph.getGraphSize();
RunTimeDesignerImage canvas = new RunTimeDesignerImage(graph, dao);
int hMargin = 72, vMargin = 72;
BufferedImage image = new BufferedImage(graphsize.width + hMargin, graphsize.height + vMargin, BufferedImage.TYPE_INT_RGB);
Graphics2D g2 = image.createGraphics();
g2.setBackground(Color.WHITE);
g2.clearRect(0, 0, image.getWidth(), image.getHeight());
canvas.paintComponent(g2);
g2.dispose();
return image;
} catch (Throwable t) {
log(t);
if (t.getCause() != null) {
log(t.getCause());
}
throw new ServletException(t);
}
}
Aggregations