use of com.centurylink.mdw.plugin.project.model.WorkflowProject in project mdw-designer by CenturyLinkCloud.
the class DesignerProxy method moveWorkflowAssetToPackage.
public Long moveWorkflowAssetToPackage(final Long assetId, final WorkflowPackage targetPackage) {
String progressMsg = "Moving Asset ID: " + assetId + TO_PKG + targetPackage.getName() + "'";
String errorMsg = "Move Workflow Asset";
final WorkflowProject workflowProject = targetPackage.getProject();
final WorkflowAsset asset = workflowProject.getAsset(assetId);
designerRunner = new DesignerRunner(progressMsg, errorMsg, project) {
public void perform() throws ValidationException, DataAccessException, RemoteException {
if (asset.isInDefaultPackage()) {
dataAccess.getDesignerDataAccess().addRuleSetToPackage(asset.getRuleSetVO(), targetPackage.getPackageVO());
WorkflowPackage defaultPackage = workflowProject.getDefaultPackage();
defaultPackage.removeAsset(asset);
} else {
// id can change from repackaging for VCS assets
Long newId = dataAccess.getDesignerDataAccess().addRuleSetToPackage(asset.getRuleSetVO(), targetPackage.getPackageVO());
dataAccess.getDesignerDataAccess().removeRuleSetFromPackage(asset.getRuleSetVO(), asset.getPackage().getPackageVO());
asset.setId(newId);
asset.getPackage().removeAsset(asset);
}
targetPackage.addAsset(asset);
}
};
designerRunner.run();
return asset.getId();
}
use of com.centurylink.mdw.plugin.project.model.WorkflowProject in project mdw-designer by CenturyLinkCloud.
the class DesignerProxy method renamePackage.
public void renamePackage(final WorkflowPackage packageToRename, final String newName) {
if (packageToRename.isDefaultPackage())
return;
final WorkflowProject workflowProject = packageToRename.getProject();
if (workflowProject.packageNameExists(newName)) {
Shell shell = MdwPlugin.getActiveWorkbenchWindow().getShell();
MessageDialog.openError(shell, RENAME_ERROR, "Package name already exists: '" + newName + "'");
return;
}
String progressMsg = "Renaming package to '" + newName + "'";
String errorMsg = "Rename Package";
designerRunner = new DesignerRunner(progressMsg, errorMsg, workflowProject) {
public void perform() throws DataAccessException, RemoteException {
packageToRename.getPackageVO().setId(dataAccess.getDesignerDataAccess().renamePackage(packageToRename.getId(), newName, 1));
}
};
designerRunner.run();
packageToRename.setName(newName);
}
use of com.centurylink.mdw.plugin.project.model.WorkflowProject in project mdw-designer by CenturyLinkCloud.
the class WebToolsAction method run.
public void run(IAction action) {
WorkflowProject workflowProject = getProject(getSelection());
WebLaunchAction launchAction = WebLaunchActions.getLaunchAction(workflowProject, WebApp.WebTools);
if (workflowProject != null)
launchAction.launch(workflowProject);
else if (mostRecentWebToolsLaunchWorkflowProject != null)
launchAction.launch(mostRecentWebToolsLaunchWorkflowProject);
}
use of com.centurylink.mdw.plugin.project.model.WorkflowProject in project mdw-designer by CenturyLinkCloud.
the class WebToolsAction method populateMenu.
/**
* populates the plugin action menu (the webtools icon) with its items
*/
public void populateMenu(Menu menu) {
WorkflowProjectManager wfProjectMgr = WorkflowProjectManager.getInstance();
List<WorkflowProject> workflowProjects = wfProjectMgr.getWorkflowProjects();
if (workflowProjects.isEmpty()) {
MenuItem item = new MenuItem(menu, SWT.NONE);
item.setText("(No Projects)");
item.setImage(MdwPlugin.getImageDescriptor("icons/wait.gif").createImage());
item.setEnabled(false);
} else {
for (final WorkflowProject workflowProject : workflowProjects) {
String projName = workflowProject.isFrameworkProject() ? "MDWFramework" : workflowProject.getName();
// MDWWeb
MenuItem item = new MenuItem(menu, SWT.NONE);
final WebLaunchAction launchAction = WebLaunchActions.getLaunchAction(workflowProject, WebApp.WebTools);
item.setText(projName + " - " + launchAction.getLabel());
item.setImage(launchAction.getIconImage());
item.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
mostRecentWebToolsLaunchWorkflowProject = workflowProject;
launchAction.launch(workflowProject);
}
});
}
}
}
use of com.centurylink.mdw.plugin.project.model.WorkflowProject in project mdw-designer by CenturyLinkCloud.
the class WorkflowElementActionHandler method showInstances.
public void showInstances(WorkflowElement element) {
if (element instanceof WorkflowProject) {
// TODO myTasks is hardcoded
WorkflowProject project = (WorkflowProject) element;
try {
IViewPart viewPart = getPage().showView("mdw.views.designer.list.myTasks");
if (viewPart != null) {
MyTasksView myTasksView = (MyTasksView) viewPart;
myTasksView.setProject(project);
myTasksView.refreshTable();
}
} catch (PartInitException ex) {
PluginMessages.log(ex);
}
} else if (element instanceof WorkflowProcess) {
try {
IViewPart viewPart = getPage().showView("mdw.views.designer.process.instance.list");
if (viewPart != null) {
ProcessInstanceListView instancesView = (ProcessInstanceListView) viewPart;
instancesView.setProcess((WorkflowProcess) element);
}
} catch (PartInitException ex) {
PluginMessages.log(ex);
}
}
}
Aggregations