Search in sources :

Example 6 with ProcessVO

use of com.centurylink.mdw.model.value.process.ProcessVO in project mdw-designer by CenturyLinkCloud.

the class DeleteProcessDialog method setData.

private void setData() {
    ProcessVO earliest;
    newest = page.getDataModel().getProcesses().get(processIndex);
    earliest = newest;
    while (earliest.getPrevVersion() != null) earliest = earliest.getPrevVersion();
    ProcessVO one = earliest;
    procdefs = new ArrayList<ProcessVO>();
    int i = 0;
    while (one != null) {
        procdefs.add(one);
        i++;
        one = one.getNextVersion();
    }
    included = new Boolean[procdefs.size()];
    deleted = new Boolean[included.length];
    for (i = 0; i < included.length; i++) {
        included[i] = false;
        deleted[i] = false;
    }
}
Also used : ProcessVO(com.centurylink.mdw.model.value.process.ProcessVO)

Example 7 with ProcessVO

use of com.centurylink.mdw.model.value.process.ProcessVO in project mdw-designer by CenturyLinkCloud.

the class DesignerDataModel method addProcess.

private void addProcess(List<ProcessVO> proclist, ProcessVO procdef) {
    int i, n = proclist.size();
    String procname = procdef.getProcessName().toUpperCase();
    for (i = 0; i < n; i++) {
        ProcessVO one = proclist.get(i);
        String oneName = one.getProcessName().toUpperCase();
        int d = procname.compareTo(oneName);
        if (d == 0)
            d = procdef.getProcessName().compareTo(one.getProcessName());
        if (d < 0) {
            procdef.setPrevVersion(null);
            procdef.setNextVersion(null);
            proclist.add(i, procdef);
            return;
        } else if (d == 0) {
            if (procdef.getVersion() >= one.getVersion()) {
                procdef.setNextVersion(null);
                procdef.setPrevVersion(one);
                one.setNextVersion(procdef);
                proclist.set(i, procdef);
            } else
                insertOrderedByVersion(one, procdef);
            return;
        }
    }
    procdef.setPrevVersion(null);
    procdef.setNextVersion(null);
    proclist.add(procdef);
}
Also used : ProcessVO(com.centurylink.mdw.model.value.process.ProcessVO)

Example 8 with ProcessVO

use of com.centurylink.mdw.model.value.process.ProcessVO in project mdw-designer by CenturyLinkCloud.

the class DesignerDataModel method setProcesses.

public void setProcesses(List<ProcessVO> processList) {
    processes = new ArrayList<ProcessVO>();
    privateProcesses = new ArrayList<ProcessVO>();
    for (ProcessVO one : processList) {
        addProcess(processes, one);
    }
}
Also used : ProcessVO(com.centurylink.mdw.model.value.process.ProcessVO)

Example 9 with ProcessVO

use of com.centurylink.mdw.model.value.process.ProcessVO in project mdw-designer by CenturyLinkCloud.

the class Graph method compareProcess.

public void compareProcess(ProcessVO otherproc) {
    this.save_temp_vars();
    HashMap<String, Node> nodemap = new HashMap<String, Node>();
    HashMap<String, Link> linkmap = new HashMap<String, Link>();
    HashMap<String, SubGraph> subgraphmap = new HashMap<String, SubGraph>();
    HashMap<Long, Long> delidmap = new HashMap<Long, Long>();
    String lid;
    for (Node node : nodes) {
        node.getChanges().setChangeType(Changes.NEW);
        lid = getOrGenerateLogicalId(node.nodet);
        nodemap.put(lid, node);
    }
    for (Link link : links) {
        link.getChanges().setChangeType(Changes.NEW);
        lid = getOrGenerateLogicalId(link.conn);
        linkmap.put(lid, link);
    }
    for (SubGraph subgraph : subgraphs) {
        subgraph.getChanges().setChangeType(Changes.NEW);
        lid = getOrGenerateLogicalId(subgraph.getProcessVO());
        subgraphmap.put(lid, subgraph);
        for (Node node : subgraph.nodes) {
            node.getChanges().setChangeType(Changes.NEW);
            lid = getOrGenerateLogicalId(node.nodet);
            nodemap.put(lid, node);
        }
        for (Link link : subgraph.links) {
            link.getChanges().setChangeType(Changes.NEW);
            lid = getOrGenerateLogicalId(link.conn);
            linkmap.put(lid, link);
        }
    }
    for (ActivityVO a : otherproc.getActivities()) {
        checkActivityInSource(a, this, nodemap, delidmap);
    }
    for (WorkTransitionVO t : otherproc.getTransitions()) {
        checkTransitionInSource(t, this, linkmap, delidmap);
    }
    if (otherproc.getSubProcesses() != null) {
        for (ProcessVO subproc : otherproc.getSubProcesses()) {
            lid = subproc.getAttribute(WorkAttributeConstant.LOGICAL_ID);
            SubGraph subgraph;
            if (lid != null && lid.length() > 0)
                subgraph = subgraphmap.get(lid);
            else
                subgraph = null;
            if (subgraph == null) {
                subgraph = this.addSubGraph(subproc, 0, 0, false);
                if (subgraph != null) {
                    if (lid == null || lid.length() == 0) {
                        lid = this.generateLogicalId("P");
                        subgraph.setAttribute(WorkAttributeConstant.LOGICAL_ID, lid);
                    }
                    subgraph.getChanges().setChangeType(Changes.DELETE);
                    delidmap.put(subproc.getProcessId(), subgraph.getId());
                    subgraphmap.put(lid, subgraph);
                } else {
                // TODO when both have same type of subprocesses, cannot
                // add the other one. How do we show the difference?
                }
            } else {
                subgraph.getChanges().setChangeType(Changes.NONE);
                for (ActivityVO a : subproc.getActivities()) {
                    checkActivityInSource(a, subgraph, nodemap, delidmap);
                }
                for (WorkTransitionVO t : subproc.getTransitions()) {
                    checkTransitionInSource(t, subgraph, linkmap, delidmap);
                }
            }
        }
    }
}
Also used : WorkTransitionVO(com.centurylink.mdw.model.value.work.WorkTransitionVO) HashMap(java.util.HashMap) ActivityVO(com.centurylink.mdw.model.value.activity.ActivityVO) MbengNode(com.qwest.mbeng.MbengNode) ProcessVO(com.centurylink.mdw.model.value.process.ProcessVO)

Example 10 with ProcessVO

use of com.centurylink.mdw.model.value.process.ProcessVO in project mdw-designer by CenturyLinkCloud.

the class Graph method reinit.

/**
 * Invoked loading an existing process definition or process instance
 * Invoked after saving the process
 * Also invoked by constructor above.
 */
public void reinit(ProcessVO processVO) {
    this.processVO = processVO;
    this.geo_attribute = WorkAttributeConstant.WORK_DISPLAY_INFO;
    nodes = new Vector<Node>();
    links = new Vector<Link>();
    subgraphs = new ArrayList<SubGraph>();
    notes = null;
    dirtyLevel = CLEAN;
    originalName = processVO.getProcessName();
    zoom = 100;
    largestActivityLogicalId = -1;
    largestTransitionLogicalId = -1;
    Node node, node2;
    Link link;
    ActivityVO nodet;
    WorkTransitionVO conn;
    parseCoord(geo_attribute);
    arrowstyle = getAttribute(Link.ATTRIBUTE_ARROW_STYLE);
    if (arrowstyle == null)
        arrowstyle = Link.ARROW_STYLE_END;
    nodestyle = getAttribute(Node.ATTRIBUTE_NODE_STYLE);
    if (nodestyle == null)
        nodestyle = Node.NODE_STYLE_ICON;
    int i, n;
    List<ActivityVO> nodes0 = processVO.getActivities();
    n = nodes0 == null ? 0 : nodes0.size();
    for (i = 0; i < n; i++) {
        nodet = processVO.getActivities().get(i);
        node = new Node(nodet, this, metainfo);
        nodes.add(node);
    }
    List<WorkTransitionVO> connectors = processVO.getTransitions();
    n = connectors == null ? 0 : connectors.size();
    for (i = 0; i < n; i++) {
        conn = processVO.getTransitions().get(i);
        node = findNode(conn.getFromWorkId());
        node2 = findNode(conn.getToWorkId());
        if (node != null && node2 != null) {
            link = new Link(node, node2, conn, arrowstyle);
            links.add(link);
        }
    }
    List<ProcessVO> subprocs = processVO.getSubProcesses();
    if (subprocs != null) {
        for (ProcessVO subproc : subprocs) {
            SubGraph subgraph = new SubGraph(subproc, this, metainfo, getIconFactory());
            subgraphs.add(subgraph);
        }
    }
    if (processVO.getTextNotes() != null) {
        for (TextNoteVO note : processVO.getTextNotes()) {
            if (notes == null)
                notes = new ArrayList<TextNote>();
            notes.add(new TextNote(note, this));
        }
    }
}
Also used : WorkTransitionVO(com.centurylink.mdw.model.value.work.WorkTransitionVO) ActivityVO(com.centurylink.mdw.model.value.activity.ActivityVO) MbengNode(com.qwest.mbeng.MbengNode) ArrayList(java.util.ArrayList) ProcessVO(com.centurylink.mdw.model.value.process.ProcessVO) TextNoteVO(com.centurylink.mdw.model.value.activity.TextNoteVO)

Aggregations

ProcessVO (com.centurylink.mdw.model.value.process.ProcessVO)92 ArrayList (java.util.ArrayList)29 WorkflowProcess (com.centurylink.mdw.plugin.designer.model.WorkflowProcess)28 DataAccessException (com.centurylink.mdw.common.exception.DataAccessException)25 ValidationException (com.centurylink.mdw.designer.utils.ValidationException)17 IOException (java.io.IOException)17 HashMap (java.util.HashMap)15 RemoteException (java.rmi.RemoteException)14 ProcessWorker (com.centurylink.mdw.designer.utils.ProcessWorker)12 ActivityVO (com.centurylink.mdw.model.value.activity.ActivityVO)11 PackageVO (com.centurylink.mdw.model.value.process.PackageVO)11 JSONException (org.json.JSONException)11 RuleSetVO (com.centurylink.mdw.model.value.attribute.RuleSetVO)10 XmlException (org.apache.xmlbeans.XmlException)10 ActivityImplementorVO (com.centurylink.mdw.model.value.activity.ActivityImplementorVO)9 ProcessInstanceVO (com.centurylink.mdw.model.value.process.ProcessInstanceVO)9 DataAccessOfflineException (com.centurylink.mdw.dataaccess.DataAccessOfflineException)8 ExternalEventVO (com.centurylink.mdw.model.value.event.ExternalEventVO)8 VariableVO (com.centurylink.mdw.model.value.variable.VariableVO)7 AuthenticationException (com.centurylink.mdw.auth.AuthenticationException)5