use of com.centurylink.mdw.designer.runtime.ProcessInstanceTreeModel.ProcessInstanceTreeNode in project mdw-designer by CenturyLinkCloud.
the class DesignerDataModel method findInstanceTreeAndNode.
public ProcessInstanceTreeModel findInstanceTreeAndNode(Long procInstId, String server, String masterId) {
if (masterId == null)
return null;
ProcessInstanceTreeNode node;
for (int i = 0; i < instanceTrees.size(); i++) {
ProcessInstanceTreeModel model = instanceTrees.get(i);
if (!masterId.equals(model.getMasterRequestId()))
continue;
node = model.find(procInstId, server);
if (node != null) {
model.setCurrentProcess(node);
return model;
}
}
return null;
}
use of com.centurylink.mdw.designer.runtime.ProcessInstanceTreeModel.ProcessInstanceTreeNode in project mdw-designer by CenturyLinkCloud.
the class ProcessInstanceLoader method createOrUpdateModel.
public ProcessInstanceTreeModel createOrUpdateModel(ProcessInstanceTreeModel model) throws Exception {
ProcessInstanceTreeNode node;
if (model != null) {
node = model.getCurrentProcess();
if (processInstance != node.getEntry()) {
node.getEntry().copyFrom(processInstance);
processInstance = node.getEntry();
}
} else {
model = createOrUpdateModelRecursive(processInstance);
}
return model;
}
use of com.centurylink.mdw.designer.runtime.ProcessInstanceTreeModel.ProcessInstanceTreeNode in project mdw-designer by CenturyLinkCloud.
the class ProcessInstanceLoader method createOrUpdateModelRecursive.
private ProcessInstanceTreeModel createOrUpdateModelRecursive(ProcessInstanceVO procInst) throws Exception {
ProcessInstanceTreeModel model;
ProcessInstanceTreeNode node;
if (OwnerType.PROCESS_INSTANCE.equals(procInst.getOwner())) {
// parent is a process instance
model = page.getDataModel().findInstanceTreeAndNode(procInst.getOwnerId(), procInst.getRemoteServer(), procInst.getMasterRequestId());
if (model == null) {
ProcessInstanceVO parentInst = page.frame.dao.getProcessInstanceBase(procInst.getOwnerId(), procInst.getRemoteServer());
model = createOrUpdateModelRecursive(parentInst);
} else {
}
ProcessInstanceTreeNode parentNode = model.getCurrentProcess();
node = parentNode.addChild(model.new ProcessInstanceTreeNode(procInst));
model.setCurrentProcess(node);
} else {
// top level node
model = new ProcessInstanceTreeModel();
node = model.getRoot();
node.setEntry(procInst);
model.setCurrentProcess(node);
}
return model;
}
Aggregations