@Test public void testConvertLanes() { Task task0_1 = mockTask("TASK0_1"); Task task0_2 = mockTask("TASK0_2"); Task task0_3 = mockTask("TASK0_3"); Task task1_1 = mockTask("TASK1_1"); Lane lane1 = mockLane("Lane1", "Lane1Name", task1_1); Task task2_1 = mockTask("TASK2_1"); Lane lane2 = mockLane("Lane2", "Lane2Name", task2_1); LaneSet laneSet1 = mockLaneSet("LaneSet1", lane1, lane2); Task task3_2_1 = mockTask("TASK3_2_1"); Task task3_2_2 = mockTask("TASK3_2_2"); Lane lane3_2 = mockLane("Lane3_2", "Lane3_2Name", task3_2_1, task3_2_2); Task task3_1_2_1 = mockTask("TASK3_1_2_1"); Lane lane3_1_2 = mockLane("Lane3_1_2", "Lane3_1_2Name", task3_1_2_1); Task task3_1_1_1_1 = mockTask("task3_1_1_1_1"); Lane lane3_1_1_1 = mockLane("Lane3_1_1_1", "lane3_1_1_1Name", task3_1_1_1_1); Task task3_1_1_2_1 = mockTask("task3_1_1_2_1"); Lane lane3_1_1_2 = mockLane("Lane3_1_1_2", "lane3_1_1_2Name", task3_1_1_2_1); Lane lane3_1_1 = mockLane("Lane3_1_1", "Lane3_1_1Name", mockLaneSet("laneSet3_1_1", lane3_1_1_1, lane3_1_1_2)); Lane lane3_1 = mockLane("Lane3_1", "Lane3_1Name", mockLaneSet("laneSet3_1", lane3_1_1, lane3_1_2)); Lane lane3 = mockLane("Lane3", "Lane3Name", mockLaneSet("LaneSet3", lane3_1, lane3_2)); LaneSet laneSet2 = mockLaneSet("LaneSet2", lane3); List<FlowElement> flowElements = Arrays.asList(task0_1, task0_2, task0_3, task1_1, task2_1, task3_1_1_1_1, task3_1_1_2_1, task3_1_2_1, task3_2_1, task3_2_2); List<LaneSet> laneSets = Arrays.asList(laneSet1, laneSet2); Result<Map<String, BpmnNode>> result = converterDelegate.convertChildNodes(parentNode, flowElements, laneSets); Map<String, BpmnNode> nodes = result.value(); assertEquals(16, nodes.size()); assertEquals(9, parentNode.getChildren().size()); assertHasChildren(parentNode, task0_1.getId(), task0_2.getId(), task0_3.getId(), lane1.getId(), lane2.getId(), lane3_2.getId(), lane3_1_2.getId(), lane3_1_1_1.getId(), lane3_1_1_2.getId()); BpmnNode lane1Node = getChildById(parentNode, lane1.getId()); assertNotNull(lane1Node); assertHasChildren(lane1Node, task1_1.getId()); BpmnNode lane2Node = getChildById(parentNode, lane2.getId()); assertNotNull(lane2Node); assertHasChildren(lane2Node, task2_1.getId()); BpmnNode lane3_1_1_1Node = getChildById(parentNode, lane3_1_1_1.getId()); assertNotNull(lane3_1_1_1Node); assertHasChildren(lane3_1_1_1Node, task3_1_1_1_1.getId()); BpmnNode lane3_1_1_2Node = getChildById(parentNode, lane3_1_1_2.getId()); assertNotNull(lane3_1_1_2Node); assertHasChildren(lane3_1_1_2Node, task3_1_1_2_1.getId()); BpmnNode lane3_1_2Node = getChildById(parentNode, lane3_1_2.getId()); assertNotNull(lane3_1_2Node); assertHasChildren(lane3_1_2Node, task3_1_2_1.getId()); BpmnNode lane3_2Node = getChildById(parentNode, lane3_2.getId()); assertHasChildren(lane3_2Node); assertHasChildren(lane3_2Node, task3_2_1.getId(), task3_2_2.getId()); List<MarshallingMessage> messages = result.messages(); assertEquals(4, messages.size()); assertTrue(messages.stream() .map(MarshallingMessage::getMessageKey) .allMatch(MarshallingMessageKeys.childLaneSetConverted::equals)); }
Result<Map<String, BpmnNode>> convertChildNodes( BpmnNode firstNode, List<FlowElement> flowElements, List<LaneSet> laneSets) { for (FlowElement element : flowElements) { element.setId(revertIllegalCharsAttribute(element.getId())); element.setName(revertIllegalCharsAttribute(element.getName())); } final Result<Map<String, BpmnNode>> flowElementsResult = convertFlowElements(flowElements); final Map<String, BpmnNode> freeFloatingNodes = flowElementsResult.value(); freeFloatingNodes .values() .forEach(n -> n.setParent(firstNode)); final Result<BpmnNode>[] laneSetsResult = convertLaneSets(laneSets, freeFloatingNodes, firstNode); final Map<String, BpmnNode> lanesMap = Stream.of(laneSetsResult) .filter(Objects::nonNull).map(v -> v.value()) .collect(Collectors.toMap(n -> n.value().getUUID(), n -> n)); freeFloatingNodes.putAll(lanesMap); return ResultComposer.compose(freeFloatingNodes, flowElementsResult, ResultComposer.compose(laneSets, laneSetsResult)); }
ProcessConverterDelegate { Result<Map<String, BpmnNode>> convertChildNodes( BpmnNode firstNode, List<FlowElement> flowElements, List<LaneSet> laneSets) { for (FlowElement element : flowElements) { element.setId(revertIllegalCharsAttribute(element.getId())); element.setName(revertIllegalCharsAttribute(element.getName())); } final Result<Map<String, BpmnNode>> flowElementsResult = convertFlowElements(flowElements); final Map<String, BpmnNode> freeFloatingNodes = flowElementsResult.value(); freeFloatingNodes .values() .forEach(n -> n.setParent(firstNode)); final Result<BpmnNode>[] laneSetsResult = convertLaneSets(laneSets, freeFloatingNodes, firstNode); final Map<String, BpmnNode> lanesMap = Stream.of(laneSetsResult) .filter(Objects::nonNull).map(v -> v.value()) .collect(Collectors.toMap(n -> n.value().getUUID(), n -> n)); freeFloatingNodes.putAll(lanesMap); return ResultComposer.compose(freeFloatingNodes, flowElementsResult, ResultComposer.compose(laneSets, laneSetsResult)); } }
ProcessConverterDelegate { Result<Map<String, BpmnNode>> convertChildNodes( BpmnNode firstNode, List<FlowElement> flowElements, List<LaneSet> laneSets) { for (FlowElement element : flowElements) { element.setId(revertIllegalCharsAttribute(element.getId())); element.setName(revertIllegalCharsAttribute(element.getName())); } final Result<Map<String, BpmnNode>> flowElementsResult = convertFlowElements(flowElements); final Map<String, BpmnNode> freeFloatingNodes = flowElementsResult.value(); freeFloatingNodes .values() .forEach(n -> n.setParent(firstNode)); final Result<BpmnNode>[] laneSetsResult = convertLaneSets(laneSets, freeFloatingNodes, firstNode); final Map<String, BpmnNode> lanesMap = Stream.of(laneSetsResult) .filter(Objects::nonNull).map(v -> v.value()) .collect(Collectors.toMap(n -> n.value().getUUID(), n -> n)); freeFloatingNodes.putAll(lanesMap); return ResultComposer.compose(freeFloatingNodes, flowElementsResult, ResultComposer.compose(laneSets, laneSetsResult)); } ProcessConverterDelegate(
            TypedFactoryManager typedFactoryManager,
            PropertyReaderFactory propertyReaderFactory,
            DefinitionResolver definitionResolver,
            BaseConverterFactory factory); }
ProcessConverterDelegate { Result<Map<String, BpmnNode>> convertChildNodes( BpmnNode firstNode, List<FlowElement> flowElements, List<LaneSet> laneSets) { for (FlowElement element : flowElements) { element.setId(revertIllegalCharsAttribute(element.getId())); element.setName(revertIllegalCharsAttribute(element.getName())); } final Result<Map<String, BpmnNode>> flowElementsResult = convertFlowElements(flowElements); final Map<String, BpmnNode> freeFloatingNodes = flowElementsResult.value(); freeFloatingNodes .values() .forEach(n -> n.setParent(firstNode)); final Result<BpmnNode>[] laneSetsResult = convertLaneSets(laneSets, freeFloatingNodes, firstNode); final Map<String, BpmnNode> lanesMap = Stream.of(laneSetsResult) .filter(Objects::nonNull).map(v -> v.value()) .collect(Collectors.toMap(n -> n.value().getUUID(), n -> n)); freeFloatingNodes.putAll(lanesMap); return ResultComposer.compose(freeFloatingNodes, flowElementsResult, ResultComposer.compose(laneSets, laneSetsResult)); } ProcessConverterDelegate(
            TypedFactoryManager typedFactoryManager,
            PropertyReaderFactory propertyReaderFactory,
            DefinitionResolver definitionResolver,
            BaseConverterFactory factory);  }
ProcessConverterDelegate { Result<Map<String, BpmnNode>> convertChildNodes( BpmnNode firstNode, List<FlowElement> flowElements, List<LaneSet> laneSets) { for (FlowElement element : flowElements) { element.setId(revertIllegalCharsAttribute(element.getId())); element.setName(revertIllegalCharsAttribute(element.getName())); } final Result<Map<String, BpmnNode>> flowElementsResult = convertFlowElements(flowElements); final Map<String, BpmnNode> freeFloatingNodes = flowElementsResult.value(); freeFloatingNodes .values() .forEach(n -> n.setParent(firstNode)); final Result<BpmnNode>[] laneSetsResult = convertLaneSets(laneSets, freeFloatingNodes, firstNode); final Map<String, BpmnNode> lanesMap = Stream.of(laneSetsResult) .filter(Objects::nonNull).map(v -> v.value()) .collect(Collectors.toMap(n -> n.value().getUUID(), n -> n)); freeFloatingNodes.putAll(lanesMap); return ResultComposer.compose(freeFloatingNodes, flowElementsResult, ResultComposer.compose(laneSets, laneSetsResult)); } ProcessConverterDelegate(
            TypedFactoryManager typedFactoryManager,
            PropertyReaderFactory propertyReaderFactory,
            DefinitionResolver definitionResolver,
            BaseConverterFactory factory);   }