use of com.centurylink.mdw.designer.testing.TestFileLine in project mdw-designer by CenturyLinkCloud.
the class ProcessExplorerActionGroup method createOpenInstanceAction.
private IAction createOpenInstanceAction() {
IAction action = new Action() {
@Override
public void run() {
if (openInstanceApplies(getSelection())) {
WorkflowProject project = ((WorkflowElement) getSelection().getFirstElement()).getProject();
try {
Long procInstId = null;
if (getSelection().getFirstElement() instanceof AutomatedTestResults) {
AutomatedTestResults expectedResults = (AutomatedTestResults) getSelection().getFirstElement();
procInstId = expectedResults.getActualProcessInstanceId();
} else if (getSelection().getFirstElement() instanceof LegacyExpectedResults) {
LegacyExpectedResults expectedResult = (LegacyExpectedResults) getSelection().getFirstElement();
java.io.File resultsFile = expectedResult.getActualResultFile();
TestFile testFile = new TestFile(null, resultsFile.getPath());
testFile.load();
TestFileLine line1 = testFile.getLines().get(0);
procInstId = new Long(line1.getWord(3));
}
if (procInstId == null) {
MessageDialog.openWarning(view.getSite().getShell(), "No Results", "Unable to locate results file.");
return;
}
ProcessInstanceVO procInst = project.getDataAccess().getProcessInstance(procInstId);
Long processId = procInst.getProcessId();
ProcessVO procVO = project.getProcess(processId).getProcessVO();
if (procVO == null)
PluginMessages.uiError("Unable to locate process: " + processId, OPEN_PROCESS_INSTANCE, project);
WorkflowProcess instance = new WorkflowProcess(project, procVO);
instance.setProcessInstance(procInst);
actionHandler.open(instance);
} catch (Exception ex) {
PluginMessages.uiError(ex, OPEN_PROCESS_INSTANCE, project);
}
}
}
};
action.setText(OPEN_PROCESS_INSTANCE);
action.setId(MdwMenuManager.MDW_MENU_PREFIX + OPEN_PROCESS_INSTANCE);
ImageDescriptor imageDesc = MdwPlugin.getImageDescriptor(ICON_PROCESS_GIF);
action.setImageDescriptor(imageDesc);
return action;
}
use of com.centurylink.mdw.designer.testing.TestFileLine in project mdw-designer by CenturyLinkCloud.
the class AutomatedTestActionGroup method createOpenProcessInstanceAction.
private IAction createOpenProcessInstanceAction() {
IAction action = new Action() {
public void run() {
if (openProcessInstanceApplies(view.getSelectedItem())) {
WorkflowProject project = ((WorkflowElement) view.getSelectedItem()).getProject();
try {
Long procInstId = null;
if (view.getSelectedItem() instanceof AutomatedTestResults) {
AutomatedTestResults expectedResults = (AutomatedTestResults) view.getSelectedItem();
procInstId = expectedResults.getActualProcessInstanceId();
} else if (view.getSelectedItem() instanceof LegacyExpectedResults) {
LegacyExpectedResults expectedResult = (LegacyExpectedResults) view.getSelectedItem();
File resultsFile = expectedResult.getActualResultFile();
TestFile testFile = new TestFile(null, resultsFile.getPath());
testFile.load();
TestFileLine line1 = testFile.getLines().get(0);
procInstId = new Long(line1.getWord(3));
}
if (procInstId == null) {
MessageDialog.openWarning(view.getSite().getShell(), "No Results", "Unable to locate results file.");
return;
}
ProcessInstanceVO procInst = project.getDataAccess().getProcessInstance(procInstId);
Long processId = procInst.getProcessId();
ProcessVO procVO = project.getProcess(processId).getProcessVO();
if (procVO == null)
PluginMessages.uiError("Unable to locate process: " + processId, "Open Process Instance", project);
WorkflowProcess instance = new WorkflowProcess(project, procVO);
instance.setProcessInstance(procInst);
actionHandler.open(instance);
} catch (Exception ex) {
PluginMessages.uiError(ex, "Open Process Instance", project);
}
}
}
};
action.setId(MdwMenuManager.MDW_MENU_PREFIX + "open.process.instance");
action.setText("Open Process Instance");
ImageDescriptor imageDesc = MdwPlugin.getImageDescriptor("icons/process.gif");
action.setImageDescriptor(imageDesc);
return action;
}
Aggregations