本文整理汇总了Java中org.activiti.bpmn.model.Lane类的典型用法代码示例。如果您正苦于以下问题:Java Lane类的具体用法?Java Lane怎么用?Java Lane使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Lane类属于org.activiti.bpmn.model包,在下文中一共展示了Lane类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parse
import org.activiti.bpmn.model.Lane; //导入依赖的package包/类
public void parse(XMLStreamReader xtr, Process activeProcess) throws Exception {
Lane lane = new Lane();
BpmnXMLUtil.addXMLLocation(lane, xtr);
lane.setId(xtr.getAttributeValue(null, ATTRIBUTE_ID));
lane.setName(xtr.getAttributeValue(null, ATTRIBUTE_NAME));
lane.setParentProcess(activeProcess);
activeProcess.getLanes().add(lane);
while (xtr.hasNext()) {
xtr.next();
if (xtr.isStartElement() && ATTRIBUTE_FLOWNODE_REF.equalsIgnoreCase(xtr.getLocalName())) {
lane.getFlowReferences().add(xtr.getElementText());
} else if(xtr.isEndElement() && ELEMENT_LANE.equalsIgnoreCase(xtr.getLocalName())) {
break;
}
}
}
示例2: writeLanes
import org.activiti.bpmn.model.Lane; //导入依赖的package包/类
public static void writeLanes(Process process, XMLStreamWriter xtw) throws Exception {
if(process.getLanes().size() > 0) {
xtw.writeStartElement(ELEMENT_LANESET);
xtw.writeAttribute(ATTRIBUTE_ID, "laneSet_" + process.getId());
for (Lane lane : process.getLanes()) {
xtw.writeStartElement(ELEMENT_LANE);
xtw.writeAttribute(ATTRIBUTE_ID, lane.getId());
if(StringUtils.isNotEmpty(lane.getName())) {
xtw.writeAttribute(ATTRIBUTE_NAME, lane.getName());
}
for (String flowNodeRef : lane.getFlowReferences()) {
xtw.writeStartElement(ATTRIBUTE_FLOWNODE_REF);
xtw.writeCharacters(flowNodeRef);
xtw.writeEndElement();
}
xtw.writeEndElement();
}
xtw.writeEndElement();
}
}
示例3: validateModel
import org.activiti.bpmn.model.Lane; //导入依赖的package包/类
private void validateModel(BpmnModel model) {
assertEquals(1, model.getPools().size());
Pool pool = model.getPools().get(0);
assertEquals("pool1", pool.getId());
assertEquals("Pool", pool.getName());
Process process = model.getProcess(pool.getId());
assertNotNull(process);
assertEquals(2, process.getLanes().size());
Lane lane = process.getLanes().get(0);
assertEquals("lane1", lane.getId());
assertEquals("Lane 1", lane.getName());
assertEquals(2, lane.getFlowReferences().size());
lane = process.getLanes().get(1);
assertEquals("lane2", lane.getId());
assertEquals("Lane 2", lane.getName());
assertEquals(2, lane.getFlowReferences().size());
FlowElement flowElement = process.getFlowElement("flow1");
assertNotNull(flowElement);
assertTrue(flowElement instanceof SequenceFlow);
}