use of com.centurylink.mdw.plugin.project.model.WorkflowProject in project mdw-designer by CenturyLinkCloud.
the class WorkflowProjectManager method create.
/**
* Creates a workflow project based on a workflow-faceted project.
*/
public WorkflowProject create(IProject project) throws CoreException {
WorkflowProject workflowProject = new WorkflowProject();
ProjectPersist projPersist = new ProjectPersist(workflowProject);
return projPersist.read(project);
}
use of com.centurylink.mdw.plugin.project.model.WorkflowProject in project mdw-designer by CenturyLinkCloud.
the class ExtensionModule method select.
/**
* Object is an instance of WorkflowProject. Return false to suppress
* extension. Default implementation checks for required MDW version (5.1 if
* not specified).
*/
public boolean select(Object object) {
WorkflowProject workflowProject = (WorkflowProject) object;
boolean meetsVersion = new MdwVersion(workflowProject.getMdwVersion()).checkRequiredVersion(requiredMdwVersion);
boolean isEar = workflowProject.isEarProject();
return meetsVersion && isEar;
}
use of com.centurylink.mdw.plugin.project.model.WorkflowProject in project mdw-designer by CenturyLinkCloud.
the class ProcessLaunchConfiguration method launch.
public void launch(ILaunchConfiguration launchConfig, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
String wfProjectName = launchConfig.getAttribute(WORKFLOW_PROJECT, "");
WorkflowProject workflowProject = WorkflowProjectManager.getInstance().getWorkflowProject(wfProjectName);
if (workflowProject == null) {
showError("Can't locate workflow project: '" + wfProjectName + "'.", PROCESS_LAUNCH, null);
return;
}
if (mode.equals(ILaunchManager.DEBUG_MODE) && !connectForDebug(workflowProject, launchConfig)) {
return;
}
setWriteToConsole(launchConfig.getAttribute(IDebugUIConstants.ATTR_CAPTURE_IN_CONSOLE, true));
boolean viaExternalEvent = launchConfig.getAttribute(LAUNCH_VIA_EXTERNAL_EVENT, false);
if (viaExternalEvent) {
String request = launchConfig.getAttribute(EXTERNAL_EVENT_REQUEST, "");
fireExternalEvent(workflowProject, request, null);
return;
}
boolean notifyProcess = launchConfig.getAttribute(NOTIFY_PROCESS, false);
if (notifyProcess) {
String eventName = launchConfig.getAttribute(NOTIFY_PROCESS_EVENT, "");
String message = launchConfig.getAttribute(NOTIFY_PROCESS_REQUEST, "");
notifyProcess(workflowProject, eventName, message, null);
return;
}
String processName = launchConfig.getAttribute(PROCESS_NAME, "");
String processVersion = launchConfig.getAttribute(PROCESS_VERSION, "");
WorkflowProcess process = workflowProject.getProcess(processName, processVersion);
if (process == null) {
// handle condition: obsolete version no longer in project list, but
// not yet in archive
ProcessVO procVO = workflowProject.getDesignerProxy().getProcessVO(processName, processVersion);
if (procVO == null) {
showError("Can't locate process '" + processName + " v" + processVersion + "' in " + wfProjectName + ".", PROCESS_LAUNCH, workflowProject);
return;
} else {
process = new WorkflowProcess(workflowProject, procVO);
}
}
String masterRequestId = launchConfig.getAttribute(MASTER_REQUEST_ID, "");
if (masterRequestId.length() == 0) {
showError("Missing masterRequestId.", PROCESS_LAUNCH, workflowProject);
return;
}
String owner = launchConfig.getAttribute(OWNER, "");
String ownerId = launchConfig.getAttribute(OWNER_ID, "");
boolean synchronous = launchConfig.getAttribute(SYNCHRONOUS, false);
String responseVarName = launchConfig.getAttribute(RESPONSE_VAR_NAME, "");
Map<String, String> variableValues = launchConfig.getAttribute(VARIABLE_VALUES, new HashMap<String, String>());
boolean showLogs = launchConfig.getAttribute(SHOW_LOGS, false);
boolean liveView = launchConfig.getAttribute(LIVE_VIEW, false);
launchProcess(process, masterRequestId, owner, new Long(ownerId), synchronous, responseVarName, variableValues, null, showLogs, liveView);
}
use of com.centurylink.mdw.plugin.project.model.WorkflowProject in project mdw-designer by CenturyLinkCloud.
the class ServerRunnerLaunchShortcut method launch.
public void launch(ISelection selection, String mode) {
Object firstElement = ((StructuredSelection) selection).getFirstElement();
IProject project = null;
if (firstElement instanceof IProject)
project = (IProject) firstElement;
else if (firstElement instanceof IJavaProject)
project = ((IJavaProject) firstElement).getProject();
else
throw new IllegalArgumentException("Unsupported selection: " + firstElement);
WorkflowProject workflowProject = WorkflowProjectManager.getInstance().getWorkflowProject(project);
WorkflowElementActionHandler actionHandler = new WorkflowElementActionHandler();
actionHandler.run(workflowProject);
}
use of com.centurylink.mdw.plugin.project.model.WorkflowProject in project mdw-designer by CenturyLinkCloud.
the class TestSuiteLaunchTab method createWorkflowProjectSection.
protected void createWorkflowProjectSection(Composite parent) {
List<WorkflowProject> workflowProjects = WorkflowProjectManager.getInstance().getWorkflowProjects();
if (workflowProjects == null || workflowProjects.size() == 0)
MessageDialog.openError(parent.getShell(), "Error", "No MDW projects found");
new Label(parent, SWT.NONE).setText("Workflow Project");
workflowProjectCombo = new Combo(parent, SWT.DROP_DOWN | SWT.READ_ONLY);
GridData gd = new GridData(GridData.BEGINNING);
gd.widthHint = 200;
gd.verticalIndent = 3;
workflowProjectCombo.setLayoutData(gd);
workflowProjectCombo.removeAll();
for (WorkflowProject project : workflowProjects) {
workflowProjectCombo.add(project.getName());
}
workflowProjectCombo.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
project = WorkflowProjectManager.getInstance().getWorkflowProject(workflowProjectCombo.getText());
workflowPackage = null;
fillWorkflowPackageCombo();
resultsPathText.setText(project.getTestResultsPath(getAttrPrefix()));
refreshTestCasesTable();
setDirty(true);
validatePage();
}
});
}
Aggregations