Search in sources :

Example 11 with Lane

use of io.automatiko.engine.workflow.bpmn2.core.Lane in project automatiko-engine by automatiko-io.

the class LaneHandler method start.

@SuppressWarnings("unchecked")
public Object start(final String uri, final String localName, final Attributes attrs, final ExtensibleXmlParser parser) throws SAXException {
    parser.startElementBuilder(localName, attrs);
    String id = attrs.getValue("id");
    String name = attrs.getValue("name");
    WorkflowProcess process = (WorkflowProcess) parser.getParent();
    List<Lane> lanes = (List<Lane>) ((ExecutableProcess) process).getMetaData(LaneHandler.LANES);
    if (lanes == null) {
        lanes = new ArrayList<Lane>();
        ((ExecutableProcess) process).setMetaData(LaneHandler.LANES, lanes);
    }
    Lane lane = new Lane(id);
    lane.setName(name);
    lanes.add(lane);
    return lane;
}
Also used : Lane(io.automatiko.engine.workflow.bpmn2.core.Lane) ArrayList(java.util.ArrayList) List(java.util.List) ExecutableProcess(io.automatiko.engine.workflow.process.executable.core.ExecutableProcess) WorkflowProcess(io.automatiko.engine.api.definition.process.WorkflowProcess)

Example 12 with Lane

use of io.automatiko.engine.workflow.bpmn2.core.Lane in project automatiko-engine by automatiko-io.

the class LaneHandler method end.

public Object end(final String uri, final String localName, final ExtensibleXmlParser parser) throws SAXException {
    final Element element = parser.endElementBuilder();
    Lane lane = (Lane) parser.getCurrent();
    org.w3c.dom.Node xmlNode = element.getFirstChild();
    while (xmlNode != null) {
        String nodeName = xmlNode.getNodeName();
        if ("flowNodeRef".equals(nodeName)) {
            String flowElementRef = xmlNode.getTextContent();
            lane.addFlowElement(flowElementRef);
        }
        xmlNode = xmlNode.getNextSibling();
    }
    return lane;
}
Also used : Element(org.w3c.dom.Element) Lane(io.automatiko.engine.workflow.bpmn2.core.Lane)

Aggregations

ArrayList (java.util.ArrayList)9 Lane (org.jbpm.bpmn2.core.Lane)8 List (java.util.List)6 Lane (io.automatiko.engine.workflow.bpmn2.core.Lane)4 RuleFlowProcess (org.jbpm.ruleflow.core.RuleFlowProcess)4 HashMap (java.util.HashMap)3 Element (org.w3c.dom.Element)3 ExecutableProcess (io.automatiko.engine.workflow.process.executable.core.ExecutableProcess)2 Association (org.jbpm.bpmn2.core.Association)2 IntermediateLink (org.jbpm.bpmn2.core.IntermediateLink)2 SequenceFlow (org.jbpm.bpmn2.core.SequenceFlow)2 Swimlane (org.jbpm.process.core.context.swimlane.Swimlane)2 WorkflowProcess (org.kie.api.definition.process.WorkflowProcess)2 WorkflowProcess (io.automatiko.engine.api.definition.process.WorkflowProcess)1 Swimlane (io.automatiko.engine.workflow.base.core.context.swimlane.Swimlane)1 Association (io.automatiko.engine.workflow.bpmn2.core.Association)1 IntermediateLink (io.automatiko.engine.workflow.bpmn2.core.IntermediateLink)1 SequenceFlow (io.automatiko.engine.workflow.bpmn2.core.SequenceFlow)1 DataAssociation (io.automatiko.engine.workflow.process.core.node.DataAssociation)1