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);
}
}
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;
}
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);
}
}
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);
}
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;
}
Aggregations