use of com.centurylink.mdw.plugin.project.model.WorkflowProject in project mdw-designer by CenturyLinkCloud.
the class WorkflowElementActionHandler method stop.
public void stop(Object element) {
if (element instanceof WorkflowProject || element instanceof ServerSettings) {
ServerSettings serverSettings;
if (element instanceof WorkflowProject) {
WorkflowProject workflowProject = (WorkflowProject) element;
serverSettings = workflowProject.getServerSettings();
} else {
serverSettings = (ServerSettings) element;
}
ServerRunner runner = new ServerRunner(serverSettings, getShell().getDisplay());
runner.stop();
}
}
use of com.centurylink.mdw.plugin.project.model.WorkflowProject in project mdw-designer by CenturyLinkCloud.
the class WorkflowElementActionHandler method findCallers.
public void findCallers(WorkflowElement element) {
WorkflowProcess processVersion = (WorkflowProcess) element;
List<WorkflowProject> projects = new ArrayList<WorkflowProject>();
projects.add(processVersion.getProject());
Shell shell = MdwPlugin.getActiveWorkbenchWindow().getShell();
ProcessSearchQuery searchQuery = new ProcessSearchQuery(projects, SearchQuery.SearchType.INVOKING_ENTITY, "*", true, shell);
searchQuery.setInvokedEntityId(processVersion.getId());
try {
ProgressMonitorDialog context = new MdwProgressMonitorDialog(shell);
NewSearchUI.runQueryInForeground(context, searchQuery);
// this shouldn't be necessary according to the Eclipse API docs
NewSearchUI.activateSearchResultView();
ISearchResultViewPart part = NewSearchUI.getSearchResultView();
part.updateLabel();
SearchResultsPage page = (SearchResultsPage) part.getActivePage();
page.setSearchQuery(searchQuery);
page.setInput(searchQuery.getSearchResult(), null);
} catch (OperationCanceledException ex) {
MessageDialog.openInformation(shell, "Search Cancelled", "Search for callers cancelled.");
} catch (Exception ex) {
PluginMessages.uiError(shell, ex, "Search for Callers", processVersion.getProject());
}
}
use of com.centurylink.mdw.plugin.project.model.WorkflowProject in project mdw-designer by CenturyLinkCloud.
the class WorkflowElementActionHandler method deploy.
public void deploy(Object element) {
if (element instanceof WorkflowProject || element instanceof ServerSettings) {
ServerSettings serverSettings;
if (element instanceof WorkflowProject) {
WorkflowProject workflowProject = (WorkflowProject) element;
serverSettings = workflowProject.getServerSettings();
MdwPlugin.getDefault().getPreferenceStore().setValue(PreferenceConstants.PREFS_SERVER_WF_PROJECT, workflowProject.getName());
} else {
serverSettings = (ServerSettings) element;
MdwPlugin.getDefault().getPreferenceStore().setValue(PreferenceConstants.PREFS_RUNNING_SERVER, serverSettings.getServerName());
}
ServerConfigurator configurator = ServerConfigurator.Factory.create(serverSettings);
configurator.doDeploy(getShell());
}
}
use of com.centurylink.mdw.plugin.project.model.WorkflowProject in project mdw-designer by CenturyLinkCloud.
the class WorkflowElementActionHandler method refresh.
public void refresh(WorkflowElement element) {
if (element instanceof WorkflowProject) {
final WorkflowProject workflowProject = (WorkflowProject) element;
workflowProject.clear();
workflowProject.fireElementChangeEvent(workflowProject, ChangeType.SETTINGS_CHANGE, null);
BusyIndicator.showWhile(getShell().getDisplay(), new Runnable() {
public void run() {
if (!workflowProject.isFilePersist())
syncOpenEditors(workflowProject);
}
});
} else if (element instanceof AutomatedTestSuite) {
AutomatedTestSuite testSuite = (AutomatedTestSuite) element;
testSuite.readLegacyCases();
testSuite.fireElementChangeEvent(testSuite, ChangeType.SETTINGS_CHANGE, null);
} else if (element instanceof AutomatedTestCase) {
AutomatedTestCase testCase = (AutomatedTestCase) element;
testCase.setTestCase(testCase.getTestCase());
testCase.fireElementChangeEvent(testCase, ChangeType.SETTINGS_CHANGE, null);
}
}
use of com.centurylink.mdw.plugin.project.model.WorkflowProject in project mdw-designer by CenturyLinkCloud.
the class WizardPage method createWorkflowProjectControls.
protected void createWorkflowProjectControls(Composite parent, int ncol, final boolean handleFieldChanged) {
workflowProjects = WorkflowProjectManager.getInstance().getWorkflowProjects();
if (workflowProjects == null || workflowProjects.isEmpty())
MessageDialog.openError(parent.getShell(), "Error", "No MDW projects found");
if (getElement() != null && getElement().getProject() != null) {
workflowProject = getElement().getProject();
} else if (!workflowProjects.isEmpty()) {
for (WorkflowProject project : workflowProjects) {
if (project.isLoaded()) {
workflowProject = project;
break;
}
}
if (workflowProject == null)
// last resort
workflowProject = workflowProjects.get(0);
getElement().setProject(workflowProject);
}
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.horizontalSpan = ncol - 1;
gd.widthHint = 200;
workflowProjectCombo.setLayoutData(gd);
workflowProjectCombo.removeAll();
for (WorkflowProject project : workflowProjects) {
workflowProjectCombo.add(project.getSourceProjectName());
}
workflowProjectCombo.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
workflowProject = WorkflowProjectManager.getInstance().getWorkflowProject(workflowProjectCombo.getText());
getElement().setProject(workflowProject);
if (workflowPackageCombo != null) {
workflowPackageCombo.removeAll();
for (WorkflowPackage packageVersion : workflowProject.getProject().getTopLevelUserVisiblePackages()) workflowPackageCombo.add(packageVersion.getName());
workflowPackageCombo.select(0);
}
if (handleFieldChanged)
handleFieldChanged();
}
});
if (getElement().getProject() != null)
workflowProjectCombo.setText(getElement().getProject().getName());
}
Aggregations