Search in sources :

Example 1 with Swimlane

use of io.automatiko.engine.workflow.base.core.context.swimlane.Swimlane in project automatiko-engine by automatiko-io.

the class XmlBPMNProcessDumper method visitLanes.

private void visitLanes(WorkflowProcess process, StringBuilder xmlDump) {
    // lanes
    Collection<Swimlane> swimlanes = ((SwimlaneContext) ((io.automatiko.engine.workflow.process.core.WorkflowProcess) process).getDefaultContext(SwimlaneContext.SWIMLANE_SCOPE)).getSwimlanes();
    if (!swimlanes.isEmpty()) {
        xmlDump.append("    <laneSet>" + EOL);
        for (Swimlane swimlane : swimlanes) {
            xmlDump.append("      <lane name=\"" + XmlBPMNProcessDumper.replaceIllegalCharsAttribute(swimlane.getName()) + "\" >" + EOL);
            visitLane(process, swimlane.getName(), xmlDump);
            xmlDump.append("      </lane>" + EOL);
        }
        xmlDump.append("    </laneSet>" + EOL);
    }
}
Also used : SwimlaneContext(io.automatiko.engine.workflow.base.core.context.swimlane.SwimlaneContext) Swimlane(io.automatiko.engine.workflow.base.core.context.swimlane.Swimlane)

Example 2 with Swimlane

use of io.automatiko.engine.workflow.base.core.context.swimlane.Swimlane in project automatiko-engine by automatiko-io.

the class SwimlaneHandler method start.

public Object start(final String uri, final String localName, final Attributes attrs, final ExtensibleXmlParser parser) throws SAXException {
    parser.startElementBuilder(localName, attrs);
    WorkflowProcessImpl process = (WorkflowProcessImpl) parser.getParent();
    final String name = attrs.getValue("name");
    emptyAttributeCheck(localName, "name", name, parser);
    SwimlaneContext swimlaneContext = (SwimlaneContext) process.getDefaultContext(SwimlaneContext.SWIMLANE_SCOPE);
    if (swimlaneContext != null) {
        Swimlane swimlane = new Swimlane();
        swimlane.setName(name);
        swimlaneContext.addSwimlane(swimlane);
    } else {
        throw new SAXParseException("Could not find default swimlane context.", parser.getLocator());
    }
    return null;
}
Also used : SwimlaneContext(io.automatiko.engine.workflow.base.core.context.swimlane.SwimlaneContext) Swimlane(io.automatiko.engine.workflow.base.core.context.swimlane.Swimlane) SAXParseException(org.xml.sax.SAXParseException) WorkflowProcessImpl(io.automatiko.engine.workflow.process.core.impl.WorkflowProcessImpl)

Example 3 with Swimlane

use of io.automatiko.engine.workflow.base.core.context.swimlane.Swimlane in project automatiko-engine by automatiko-io.

the class XmlWorkflowProcessDumper method visitSwimlanes.

private void visitSwimlanes(Collection<Swimlane> swimlanes, StringBuilder xmlDump) {
    if (swimlanes != null && swimlanes.size() > 0) {
        xmlDump.append("    <swimlanes>" + EOL);
        for (Swimlane swimlane : swimlanes) {
            xmlDump.append("      <swimlane name=\"" + swimlane.getName() + "\" />" + EOL);
        }
        xmlDump.append("    </swimlanes>" + EOL);
    }
}
Also used : Swimlane(io.automatiko.engine.workflow.base.core.context.swimlane.Swimlane)

Example 4 with Swimlane

use of io.automatiko.engine.workflow.base.core.context.swimlane.Swimlane in project automatiko-engine by automatiko-io.

the class ProcessHandler method assignLanes.

private void assignLanes(ExecutableProcess process, List<Lane> lanes) {
    List<String> laneNames = new ArrayList<String>();
    Map<String, String> laneMapping = new HashMap<String, String>();
    if (lanes != null) {
        for (Lane lane : lanes) {
            String name = lane.getName();
            if (name != null) {
                Swimlane swimlane = new Swimlane();
                swimlane.setName(name);
                process.getSwimlaneContext().addSwimlane(swimlane);
                laneNames.add(name);
                for (String flowElementRef : lane.getFlowElements()) {
                    laneMapping.put(flowElementRef, name);
                }
            }
        }
    }
    assignLanes(process, laneMapping);
}
Also used : Swimlane(io.automatiko.engine.workflow.base.core.context.swimlane.Swimlane) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) Lane(io.automatiko.engine.workflow.bpmn2.core.Lane)

Example 5 with Swimlane

use of io.automatiko.engine.workflow.base.core.context.swimlane.Swimlane in project automatiko-engine by automatiko-io.

the class ExecutableProcessFactory method swimlane.

public ExecutableProcessFactory swimlane(String name) {
    Swimlane swimlane = new Swimlane();
    swimlane.setName(name);
    getExecutableProcess().getSwimlaneContext().addSwimlane(swimlane);
    return this;
}
Also used : Swimlane(io.automatiko.engine.workflow.base.core.context.swimlane.Swimlane)

Aggregations

Swimlane (io.automatiko.engine.workflow.base.core.context.swimlane.Swimlane)5 SwimlaneContext (io.automatiko.engine.workflow.base.core.context.swimlane.SwimlaneContext)2 Lane (io.automatiko.engine.workflow.bpmn2.core.Lane)1 WorkflowProcessImpl (io.automatiko.engine.workflow.process.core.impl.WorkflowProcessImpl)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 SAXParseException (org.xml.sax.SAXParseException)1