Java Code Examples for org.flowable.bpmn.model.Process#getLanes()
The following examples show how to use
org.flowable.bpmn.model.Process#getLanes() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ModelImageService.java From flowable-engine with Apache License 2.0 | 5 votes |
protected void scaleDiagram(BpmnModel bpmnModel, double scaleFactor) { for (Pool pool : bpmnModel.getPools()) { GraphicInfo graphicInfo = bpmnModel.getGraphicInfo(pool.getId()); scaleGraphicInfo(graphicInfo, scaleFactor); } for (Process process : bpmnModel.getProcesses()) { scaleFlowElements(process.getFlowElements(), bpmnModel, scaleFactor); scaleArtifacts(process.getArtifacts(), bpmnModel, scaleFactor); for (Lane lane : process.getLanes()) { scaleGraphicInfo(bpmnModel.getGraphicInfo(lane.getId()), scaleFactor); } } }
Example 2
Source File: LaneExtensionTest.java From flowable-engine with Apache License 2.0 | 5 votes |
@Test @Deployment public void testLaneExtensionElement() { ProcessDefinition processDefinition = activitiRule.getRepositoryService().createProcessDefinitionQuery() .processDefinitionKey("swimlane-extension").singleResult(); BpmnModel bpmnModel = activitiRule.getRepositoryService().getBpmnModel(processDefinition.getId()); byte[] xml = new BpmnXMLConverter().convertToXML(bpmnModel); System.out.println(new String(xml)); Process bpmnProcess = bpmnModel.getMainProcess(); for (Lane l : bpmnProcess.getLanes()) { Map<String, List<ExtensionElement>> extensions = l.getExtensionElements(); Assert.assertTrue(extensions.size() > 0); } }
Example 3
Source File: LaneExtensionTest.java From flowable-engine with Apache License 2.0 | 5 votes |
@Test @Deployment public void testLaneExtensionElement() { ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionKey("swimlane-extension").singleResult(); BpmnModel bpmnModel = repositoryService.getBpmnModel(processDefinition.getId()); byte[] xml = new BpmnXMLConverter().convertToXML(bpmnModel); Process bpmnProcess = bpmnModel.getMainProcess(); for (Lane l : bpmnProcess.getLanes()) { Map<String, List<ExtensionElement>> extensions = l.getExtensionElements(); assertThat(extensions).isNotEmpty(); } }
Example 4
Source File: LaneExport.java From flowable-engine with Apache License 2.0 | 5 votes |
public static void writeLanes(Process process, BpmnModel model, XMLStreamWriter xtw) throws Exception { if (!process.getLanes().isEmpty()) { 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()); } boolean didWriteExtensionStartElement = BpmnXMLUtil.writeExtensionElements(lane, false, model.getNamespaces(), xtw); if (didWriteExtensionStartElement) { xtw.writeEndElement(); } for (String flowNodeRef : lane.getFlowReferences()) { xtw.writeStartElement(ELEMENT_FLOWNODE_REF); xtw.writeCharacters(flowNodeRef); xtw.writeEndElement(); } xtw.writeEndElement(); } xtw.writeEndElement(); } }