Search in sources :

Example 1 with ProcessInstanceTreeNode

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;
}
Also used : ProcessInstanceTreeNode(com.centurylink.mdw.designer.runtime.ProcessInstanceTreeModel.ProcessInstanceTreeNode) ProcessInstanceTreeModel(com.centurylink.mdw.designer.runtime.ProcessInstanceTreeModel)

Example 2 with ProcessInstanceTreeNode

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;
}
Also used : ProcessInstanceTreeNode(com.centurylink.mdw.designer.runtime.ProcessInstanceTreeModel.ProcessInstanceTreeNode)

Example 3 with ProcessInstanceTreeNode

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;
}
Also used : ProcessInstanceTreeNode(com.centurylink.mdw.designer.runtime.ProcessInstanceTreeModel.ProcessInstanceTreeNode) ProcessInstanceVO(com.centurylink.mdw.model.value.process.ProcessInstanceVO)

Aggregations

ProcessInstanceTreeNode (com.centurylink.mdw.designer.runtime.ProcessInstanceTreeModel.ProcessInstanceTreeNode)3 ProcessInstanceTreeModel (com.centurylink.mdw.designer.runtime.ProcessInstanceTreeModel)1 ProcessInstanceVO (com.centurylink.mdw.model.value.process.ProcessInstanceVO)1