Search in sources :

Example 46 with WorkflowProject

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);
}
Also used : WorkflowProject(com.centurylink.mdw.plugin.project.model.WorkflowProject)

Example 47 with WorkflowProject

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;
}
Also used : MdwVersion(com.centurylink.mdw.plugin.project.model.MdwVersion) WorkflowProject(com.centurylink.mdw.plugin.project.model.WorkflowProject)

Example 48 with WorkflowProject

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);
}
Also used : ProcessVO(com.centurylink.mdw.model.value.process.ProcessVO) WorkflowProject(com.centurylink.mdw.plugin.project.model.WorkflowProject) WorkflowProcess(com.centurylink.mdw.plugin.designer.model.WorkflowProcess)

Example 49 with WorkflowProject

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);
}
Also used : WorkflowElementActionHandler(com.centurylink.mdw.plugin.actions.WorkflowElementActionHandler) IJavaProject(org.eclipse.jdt.core.IJavaProject) StructuredSelection(org.eclipse.jface.viewers.StructuredSelection) WorkflowProject(com.centurylink.mdw.plugin.project.model.WorkflowProject) IProject(org.eclipse.core.resources.IProject)

Example 50 with 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();
        }
    });
}
Also used : SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) Label(org.eclipse.swt.widgets.Label) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) WorkflowProject(com.centurylink.mdw.plugin.project.model.WorkflowProject) Combo(org.eclipse.swt.widgets.Combo)

Aggregations

WorkflowProject (com.centurylink.mdw.plugin.project.model.WorkflowProject)128 WorkflowPackage (com.centurylink.mdw.plugin.designer.model.WorkflowPackage)31 WorkflowElement (com.centurylink.mdw.plugin.designer.model.WorkflowElement)25 WebLaunchAction (com.centurylink.mdw.plugin.actions.WebLaunchActions.WebLaunchAction)22 ArrayList (java.util.ArrayList)22 WorkflowProcess (com.centurylink.mdw.plugin.designer.model.WorkflowProcess)21 CoreException (org.eclipse.core.runtime.CoreException)19 Action (org.eclipse.jface.action.Action)19 IAction (org.eclipse.jface.action.IAction)18 IProject (org.eclipse.core.resources.IProject)17 IFile (org.eclipse.core.resources.IFile)16 PartInitException (org.eclipse.ui.PartInitException)16 IWorkbenchAction (org.eclipse.ui.actions.ActionFactory.IWorkbenchAction)16 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)15 ImageDescriptor (org.eclipse.jface.resource.ImageDescriptor)12 AutomatedTestCase (com.centurylink.mdw.plugin.designer.model.AutomatedTestCase)11 InvocationTargetException (java.lang.reflect.InvocationTargetException)11 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)11 IOException (java.io.IOException)10 OperationCanceledException (org.eclipse.core.runtime.OperationCanceledException)9