use of com.centurylink.mdw.plugin.designer.model.WorkflowPackage in project mdw-designer by CenturyLinkCloud.
the class WorkflowElementActionHandler method tagVersion.
public void tagVersion(WorkflowElement[] elements) {
final List<WorkflowPackage> packages = new ArrayList<WorkflowPackage>();
for (WorkflowElement element : elements) {
if (element instanceof WorkflowPackage)
packages.add((WorkflowPackage) element);
else
throw new UnsupportedOperationException("Invalid type for tagVersion: " + element.getClass().getName());
}
MdwListInputDialog dlg = new MdwListInputDialog(getShell(), "Tag Workflow Package(s)", "Enter tag to apply to package versions", packages);
if (dlg.open() == Dialog.CANCEL)
return;
final String tag = dlg.getInput();
if (tag == null)
return;
BusyIndicator.showWhile(getShell().getDisplay(), new Runnable() {
public void run() {
for (final WorkflowPackage pkg : packages) {
try {
DesignerProxy dp = pkg.getProject().getDesignerProxy();
dp.tagPackage(pkg, tag);
} catch (Exception ex) {
PluginMessages.uiError(ex, "Tag Package", pkg.getProject());
break;
}
}
}
});
}
use of com.centurylink.mdw.plugin.designer.model.WorkflowPackage in project mdw-designer by CenturyLinkCloud.
the class WorkflowElementActionHandler method exportAttributes.
public void exportAttributes(String attributePrefix, WorkflowElement element) {
if (element instanceof WorkflowPackage || element instanceof WorkflowProcess) {
ExportAttributesWizard exportAttributesWizard = new ExportAttributesWizard();
exportAttributesWizard.init(getWorkbench(), element);
exportAttributesWizard.setPrefix(attributePrefix);
new WizardDialog(getShell(), exportAttributesWizard).open();
}
}
use of com.centurylink.mdw.plugin.designer.model.WorkflowPackage 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());
}
use of com.centurylink.mdw.plugin.designer.model.WorkflowPackage in project mdw-designer by CenturyLinkCloud.
the class TaskInstancesSection method openTaskInstance.
private void openTaskInstance(TaskInstanceVO taskInstanceVO) {
String path;
if (activity.getProject().checkRequiredVersion(6, 0)) {
path = "#/tasks/" + taskInstanceVO.getTaskInstanceId();
} else {
boolean assigned = activity.getProject().getUser().getUsername().equals(taskInstanceVO.getTaskClaimUserCuid());
String taskInstParams = activity.getProject().getTaskInstancePath(taskInstanceVO.getTaskInstanceId(), assigned);
WorkflowPackage packageVersion = activity.getPackage();
String packageParam = packageVersion.isDefaultPackage() ? "" : "&packageName=" + packageVersion.getName();
path = taskInstParams + packageParam;
}
WebApp webapp = activity.getProject().checkRequiredVersion(5, 5) ? WebApp.MdwHub : WebApp.TaskManager;
WebLaunchActions.getLaunchAction(activity.getProject(), webapp).launch(activity.getProject(), path);
}
use of com.centurylink.mdw.plugin.designer.model.WorkflowPackage in project mdw-designer by CenturyLinkCloud.
the class ProcessSaveAsDialog method createDialogArea.
@Override
protected Control createDialogArea(Composite parent) {
Composite composite = (Composite) super.createDialogArea(parent);
composite.getShell().setText("Save Process As�");
// package selection
new Label(composite, SWT.NONE).setText("Workflow Package");
workflowPackageCombo = new Combo(composite, SWT.DROP_DOWN | SWT.READ_ONLY);
GridData grid = new GridData(SWT.BEGINNING);
grid.horizontalSpan = 2;
grid.widthHint = 150;
workflowPackageCombo.setLayoutData(grid);
workflowPackageCombo.removeAll();
for (WorkflowPackage packageVersion : this.process.getProject().getTopLevelUserVisiblePackages()) workflowPackageCombo.add(packageVersion.getName());
workflowPackageCombo.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
packageName = workflowPackageCombo.getText().trim();
if (!StringHelper.isEmpty(packageName))
newPackage = getProject().getPackage(packageName);
}
});
if (getProcess().getPackage() != null) {
packageName = getProcess().getPackage().getName();
workflowPackageCombo.setText(packageName);
}
// process name
new Label(composite, SWT.NONE).setText("Process Name");
newNameTextField = new Text(composite, SWT.BORDER | SWT.SINGLE);
GridData gd = new GridData(SWT.LEFT);
gd.widthHint = 200;
newNameTextField.setLayoutData(gd);
newName = newNameTextField.getText().trim();
newNameTextField.setText(newName);
newNameTextField.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
String name = newNameTextField.getText().trim();
String warning = null;
WorkflowPackage processPkg = newPackage == null ? process.getPackage() : newPackage;
if (!processPkg.isUserAuthorized(UserRoleVO.ASSET_DESIGN)) {
warning = "you are not authorized to create a process in selected workflow Package:\n'" + packageName + "'";
} else if (nameAlreadyExists(name)) {
warning = process.getTitle() + " name already exists:\n'" + name + "'";
}
if (warning != null) {
getButton(IDialogConstants.OK_ID).setEnabled(false);
WarningTray tray = getWarningTray();
tray.setMessage(warning);
tray.open();
getButton(Dialog.OK).setEnabled(false);
} else {
newName = name;
getWarningTray().close();
getButton(IDialogConstants.OK_ID).setEnabled(true);
getButton(Dialog.OK).setEnabled(name.length() > 0);
}
}
});
newNameTextField.forceFocus();
return composite;
}
Aggregations