Search in sources :

Example 1 with ProcessInfo

use of org.jbpm.bpmn2.xml.di.BPMNPlaneHandler.ProcessInfo in project jbpm by kiegroup.

the class BPMNShapeHandler method start.

public Object start(final String uri, final String localName, final Attributes attrs, final ExtensibleXmlParser parser) throws SAXException {
    parser.startElementBuilder(localName, attrs);
    final String elementRef = attrs.getValue("bpmnElement");
    NodeInfo nodeInfo = new NodeInfo(elementRef);
    ProcessInfo processInfo = (ProcessInfo) parser.getParent();
    processInfo.addNodeInfo(nodeInfo);
    return nodeInfo;
}
Also used : ProcessInfo(org.jbpm.bpmn2.xml.di.BPMNPlaneHandler.ProcessInfo)

Example 2 with ProcessInfo

use of org.jbpm.bpmn2.xml.di.BPMNPlaneHandler.ProcessInfo in project jbpm by kiegroup.

the class BPMNEdgeHandler method start.

public Object start(final String uri, final String localName, final Attributes attrs, final ExtensibleXmlParser parser) throws SAXException {
    parser.startElementBuilder(localName, attrs);
    final String elementRef = attrs.getValue("bpmnElement");
    ConnectionInfo info = new ConnectionInfo(elementRef);
    ProcessInfo processInfo = (ProcessInfo) parser.getParent();
    processInfo.addConnectionInfo(info);
    return info;
}
Also used : ProcessInfo(org.jbpm.bpmn2.xml.di.BPMNPlaneHandler.ProcessInfo)

Example 3 with ProcessInfo

use of org.jbpm.bpmn2.xml.di.BPMNPlaneHandler.ProcessInfo in project jbpm by kiegroup.

the class BPMNPlaneHandler method end.

public Object end(final String uri, final String localName, final ExtensibleXmlParser parser) throws SAXException {
    parser.endElementBuilder();
    ProcessInfo processInfo = (ProcessInfo) parser.getCurrent();
    List<Process> processes = ((ProcessBuildData) parser.getData()).getProcesses();
    RuleFlowProcess process = null;
    for (Process p : processes) {
        if (p.getId() != null && p.getId().equals(processInfo.getProcessRef())) {
            process = (RuleFlowProcess) p;
            break;
        }
    }
    if (process != null) {
        for (NodeInfo nodeInfo : processInfo.getNodeInfos()) {
            processNodeInfo(nodeInfo, process.getNodes());
        }
        postProcessNodeOffset(process.getNodes(), 0, 0);
        for (ConnectionInfo connectionInfo : processInfo.getConnectionInfos()) {
            if (connectionInfo.getBendpoints() != null) {
                processConnectionInfo(connectionInfo, process.getNodes());
            }
        }
    }
    return processInfo;
}
Also used : RuleFlowProcess(org.jbpm.ruleflow.core.RuleFlowProcess) ProcessBuildData(org.jbpm.compiler.xml.ProcessBuildData) NodeInfo(org.jbpm.bpmn2.xml.di.BPMNShapeHandler.NodeInfo) Process(org.kie.api.definition.process.Process) RuleFlowProcess(org.jbpm.ruleflow.core.RuleFlowProcess) ConnectionInfo(org.jbpm.bpmn2.xml.di.BPMNEdgeHandler.ConnectionInfo)

Aggregations

ProcessInfo (org.jbpm.bpmn2.xml.di.BPMNPlaneHandler.ProcessInfo)2 ConnectionInfo (org.jbpm.bpmn2.xml.di.BPMNEdgeHandler.ConnectionInfo)1 NodeInfo (org.jbpm.bpmn2.xml.di.BPMNShapeHandler.NodeInfo)1 ProcessBuildData (org.jbpm.compiler.xml.ProcessBuildData)1 RuleFlowProcess (org.jbpm.ruleflow.core.RuleFlowProcess)1 Process (org.kie.api.definition.process.Process)1