use of com.centurylink.mdw.designer.display.DesignerDataModel in project mdw-designer by CenturyLinkCloud.
the class MainFrame method startSession.
/**
* Uses 50% of progressMonitor.
*/
public void startSession(String cuid, Server server, ProgressMonitor progressMonitor, Map<String, String> connectParams, boolean oldNamespaces, boolean remoteRetrieve) throws RemoteException, DataAccessException {
this.cuid = cuid;
dao = new DesignerDataAccess(server, serverList, this.cuid, connectParams, oldNamespaces, remoteRetrieve);
model = new DesignerDataModel();
pages = new HashMap<>();
iconFactory.setDesignerDataAccess(dao);
model.setDatabaseSchemaVersion(dao.getDatabaseSchemaVersion());
if (progressMonitor != null) {
progressMonitor.progress(5);
progressMonitor.subTask("Loading reference information");
}
model.reloadVariableTypes(dao);
model.reloadRoleNames(dao);
model.reloadTaskCategories(dao);
// privileges must be loaded before loading groups/process/resource
model.reloadPriviledges(dao, cuid);
model.reloadGroups(dao);
if (progressMonitor != null)
progressMonitor.progress(5);
// resources must be loaded before processes
if (progressMonitor != null)
progressMonitor.subTask("Loading workflow assets");
model.reloadRuleSets(dao);
if (progressMonitor != null)
progressMonitor.progress(15);
// activity implementors must be loaded before processes
if (progressMonitor != null)
progressMonitor.subTask("Loading activity implementors");
model.reloadActivityImplementors(dao);
if (progressMonitor != null)
progressMonitor.progress(5);
if (progressMonitor != null)
progressMonitor.subTask("Loading event handlers");
model.reloadExternalEvents(dao);
if (progressMonitor != null)
progressMonitor.progress(5);
if (progressMonitor != null)
progressMonitor.subTask("Loading task templates");
model.reloadTaskTemplates(dao);
if (progressMonitor != null)
progressMonitor.progress(5);
if (startPage == null || PROCESS_LIST.equals(startPage)) {
if (progressMonitor != null)
progressMonitor.subTask("Loading process list");
// must be after loading rule sets
model.reloadProcesses(dao);
if (progressMonitor != null)
progressMonitor.progress(15);
}
VariableTypeCache.loadCache(model.getVariableTypes());
titleBase = "MDW Designer (" + dao.getSessionIdentity() + ")";
}
use of com.centurylink.mdw.designer.display.DesignerDataModel in project mdw-designer by CenturyLinkCloud.
the class ProcessExplorerActionGroup method refreshRolePermissions.
private void refreshRolePermissions(WorkflowProject project) throws NamingException, RemoteException, DataAccessException {
DesignerDataAccess dao = project.getDesignerDataAccess();
boolean isVCS = project.isFilePersist();
String user = project.getUser().getUsername();
if (!dao.isRolesRefreshed() && isVCS) {
DesignerDataAccess localDao = new DesignerDataAccess(restServer, null, user, null, project.isOldNamespaces(), isVCS);
DesignerDataModel model = project.getDesignerDataModel();
model.reloadRoleNames(localDao);
model.reloadPriviledges(localDao, user);
model.reloadGroups(localDao);
dao.setRolesRefreshed(localDao.isRolesRefreshed());
}
}
use of com.centurylink.mdw.designer.display.DesignerDataModel in project mdw-designer by CenturyLinkCloud.
the class ProcessCanvasWrapper method remove.
public void remove() {
if (!isInstance()) {
// TODO remove old designer data model
DesignerDataModel model = getProject().getDataAccess().getDesignerDataModel();
Graph graph = model.findProcessGraph(getProcess().getProcessVO());
if (graph != null)
model.removeProcessGraph(graph);
getProcess().revert();
}
Toolkit.getDefaultToolkit().removeAWTEventListener(this);
if (designerCanvasSelection != null)
designerCanvasSelection.removeDirtyStateListener(this);
}
Aggregations