target stringlengths 20 113k | src_fm stringlengths 11 86.3k | src_fm_fc stringlengths 21 86.4k | src_fm_fc_co stringlengths 30 86.4k | src_fm_fc_ms stringlengths 42 86.8k | src_fm_fc_ms_ff stringlengths 43 86.8k |
|---|---|---|---|---|---|
@Test public void testSetSlaDueDate() { String slaDueDate = "12/25/1983"; tested.setSlaDueDate(new SLADueDate(slaDueDate)); assertTrue(CustomElement.slaDueDate.of(tested.getFlowElement()).get().contains(slaDueDate)); } | public void setSlaDueDate(SLADueDate slaDueDate) { CustomElement.slaDueDate.of(flowElement).set(slaDueDate.getValue()); } | CallActivityPropertyWriter extends MultipleInstanceActivityPropertyWriter { public void setSlaDueDate(SLADueDate slaDueDate) { CustomElement.slaDueDate.of(flowElement).set(slaDueDate.getValue()); } } | CallActivityPropertyWriter extends MultipleInstanceActivityPropertyWriter { public void setSlaDueDate(SLADueDate slaDueDate) { CustomElement.slaDueDate.of(flowElement).set(slaDueDate.getValue()); } CallActivityPropertyWriter(CallActivity activity, VariableScope variableScope, Set<DataObject> dataObjects); } | CallActivityPropertyWriter extends MultipleInstanceActivityPropertyWriter { public void setSlaDueDate(SLADueDate slaDueDate) { CustomElement.slaDueDate.of(flowElement).set(slaDueDate.getValue()); } CallActivityPropertyWriter(CallActivity activity, VariableScope variableScope, Set<DataObject> dataObjects); void setOnEntryAction(OnEntryAction onEntryAction); void setOnExitAction(OnExitAction onExitAction); void setIndependent(Boolean independent); void setAbortParent(Boolean abortParent); void setWaitForCompletion(Boolean waitForCompletion); void setAsync(Boolean async); void setCalledElement(String value); void setCase(Boolean isCase); void setAdHocAutostart(boolean autoStart); void setSlaDueDate(SLADueDate slaDueDate); } | CallActivityPropertyWriter extends MultipleInstanceActivityPropertyWriter { public void setSlaDueDate(SLADueDate slaDueDate) { CustomElement.slaDueDate.of(flowElement).set(slaDueDate.getValue()); } CallActivityPropertyWriter(CallActivity activity, VariableScope variableScope, Set<DataObject> dataObjects); void setOnEntryAction(OnEntryAction onEntryAction); void setOnExitAction(OnExitAction onExitAction); void setIndependent(Boolean independent); void setAbortParent(Boolean abortParent); void setWaitForCompletion(Boolean waitForCompletion); void setAsync(Boolean async); void setCalledElement(String value); void setCase(Boolean isCase); void setAdHocAutostart(boolean autoStart); void setSlaDueDate(SLADueDate slaDueDate); } |
@Test public void testCreateBPMNEdge() { BPMNShape sourceShape = mockShape(SOURCE_SHAPE_ID, 1, 1, 4, 4); BPMNShape targetShape = mockShape(TARGET_SHAPE_ID, 10, 10, 4, 4); when(sourceWriter.getShape()).thenReturn(sourceShape); when(targetWriter.getShape()).thenReturn(targetShape); Connection sourceConnection = mockConnection(1, 1); Connection targetConnection = mockConnection(10, 10); ControlPoint[] controlPoints = new ControlPoint[]{ new ControlPoint(Point2D.create(3, 3)), new ControlPoint(Point2D.create(4, 4)), new ControlPoint(Point2D.create(5, 5)) }; BPMNEdge edge = PropertyWriterUtils.createBPMNEdge(sourceWriter, targetWriter, sourceConnection, controlPoints, targetConnection); assertEquals("edge_SOURCE_SHAPE_ID_to_TARGET_SHAPE_ID", edge.getId()); assertWaypoint(2, 2, 0, edge.getWaypoint()); assertWaypoint(3, 3, 1, edge.getWaypoint()); assertWaypoint(4, 4, 2, edge.getWaypoint()); assertWaypoint(5, 5, 3, edge.getWaypoint()); assertWaypoint(20, 20, 4, edge.getWaypoint()); } | public static BPMNEdge createBPMNEdge(BasePropertyWriter source, BasePropertyWriter target, Connection sourceConnection, ControlPoint[] mid, Connection targetConnection) { BPMNEdge bpmnEdge = di.createBPMNEdge(); bpmnEdge.setId(Ids.bpmnEdge(source.getShape().getId(), target.getShape().getId())); Point2D sourcePt = getSourceLocation(source, sourceConnection); Point2D targetPt = getTargetLocation(target, targetConnection); org.eclipse.dd.dc.Point sourcePoint = pointOf( source.getShape().getBounds().getX() + sourcePt.getX(), source.getShape().getBounds().getY() + sourcePt.getY()); org.eclipse.dd.dc.Point targetPoint = pointOf( target.getShape().getBounds().getX() + targetPt.getX(), target.getShape().getBounds().getY() + targetPt.getY()); List<Point> waypoints = bpmnEdge.getWaypoint(); waypoints.add(sourcePoint); if (null != mid) { for (ControlPoint controlPoint : mid) { waypoints.add(pointOf(controlPoint.getLocation().getX(), controlPoint.getLocation().getY())); } } waypoints.add(targetPoint); return bpmnEdge; } | PropertyWriterUtils { public static BPMNEdge createBPMNEdge(BasePropertyWriter source, BasePropertyWriter target, Connection sourceConnection, ControlPoint[] mid, Connection targetConnection) { BPMNEdge bpmnEdge = di.createBPMNEdge(); bpmnEdge.setId(Ids.bpmnEdge(source.getShape().getId(), target.getShape().getId())); Point2D sourcePt = getSourceLocation(source, sourceConnection); Point2D targetPt = getTargetLocation(target, targetConnection); org.eclipse.dd.dc.Point sourcePoint = pointOf( source.getShape().getBounds().getX() + sourcePt.getX(), source.getShape().getBounds().getY() + sourcePt.getY()); org.eclipse.dd.dc.Point targetPoint = pointOf( target.getShape().getBounds().getX() + targetPt.getX(), target.getShape().getBounds().getY() + targetPt.getY()); List<Point> waypoints = bpmnEdge.getWaypoint(); waypoints.add(sourcePoint); if (null != mid) { for (ControlPoint controlPoint : mid) { waypoints.add(pointOf(controlPoint.getLocation().getX(), controlPoint.getLocation().getY())); } } waypoints.add(targetPoint); return bpmnEdge; } } | PropertyWriterUtils { public static BPMNEdge createBPMNEdge(BasePropertyWriter source, BasePropertyWriter target, Connection sourceConnection, ControlPoint[] mid, Connection targetConnection) { BPMNEdge bpmnEdge = di.createBPMNEdge(); bpmnEdge.setId(Ids.bpmnEdge(source.getShape().getId(), target.getShape().getId())); Point2D sourcePt = getSourceLocation(source, sourceConnection); Point2D targetPt = getTargetLocation(target, targetConnection); org.eclipse.dd.dc.Point sourcePoint = pointOf( source.getShape().getBounds().getX() + sourcePt.getX(), source.getShape().getBounds().getY() + sourcePt.getY()); org.eclipse.dd.dc.Point targetPoint = pointOf( target.getShape().getBounds().getX() + targetPt.getX(), target.getShape().getBounds().getY() + targetPt.getY()); List<Point> waypoints = bpmnEdge.getWaypoint(); waypoints.add(sourcePoint); if (null != mid) { for (ControlPoint controlPoint : mid) { waypoints.add(pointOf(controlPoint.getLocation().getX(), controlPoint.getLocation().getY())); } } waypoints.add(targetPoint); return bpmnEdge; } } | PropertyWriterUtils { public static BPMNEdge createBPMNEdge(BasePropertyWriter source, BasePropertyWriter target, Connection sourceConnection, ControlPoint[] mid, Connection targetConnection) { BPMNEdge bpmnEdge = di.createBPMNEdge(); bpmnEdge.setId(Ids.bpmnEdge(source.getShape().getId(), target.getShape().getId())); Point2D sourcePt = getSourceLocation(source, sourceConnection); Point2D targetPt = getTargetLocation(target, targetConnection); org.eclipse.dd.dc.Point sourcePoint = pointOf( source.getShape().getBounds().getX() + sourcePt.getX(), source.getShape().getBounds().getY() + sourcePt.getY()); org.eclipse.dd.dc.Point targetPoint = pointOf( target.getShape().getBounds().getX() + targetPt.getX(), target.getShape().getBounds().getY() + targetPt.getY()); List<Point> waypoints = bpmnEdge.getWaypoint(); waypoints.add(sourcePoint); if (null != mid) { for (ControlPoint controlPoint : mid) { waypoints.add(pointOf(controlPoint.getLocation().getX(), controlPoint.getLocation().getY())); } } waypoints.add(targetPoint); return bpmnEdge; } static BPMNEdge createBPMNEdge(BasePropertyWriter source,
BasePropertyWriter target,
Connection sourceConnection,
ControlPoint[] mid,
Connection targetConnection); @SuppressWarnings("unchecked") static Optional<Node<View, Edge>> getDockSourceNode(final Node<? extends View, ?> node); static Import toImport(WSDLImport wsdlImport); } | PropertyWriterUtils { public static BPMNEdge createBPMNEdge(BasePropertyWriter source, BasePropertyWriter target, Connection sourceConnection, ControlPoint[] mid, Connection targetConnection) { BPMNEdge bpmnEdge = di.createBPMNEdge(); bpmnEdge.setId(Ids.bpmnEdge(source.getShape().getId(), target.getShape().getId())); Point2D sourcePt = getSourceLocation(source, sourceConnection); Point2D targetPt = getTargetLocation(target, targetConnection); org.eclipse.dd.dc.Point sourcePoint = pointOf( source.getShape().getBounds().getX() + sourcePt.getX(), source.getShape().getBounds().getY() + sourcePt.getY()); org.eclipse.dd.dc.Point targetPoint = pointOf( target.getShape().getBounds().getX() + targetPt.getX(), target.getShape().getBounds().getY() + targetPt.getY()); List<Point> waypoints = bpmnEdge.getWaypoint(); waypoints.add(sourcePoint); if (null != mid) { for (ControlPoint controlPoint : mid) { waypoints.add(pointOf(controlPoint.getLocation().getX(), controlPoint.getLocation().getY())); } } waypoints.add(targetPoint); return bpmnEdge; } static BPMNEdge createBPMNEdge(BasePropertyWriter source,
BasePropertyWriter target,
Connection sourceConnection,
ControlPoint[] mid,
Connection targetConnection); @SuppressWarnings("unchecked") static Optional<Node<View, Edge>> getDockSourceNode(final Node<? extends View, ?> node); static Import toImport(WSDLImport wsdlImport); } |
@Test public void testGetDockSourceNodeWhenDocked() { Node<? extends View, Edge> dockSourceNode = mock(Node.class); Node<? extends View, Edge> node = mockDockedNode(dockSourceNode); Optional<Node<View, Edge>> result = PropertyWriterUtils.getDockSourceNode(node); assertTrue(result.isPresent()); assertEquals(dockSourceNode, result.get()); } | @SuppressWarnings("unchecked") public static Optional<Node<View, Edge>> getDockSourceNode(final Node<? extends View, ?> node) { return node.getInEdges().stream() .filter(PropertyWriterUtils::isDockEdge) .map(Edge::getSourceNode) .map(n -> (Node<View, Edge>) n) .findFirst(); } | PropertyWriterUtils { @SuppressWarnings("unchecked") public static Optional<Node<View, Edge>> getDockSourceNode(final Node<? extends View, ?> node) { return node.getInEdges().stream() .filter(PropertyWriterUtils::isDockEdge) .map(Edge::getSourceNode) .map(n -> (Node<View, Edge>) n) .findFirst(); } } | PropertyWriterUtils { @SuppressWarnings("unchecked") public static Optional<Node<View, Edge>> getDockSourceNode(final Node<? extends View, ?> node) { return node.getInEdges().stream() .filter(PropertyWriterUtils::isDockEdge) .map(Edge::getSourceNode) .map(n -> (Node<View, Edge>) n) .findFirst(); } } | PropertyWriterUtils { @SuppressWarnings("unchecked") public static Optional<Node<View, Edge>> getDockSourceNode(final Node<? extends View, ?> node) { return node.getInEdges().stream() .filter(PropertyWriterUtils::isDockEdge) .map(Edge::getSourceNode) .map(n -> (Node<View, Edge>) n) .findFirst(); } static BPMNEdge createBPMNEdge(BasePropertyWriter source,
BasePropertyWriter target,
Connection sourceConnection,
ControlPoint[] mid,
Connection targetConnection); @SuppressWarnings("unchecked") static Optional<Node<View, Edge>> getDockSourceNode(final Node<? extends View, ?> node); static Import toImport(WSDLImport wsdlImport); } | PropertyWriterUtils { @SuppressWarnings("unchecked") public static Optional<Node<View, Edge>> getDockSourceNode(final Node<? extends View, ?> node) { return node.getInEdges().stream() .filter(PropertyWriterUtils::isDockEdge) .map(Edge::getSourceNode) .map(n -> (Node<View, Edge>) n) .findFirst(); } static BPMNEdge createBPMNEdge(BasePropertyWriter source,
BasePropertyWriter target,
Connection sourceConnection,
ControlPoint[] mid,
Connection targetConnection); @SuppressWarnings("unchecked") static Optional<Node<View, Edge>> getDockSourceNode(final Node<? extends View, ?> node); static Import toImport(WSDLImport wsdlImport); } |
@Test public void testGetDockSourceNodeWhenNotDocked() { Node<? extends View, Edge> node = mock(Node.class); List<Edge> edges = new ArrayList<>(); when(node.getInEdges()).thenReturn(edges); Optional<Node<View, Edge>> result = PropertyWriterUtils.getDockSourceNode(node); assertFalse(result.isPresent()); } | @SuppressWarnings("unchecked") public static Optional<Node<View, Edge>> getDockSourceNode(final Node<? extends View, ?> node) { return node.getInEdges().stream() .filter(PropertyWriterUtils::isDockEdge) .map(Edge::getSourceNode) .map(n -> (Node<View, Edge>) n) .findFirst(); } | PropertyWriterUtils { @SuppressWarnings("unchecked") public static Optional<Node<View, Edge>> getDockSourceNode(final Node<? extends View, ?> node) { return node.getInEdges().stream() .filter(PropertyWriterUtils::isDockEdge) .map(Edge::getSourceNode) .map(n -> (Node<View, Edge>) n) .findFirst(); } } | PropertyWriterUtils { @SuppressWarnings("unchecked") public static Optional<Node<View, Edge>> getDockSourceNode(final Node<? extends View, ?> node) { return node.getInEdges().stream() .filter(PropertyWriterUtils::isDockEdge) .map(Edge::getSourceNode) .map(n -> (Node<View, Edge>) n) .findFirst(); } } | PropertyWriterUtils { @SuppressWarnings("unchecked") public static Optional<Node<View, Edge>> getDockSourceNode(final Node<? extends View, ?> node) { return node.getInEdges().stream() .filter(PropertyWriterUtils::isDockEdge) .map(Edge::getSourceNode) .map(n -> (Node<View, Edge>) n) .findFirst(); } static BPMNEdge createBPMNEdge(BasePropertyWriter source,
BasePropertyWriter target,
Connection sourceConnection,
ControlPoint[] mid,
Connection targetConnection); @SuppressWarnings("unchecked") static Optional<Node<View, Edge>> getDockSourceNode(final Node<? extends View, ?> node); static Import toImport(WSDLImport wsdlImport); } | PropertyWriterUtils { @SuppressWarnings("unchecked") public static Optional<Node<View, Edge>> getDockSourceNode(final Node<? extends View, ?> node) { return node.getInEdges().stream() .filter(PropertyWriterUtils::isDockEdge) .map(Edge::getSourceNode) .map(n -> (Node<View, Edge>) n) .findFirst(); } static BPMNEdge createBPMNEdge(BasePropertyWriter source,
BasePropertyWriter target,
Connection sourceConnection,
ControlPoint[] mid,
Connection targetConnection); @SuppressWarnings("unchecked") static Optional<Node<View, Edge>> getDockSourceNode(final Node<? extends View, ?> node); static Import toImport(WSDLImport wsdlImport); } |
@Test public void toImport() { final String LOCATION = "location"; final String NAMESPACE = "namespace"; WSDLImport wsdlImport = new WSDLImport(LOCATION, NAMESPACE); Import imp = PropertyWriterUtils.toImport(wsdlImport); assertEquals(LOCATION, imp.getLocation()); assertEquals(NAMESPACE, imp.getNamespace()); } | public static Import toImport(WSDLImport wsdlImport) { Import imp = Bpmn2Factory.eINSTANCE.createImport(); imp.setImportType("http: imp.setLocation(wsdlImport.getLocation()); imp.setNamespace(wsdlImport.getNamespace()); return imp; } | PropertyWriterUtils { public static Import toImport(WSDLImport wsdlImport) { Import imp = Bpmn2Factory.eINSTANCE.createImport(); imp.setImportType("http: imp.setLocation(wsdlImport.getLocation()); imp.setNamespace(wsdlImport.getNamespace()); return imp; } } | PropertyWriterUtils { public static Import toImport(WSDLImport wsdlImport) { Import imp = Bpmn2Factory.eINSTANCE.createImport(); imp.setImportType("http: imp.setLocation(wsdlImport.getLocation()); imp.setNamespace(wsdlImport.getNamespace()); return imp; } } | PropertyWriterUtils { public static Import toImport(WSDLImport wsdlImport) { Import imp = Bpmn2Factory.eINSTANCE.createImport(); imp.setImportType("http: imp.setLocation(wsdlImport.getLocation()); imp.setNamespace(wsdlImport.getNamespace()); return imp; } static BPMNEdge createBPMNEdge(BasePropertyWriter source,
BasePropertyWriter target,
Connection sourceConnection,
ControlPoint[] mid,
Connection targetConnection); @SuppressWarnings("unchecked") static Optional<Node<View, Edge>> getDockSourceNode(final Node<? extends View, ?> node); static Import toImport(WSDLImport wsdlImport); } | PropertyWriterUtils { public static Import toImport(WSDLImport wsdlImport) { Import imp = Bpmn2Factory.eINSTANCE.createImport(); imp.setImportType("http: imp.setLocation(wsdlImport.getLocation()); imp.setNamespace(wsdlImport.getNamespace()); return imp; } static BPMNEdge createBPMNEdge(BasePropertyWriter source,
BasePropertyWriter target,
Connection sourceConnection,
ControlPoint[] mid,
Connection targetConnection); @SuppressWarnings("unchecked") static Optional<Node<View, Edge>> getDockSourceNode(final Node<? extends View, ?> node); static Import toImport(WSDLImport wsdlImport); } |
@Test public void testSetCollectionInput() { writer.setCollectionInput(PROPERTY_ID); assertInputsInitialized(); String inputId = ACTIVITY_ID + "_" + IN_COLLECTION + "InputX"; assertHasDataInput(activity.getIoSpecification(), inputId, ITEM_ID, IN_COLLECTION); assertHasDataInputAssociation(activity, PROPERTY_ID, inputId); assertEquals(inputId, ((MultiInstanceLoopCharacteristics) activity.getLoopCharacteristics()).getLoopDataInputRef().getId()); when(variableScope.lookup(PROPERTY_ID)).thenReturn(Optional.empty()); Set<DataObject> dataObjects = new HashSet<>(); DataObject dataObject = mockDataObject(PROPERTY_ID); dataObjects.add(dataObject); writer = new MultipleInstanceActivityPropertyWriter(activity, variableScope, dataObjects); writer.setCollectionInput(PROPERTY_ID); assertInputsInitialized(); inputId = ACTIVITY_ID + "_" + IN_COLLECTION + "InputX"; assertHasDataInput(activity.getIoSpecification(), inputId, ITEM_ID, IN_COLLECTION); assertHasDataInputAssociation(activity, PROPERTY_ID, inputId); when(variableScope.lookup(PROPERTY_ID)).thenReturn(Optional.empty()); dataObjects.clear(); dataObject = mockDataObject("SomeOtherId"); dataObjects.add(dataObject); writer = new MultipleInstanceActivityPropertyWriter(activity, variableScope, dataObjects); writer.setCollectionInput(PROPERTY_ID); assertInputsInitialized(); inputId = ACTIVITY_ID + "_" + IN_COLLECTION + "InputX"; assertHasDataInput(activity.getIoSpecification(), inputId, ITEM_ID, IN_COLLECTION); assertHasDataInputAssociation(activity, PROPERTY_ID, inputId); } | public void setCollectionInput(String collectionInput) { if (isEmpty(collectionInput)) { return; } setUpLoopCharacteristics(); String suffix = "IN_COLLECTION"; String id = Ids.dataInput(activity.getId(), suffix); DataInput dataInputElement = createDataInput(id, suffix); ioSpec.getDataInputs().add(dataInputElement); Optional<Property> property = findPropertyById(collectionInput); Optional<DataObject> dataObject = findDataObjectById(collectionInput); if (property.isPresent()) { processDataInput(dataInputElement, property.get()); } else if (dataObject.isPresent()) { processDataInput(dataInputElement, dataObject.get()); } } | MultipleInstanceActivityPropertyWriter extends ActivityPropertyWriter { public void setCollectionInput(String collectionInput) { if (isEmpty(collectionInput)) { return; } setUpLoopCharacteristics(); String suffix = "IN_COLLECTION"; String id = Ids.dataInput(activity.getId(), suffix); DataInput dataInputElement = createDataInput(id, suffix); ioSpec.getDataInputs().add(dataInputElement); Optional<Property> property = findPropertyById(collectionInput); Optional<DataObject> dataObject = findDataObjectById(collectionInput); if (property.isPresent()) { processDataInput(dataInputElement, property.get()); } else if (dataObject.isPresent()) { processDataInput(dataInputElement, dataObject.get()); } } } | MultipleInstanceActivityPropertyWriter extends ActivityPropertyWriter { public void setCollectionInput(String collectionInput) { if (isEmpty(collectionInput)) { return; } setUpLoopCharacteristics(); String suffix = "IN_COLLECTION"; String id = Ids.dataInput(activity.getId(), suffix); DataInput dataInputElement = createDataInput(id, suffix); ioSpec.getDataInputs().add(dataInputElement); Optional<Property> property = findPropertyById(collectionInput); Optional<DataObject> dataObject = findDataObjectById(collectionInput); if (property.isPresent()) { processDataInput(dataInputElement, property.get()); } else if (dataObject.isPresent()) { processDataInput(dataInputElement, dataObject.get()); } } MultipleInstanceActivityPropertyWriter(Activity activity,
VariableScope variableScope,
Set<DataObject> dataObjects); } | MultipleInstanceActivityPropertyWriter extends ActivityPropertyWriter { public void setCollectionInput(String collectionInput) { if (isEmpty(collectionInput)) { return; } setUpLoopCharacteristics(); String suffix = "IN_COLLECTION"; String id = Ids.dataInput(activity.getId(), suffix); DataInput dataInputElement = createDataInput(id, suffix); ioSpec.getDataInputs().add(dataInputElement); Optional<Property> property = findPropertyById(collectionInput); Optional<DataObject> dataObject = findDataObjectById(collectionInput); if (property.isPresent()) { processDataInput(dataInputElement, property.get()); } else if (dataObject.isPresent()) { processDataInput(dataInputElement, dataObject.get()); } } MultipleInstanceActivityPropertyWriter(Activity activity,
VariableScope variableScope,
Set<DataObject> dataObjects); void setCollectionInput(String collectionInput); void setCollectionOutput(String collectionOutput); void setInput(String name); void setOutput(String name); void setOutput(String name, boolean addDataOutputAssociation); void setCompletionCondition(String expression); void setIsSequential(boolean sequential); } | MultipleInstanceActivityPropertyWriter extends ActivityPropertyWriter { public void setCollectionInput(String collectionInput) { if (isEmpty(collectionInput)) { return; } setUpLoopCharacteristics(); String suffix = "IN_COLLECTION"; String id = Ids.dataInput(activity.getId(), suffix); DataInput dataInputElement = createDataInput(id, suffix); ioSpec.getDataInputs().add(dataInputElement); Optional<Property> property = findPropertyById(collectionInput); Optional<DataObject> dataObject = findDataObjectById(collectionInput); if (property.isPresent()) { processDataInput(dataInputElement, property.get()); } else if (dataObject.isPresent()) { processDataInput(dataInputElement, dataObject.get()); } } MultipleInstanceActivityPropertyWriter(Activity activity,
VariableScope variableScope,
Set<DataObject> dataObjects); void setCollectionInput(String collectionInput); void setCollectionOutput(String collectionOutput); void setInput(String name); void setOutput(String name); void setOutput(String name, boolean addDataOutputAssociation); void setCompletionCondition(String expression); void setIsSequential(boolean sequential); } |
@Test public void testCreateItemDefinitionNoType() { ItemDefinition definition = writer.createItemDefinition("variableOne", ""); assertEquals("Must Be Object Type", Object.class.getName(), definition.getStructureRef()); definition = writer.createItemDefinition("variableTwo", "java.lang.String"); assertEquals("Must Be String Type", String.class.getName(), definition.getStructureRef()); } | protected ItemDefinition createItemDefinition(String name, String type) { ItemDefinition item = bpmn2.createItemDefinition(); item.setId(Ids.multiInstanceItemType(activity.getId(), name)); String varType = type.isEmpty() ? Object.class.getName() : type; item.setStructureRef(varType); return item; } | MultipleInstanceActivityPropertyWriter extends ActivityPropertyWriter { protected ItemDefinition createItemDefinition(String name, String type) { ItemDefinition item = bpmn2.createItemDefinition(); item.setId(Ids.multiInstanceItemType(activity.getId(), name)); String varType = type.isEmpty() ? Object.class.getName() : type; item.setStructureRef(varType); return item; } } | MultipleInstanceActivityPropertyWriter extends ActivityPropertyWriter { protected ItemDefinition createItemDefinition(String name, String type) { ItemDefinition item = bpmn2.createItemDefinition(); item.setId(Ids.multiInstanceItemType(activity.getId(), name)); String varType = type.isEmpty() ? Object.class.getName() : type; item.setStructureRef(varType); return item; } MultipleInstanceActivityPropertyWriter(Activity activity,
VariableScope variableScope,
Set<DataObject> dataObjects); } | MultipleInstanceActivityPropertyWriter extends ActivityPropertyWriter { protected ItemDefinition createItemDefinition(String name, String type) { ItemDefinition item = bpmn2.createItemDefinition(); item.setId(Ids.multiInstanceItemType(activity.getId(), name)); String varType = type.isEmpty() ? Object.class.getName() : type; item.setStructureRef(varType); return item; } MultipleInstanceActivityPropertyWriter(Activity activity,
VariableScope variableScope,
Set<DataObject> dataObjects); void setCollectionInput(String collectionInput); void setCollectionOutput(String collectionOutput); void setInput(String name); void setOutput(String name); void setOutput(String name, boolean addDataOutputAssociation); void setCompletionCondition(String expression); void setIsSequential(boolean sequential); } | MultipleInstanceActivityPropertyWriter extends ActivityPropertyWriter { protected ItemDefinition createItemDefinition(String name, String type) { ItemDefinition item = bpmn2.createItemDefinition(); item.setId(Ids.multiInstanceItemType(activity.getId(), name)); String varType = type.isEmpty() ? Object.class.getName() : type; item.setStructureRef(varType); return item; } MultipleInstanceActivityPropertyWriter(Activity activity,
VariableScope variableScope,
Set<DataObject> dataObjects); void setCollectionInput(String collectionInput); void setCollectionOutput(String collectionOutput); void setInput(String name); void setOutput(String name); void setOutput(String name, boolean addDataOutputAssociation); void setCompletionCondition(String expression); void setIsSequential(boolean sequential); } |
@Test public void testSetInputNotFailed() { writer.setInput(null, false); writer.setInput("", false); assertNull(activity.getIoSpecification()); assertTrue(activity.getDataInputAssociations().isEmpty()); assertNull(activity.getLoopCharacteristics()); } | public void setInput(String name) { setInput(name, true); } | MultipleInstanceActivityPropertyWriter extends ActivityPropertyWriter { public void setInput(String name) { setInput(name, true); } } | MultipleInstanceActivityPropertyWriter extends ActivityPropertyWriter { public void setInput(String name) { setInput(name, true); } MultipleInstanceActivityPropertyWriter(Activity activity,
VariableScope variableScope,
Set<DataObject> dataObjects); } | MultipleInstanceActivityPropertyWriter extends ActivityPropertyWriter { public void setInput(String name) { setInput(name, true); } MultipleInstanceActivityPropertyWriter(Activity activity,
VariableScope variableScope,
Set<DataObject> dataObjects); void setCollectionInput(String collectionInput); void setCollectionOutput(String collectionOutput); void setInput(String name); void setOutput(String name); void setOutput(String name, boolean addDataOutputAssociation); void setCompletionCondition(String expression); void setIsSequential(boolean sequential); } | MultipleInstanceActivityPropertyWriter extends ActivityPropertyWriter { public void setInput(String name) { setInput(name, true); } MultipleInstanceActivityPropertyWriter(Activity activity,
VariableScope variableScope,
Set<DataObject> dataObjects); void setCollectionInput(String collectionInput); void setCollectionOutput(String collectionOutput); void setInput(String name); void setOutput(String name); void setOutput(String name, boolean addDataOutputAssociation); void setCompletionCondition(String expression); void setIsSequential(boolean sequential); } |
@Test public void testSetEmptyVariable() { final String emptyName = ""; writer.setInput(":", false); assertInputsInitialized(); String inputId = ACTIVITY_ID + "_" + "InputX"; String itemSubjectRef = ACTIVITY_ID + "_multiInstanceItemType_"; assertHasDataInput(activity.getIoSpecification(), inputId, itemSubjectRef, emptyName); assertDontHasDataInputAssociation(activity, INPUT_VARIABLE_ID, inputId); } | public void setInput(String name) { setInput(name, true); } | MultipleInstanceActivityPropertyWriter extends ActivityPropertyWriter { public void setInput(String name) { setInput(name, true); } } | MultipleInstanceActivityPropertyWriter extends ActivityPropertyWriter { public void setInput(String name) { setInput(name, true); } MultipleInstanceActivityPropertyWriter(Activity activity,
VariableScope variableScope,
Set<DataObject> dataObjects); } | MultipleInstanceActivityPropertyWriter extends ActivityPropertyWriter { public void setInput(String name) { setInput(name, true); } MultipleInstanceActivityPropertyWriter(Activity activity,
VariableScope variableScope,
Set<DataObject> dataObjects); void setCollectionInput(String collectionInput); void setCollectionOutput(String collectionOutput); void setInput(String name); void setOutput(String name); void setOutput(String name, boolean addDataOutputAssociation); void setCompletionCondition(String expression); void setIsSequential(boolean sequential); } | MultipleInstanceActivityPropertyWriter extends ActivityPropertyWriter { public void setInput(String name) { setInput(name, true); } MultipleInstanceActivityPropertyWriter(Activity activity,
VariableScope variableScope,
Set<DataObject> dataObjects); void setCollectionInput(String collectionInput); void setCollectionOutput(String collectionOutput); void setInput(String name); void setOutput(String name); void setOutput(String name, boolean addDataOutputAssociation); void setCompletionCondition(String expression); void setIsSequential(boolean sequential); } |
@Test public void testSetCollectionOutput() { writer.setCollectionOutput(PROPERTY_ID); assertOutputsInitialized(); String outputId = ACTIVITY_ID + "_" + OUT_COLLECTION + "OutputX"; assertHasDataOutput(activity.getIoSpecification(), outputId, ITEM_ID, OUT_COLLECTION); assertHasDataOutputAssociation(activity, outputId, PROPERTY_ID); assertEquals(outputId, ((MultiInstanceLoopCharacteristics) activity.getLoopCharacteristics()).getLoopDataOutputRef().getId()); when(variableScope.lookup(PROPERTY_ID)).thenReturn(Optional.empty()); Set<DataObject> dataObjects = new HashSet<>(); DataObject dataObject = mockDataObject(PROPERTY_ID); dataObjects.add(dataObject); writer = new MultipleInstanceActivityPropertyWriter(activity, variableScope, dataObjects); writer.setCollectionOutput(PROPERTY_ID); assertOutputsInitialized(); outputId = ACTIVITY_ID + "_" + OUT_COLLECTION + "OutputX"; assertHasDataOutputAssociation(activity, outputId, PROPERTY_ID); when(variableScope.lookup(PROPERTY_ID)).thenReturn(Optional.empty()); dataObject = mockDataObject(PROPERTY_ID); dataObjects.add(dataObject); writer = new MultipleInstanceActivityPropertyWriter(activity, variableScope, dataObjects); writer.setCollectionOutput(PROPERTY_ID); assertOutputsInitialized(); outputId = ACTIVITY_ID + "_" + OUT_COLLECTION + "OutputX"; assertHasDataOutputAssociation(activity, outputId, PROPERTY_ID); when(variableScope.lookup(PROPERTY_ID)).thenReturn(Optional.empty()); dataObjects.clear(); dataObject = mockDataObject("SomeOtherId"); dataObjects.add(dataObject); writer = new MultipleInstanceActivityPropertyWriter(activity, variableScope, dataObjects); writer.setCollectionOutput(PROPERTY_ID); assertOutputsInitialized(); outputId = ACTIVITY_ID + "_" + OUT_COLLECTION + "OutputX"; assertHasDataOutputAssociation(activity, outputId, PROPERTY_ID); } | public void setCollectionOutput(String collectionOutput) { if (isEmpty(collectionOutput)) { return; } setUpLoopCharacteristics(); String suffix = "OUT_COLLECTION"; String id = Ids.dataOutput(activity.getId(), suffix); DataOutput dataOutputElement = createDataOutput(id, suffix); addSafe(ioSpec.getDataOutputs(), dataOutputElement); Optional<Property> property = findPropertyById(collectionOutput); Optional<DataObject> dataObject = findDataObjectById(collectionOutput); if (property.isPresent()) { processDataOutput(dataOutputElement, property.get()); } else if (dataObject.isPresent()) { processDataOutput(dataOutputElement, dataObject.get()); } } | MultipleInstanceActivityPropertyWriter extends ActivityPropertyWriter { public void setCollectionOutput(String collectionOutput) { if (isEmpty(collectionOutput)) { return; } setUpLoopCharacteristics(); String suffix = "OUT_COLLECTION"; String id = Ids.dataOutput(activity.getId(), suffix); DataOutput dataOutputElement = createDataOutput(id, suffix); addSafe(ioSpec.getDataOutputs(), dataOutputElement); Optional<Property> property = findPropertyById(collectionOutput); Optional<DataObject> dataObject = findDataObjectById(collectionOutput); if (property.isPresent()) { processDataOutput(dataOutputElement, property.get()); } else if (dataObject.isPresent()) { processDataOutput(dataOutputElement, dataObject.get()); } } } | MultipleInstanceActivityPropertyWriter extends ActivityPropertyWriter { public void setCollectionOutput(String collectionOutput) { if (isEmpty(collectionOutput)) { return; } setUpLoopCharacteristics(); String suffix = "OUT_COLLECTION"; String id = Ids.dataOutput(activity.getId(), suffix); DataOutput dataOutputElement = createDataOutput(id, suffix); addSafe(ioSpec.getDataOutputs(), dataOutputElement); Optional<Property> property = findPropertyById(collectionOutput); Optional<DataObject> dataObject = findDataObjectById(collectionOutput); if (property.isPresent()) { processDataOutput(dataOutputElement, property.get()); } else if (dataObject.isPresent()) { processDataOutput(dataOutputElement, dataObject.get()); } } MultipleInstanceActivityPropertyWriter(Activity activity,
VariableScope variableScope,
Set<DataObject> dataObjects); } | MultipleInstanceActivityPropertyWriter extends ActivityPropertyWriter { public void setCollectionOutput(String collectionOutput) { if (isEmpty(collectionOutput)) { return; } setUpLoopCharacteristics(); String suffix = "OUT_COLLECTION"; String id = Ids.dataOutput(activity.getId(), suffix); DataOutput dataOutputElement = createDataOutput(id, suffix); addSafe(ioSpec.getDataOutputs(), dataOutputElement); Optional<Property> property = findPropertyById(collectionOutput); Optional<DataObject> dataObject = findDataObjectById(collectionOutput); if (property.isPresent()) { processDataOutput(dataOutputElement, property.get()); } else if (dataObject.isPresent()) { processDataOutput(dataOutputElement, dataObject.get()); } } MultipleInstanceActivityPropertyWriter(Activity activity,
VariableScope variableScope,
Set<DataObject> dataObjects); void setCollectionInput(String collectionInput); void setCollectionOutput(String collectionOutput); void setInput(String name); void setOutput(String name); void setOutput(String name, boolean addDataOutputAssociation); void setCompletionCondition(String expression); void setIsSequential(boolean sequential); } | MultipleInstanceActivityPropertyWriter extends ActivityPropertyWriter { public void setCollectionOutput(String collectionOutput) { if (isEmpty(collectionOutput)) { return; } setUpLoopCharacteristics(); String suffix = "OUT_COLLECTION"; String id = Ids.dataOutput(activity.getId(), suffix); DataOutput dataOutputElement = createDataOutput(id, suffix); addSafe(ioSpec.getDataOutputs(), dataOutputElement); Optional<Property> property = findPropertyById(collectionOutput); Optional<DataObject> dataObject = findDataObjectById(collectionOutput); if (property.isPresent()) { processDataOutput(dataOutputElement, property.get()); } else if (dataObject.isPresent()) { processDataOutput(dataOutputElement, dataObject.get()); } } MultipleInstanceActivityPropertyWriter(Activity activity,
VariableScope variableScope,
Set<DataObject> dataObjects); void setCollectionInput(String collectionInput); void setCollectionOutput(String collectionOutput); void setInput(String name); void setOutput(String name); void setOutput(String name, boolean addDataOutputAssociation); void setCompletionCondition(String expression); void setIsSequential(boolean sequential); } |
@Test public void testOnTermFilterChange() { final KeyUpEvent event = mock(KeyUpEvent.class); final String term = "term"; termFilter.value = term; view.onTermFilterChange(event); verify(presenter).applyTermFilter(term); } | @EventHandler("term-filter") public void onTermFilterChange(final KeyUpEvent e) { presenter.applyTermFilter(termFilter.value); } | DecisionComponentsView implements DecisionComponents.View { @EventHandler("term-filter") public void onTermFilterChange(final KeyUpEvent e) { presenter.applyTermFilter(termFilter.value); } } | DecisionComponentsView implements DecisionComponents.View { @EventHandler("term-filter") public void onTermFilterChange(final KeyUpEvent e) { presenter.applyTermFilter(termFilter.value); } @Inject DecisionComponentsView(final HTMLSelectElement drgElementFilter,
final HTMLInputElement termFilter,
final HTMLDivElement list,
final HTMLDivElement emptyState,
final HTMLDivElement loading,
final HTMLDivElement componentsCounter,
final TranslationService translationService); } | DecisionComponentsView implements DecisionComponents.View { @EventHandler("term-filter") public void onTermFilterChange(final KeyUpEvent e) { presenter.applyTermFilter(termFilter.value); } @Inject DecisionComponentsView(final HTMLSelectElement drgElementFilter,
final HTMLInputElement termFilter,
final HTMLDivElement list,
final HTMLDivElement emptyState,
final HTMLDivElement loading,
final HTMLDivElement componentsCounter,
final TranslationService translationService); @PostConstruct void init(); @Override void init(final DecisionComponents presenter); @EventHandler("term-filter") void onTermFilterChange(final KeyUpEvent e); @Override void clear(); @Override void addListItem(final HTMLElement htmlElement); @Override void showEmptyState(); @Override void showLoading(); @Override void hideLoading(); @Override void disableFilterInputs(); @Override void enableFilterInputs(); @Override void setComponentsCounter(final Integer count); } | DecisionComponentsView implements DecisionComponents.View { @EventHandler("term-filter") public void onTermFilterChange(final KeyUpEvent e) { presenter.applyTermFilter(termFilter.value); } @Inject DecisionComponentsView(final HTMLSelectElement drgElementFilter,
final HTMLInputElement termFilter,
final HTMLDivElement list,
final HTMLDivElement emptyState,
final HTMLDivElement loading,
final HTMLDivElement componentsCounter,
final TranslationService translationService); @PostConstruct void init(); @Override void init(final DecisionComponents presenter); @EventHandler("term-filter") void onTermFilterChange(final KeyUpEvent e); @Override void clear(); @Override void addListItem(final HTMLElement htmlElement); @Override void showEmptyState(); @Override void showLoading(); @Override void hideLoading(); @Override void disableFilterInputs(); @Override void enableFilterInputs(); @Override void setComponentsCounter(final Integer count); } |
@Test public void testAddSafeCollectionOutput() { List<DataOutputAssociation> associations = new ArrayList<>(); DataOutputAssociation outputAssociation = mock(DataOutputAssociation.class); associations.add(outputAssociation); DataOutputAssociation outputAssociation2 = mock(DataOutputAssociation.class); when(outputAssociation.getSourceRef()).thenReturn(null); writer.addSafe(associations, outputAssociation2); associations.clear(); associations.add(outputAssociation); when(outputAssociation.getSourceRef()).thenReturn(new ArrayList<>()); writer.addSafe(associations, outputAssociation2); associations.clear(); associations.add(outputAssociation); List<ItemAwareElement> list = new ArrayList<>(); ItemAwareElementImpl element = mock(ItemAwareElementImpl.class); when(element.getId()).thenReturn("elementId"); list.add(element); when(outputAssociation.getSourceRef()).thenReturn(list); when(outputAssociation2.getSourceRef()).thenReturn(list); writer.addSafe(associations, outputAssociation2); associations.clear(); associations.add(outputAssociation); list = new ArrayList<>(); element = mock(ItemAwareElementImpl.class); when(element.getId()).thenReturn("elementId"); list.add(element); List<ItemAwareElement> list2 = new ArrayList<>(); ItemAwareElementImpl element2 = mock(ItemAwareElementImpl.class); when(element2.getId()).thenReturn("elementId"); list2.add(element2); when(element.getId()).thenReturn("elementId2"); list.add(element); when(outputAssociation.getSourceRef()).thenReturn(list); when(outputAssociation2.getSourceRef()).thenReturn(list2); writer.addSafe(associations, outputAssociation2); assertTrue(associations.contains(outputAssociation2)); } | protected static void addSafe(List<DataInput> inputs, DataInput dataInput) { inputs.removeIf(existingDataInput -> dataInput.getId().equals(existingDataInput.getId())); inputs.add(dataInput); } | MultipleInstanceActivityPropertyWriter extends ActivityPropertyWriter { protected static void addSafe(List<DataInput> inputs, DataInput dataInput) { inputs.removeIf(existingDataInput -> dataInput.getId().equals(existingDataInput.getId())); inputs.add(dataInput); } } | MultipleInstanceActivityPropertyWriter extends ActivityPropertyWriter { protected static void addSafe(List<DataInput> inputs, DataInput dataInput) { inputs.removeIf(existingDataInput -> dataInput.getId().equals(existingDataInput.getId())); inputs.add(dataInput); } MultipleInstanceActivityPropertyWriter(Activity activity,
VariableScope variableScope,
Set<DataObject> dataObjects); } | MultipleInstanceActivityPropertyWriter extends ActivityPropertyWriter { protected static void addSafe(List<DataInput> inputs, DataInput dataInput) { inputs.removeIf(existingDataInput -> dataInput.getId().equals(existingDataInput.getId())); inputs.add(dataInput); } MultipleInstanceActivityPropertyWriter(Activity activity,
VariableScope variableScope,
Set<DataObject> dataObjects); void setCollectionInput(String collectionInput); void setCollectionOutput(String collectionOutput); void setInput(String name); void setOutput(String name); void setOutput(String name, boolean addDataOutputAssociation); void setCompletionCondition(String expression); void setIsSequential(boolean sequential); } | MultipleInstanceActivityPropertyWriter extends ActivityPropertyWriter { protected static void addSafe(List<DataInput> inputs, DataInput dataInput) { inputs.removeIf(existingDataInput -> dataInput.getId().equals(existingDataInput.getId())); inputs.add(dataInput); } MultipleInstanceActivityPropertyWriter(Activity activity,
VariableScope variableScope,
Set<DataObject> dataObjects); void setCollectionInput(String collectionInput); void setCollectionOutput(String collectionOutput); void setInput(String name); void setOutput(String name); void setOutput(String name, boolean addDataOutputAssociation); void setCompletionCondition(String expression); void setIsSequential(boolean sequential); } |
@Test public void testSetCompletionCondition() { writer.setCompletionCondition(COMPLETION_CONDITION); assertEquals("<![CDATA[COMPLETION_CONDITION]]>", ((FormalExpression) ((MultiInstanceLoopCharacteristics) activity.getLoopCharacteristics()).getCompletionCondition()).getBody()); } | public void setCompletionCondition(String expression) { if (!isEmpty(expression)) { setUpLoopCharacteristics(); FormalExpression formalExpression = bpmn2.createFormalExpression(); formalExpression.setBody(asCData(expression)); miloop.setCompletionCondition(formalExpression); } } | MultipleInstanceActivityPropertyWriter extends ActivityPropertyWriter { public void setCompletionCondition(String expression) { if (!isEmpty(expression)) { setUpLoopCharacteristics(); FormalExpression formalExpression = bpmn2.createFormalExpression(); formalExpression.setBody(asCData(expression)); miloop.setCompletionCondition(formalExpression); } } } | MultipleInstanceActivityPropertyWriter extends ActivityPropertyWriter { public void setCompletionCondition(String expression) { if (!isEmpty(expression)) { setUpLoopCharacteristics(); FormalExpression formalExpression = bpmn2.createFormalExpression(); formalExpression.setBody(asCData(expression)); miloop.setCompletionCondition(formalExpression); } } MultipleInstanceActivityPropertyWriter(Activity activity,
VariableScope variableScope,
Set<DataObject> dataObjects); } | MultipleInstanceActivityPropertyWriter extends ActivityPropertyWriter { public void setCompletionCondition(String expression) { if (!isEmpty(expression)) { setUpLoopCharacteristics(); FormalExpression formalExpression = bpmn2.createFormalExpression(); formalExpression.setBody(asCData(expression)); miloop.setCompletionCondition(formalExpression); } } MultipleInstanceActivityPropertyWriter(Activity activity,
VariableScope variableScope,
Set<DataObject> dataObjects); void setCollectionInput(String collectionInput); void setCollectionOutput(String collectionOutput); void setInput(String name); void setOutput(String name); void setOutput(String name, boolean addDataOutputAssociation); void setCompletionCondition(String expression); void setIsSequential(boolean sequential); } | MultipleInstanceActivityPropertyWriter extends ActivityPropertyWriter { public void setCompletionCondition(String expression) { if (!isEmpty(expression)) { setUpLoopCharacteristics(); FormalExpression formalExpression = bpmn2.createFormalExpression(); formalExpression.setBody(asCData(expression)); miloop.setCompletionCondition(formalExpression); } } MultipleInstanceActivityPropertyWriter(Activity activity,
VariableScope variableScope,
Set<DataObject> dataObjects); void setCollectionInput(String collectionInput); void setCollectionOutput(String collectionOutput); void setInput(String name); void setOutput(String name); void setOutput(String name, boolean addDataOutputAssociation); void setCompletionCondition(String expression); void setIsSequential(boolean sequential); } |
@Test public void testSetIsSequentialTrue() { writer.setIsSequential(true); assertTrue(((MultiInstanceLoopCharacteristics) activity.getLoopCharacteristics()).isIsSequential()); } | public void setIsSequential(boolean sequential) { setUpLoopCharacteristics(); miloop.setIsSequential(sequential); } | MultipleInstanceActivityPropertyWriter extends ActivityPropertyWriter { public void setIsSequential(boolean sequential) { setUpLoopCharacteristics(); miloop.setIsSequential(sequential); } } | MultipleInstanceActivityPropertyWriter extends ActivityPropertyWriter { public void setIsSequential(boolean sequential) { setUpLoopCharacteristics(); miloop.setIsSequential(sequential); } MultipleInstanceActivityPropertyWriter(Activity activity,
VariableScope variableScope,
Set<DataObject> dataObjects); } | MultipleInstanceActivityPropertyWriter extends ActivityPropertyWriter { public void setIsSequential(boolean sequential) { setUpLoopCharacteristics(); miloop.setIsSequential(sequential); } MultipleInstanceActivityPropertyWriter(Activity activity,
VariableScope variableScope,
Set<DataObject> dataObjects); void setCollectionInput(String collectionInput); void setCollectionOutput(String collectionOutput); void setInput(String name); void setOutput(String name); void setOutput(String name, boolean addDataOutputAssociation); void setCompletionCondition(String expression); void setIsSequential(boolean sequential); } | MultipleInstanceActivityPropertyWriter extends ActivityPropertyWriter { public void setIsSequential(boolean sequential) { setUpLoopCharacteristics(); miloop.setIsSequential(sequential); } MultipleInstanceActivityPropertyWriter(Activity activity,
VariableScope variableScope,
Set<DataObject> dataObjects); void setCollectionInput(String collectionInput); void setCollectionOutput(String collectionOutput); void setInput(String name); void setOutput(String name); void setOutput(String name, boolean addDataOutputAssociation); void setCompletionCondition(String expression); void setIsSequential(boolean sequential); } |
@Test public void testSetIsSequentialFalse() { writer.setIsSequential(false); assertFalse(((MultiInstanceLoopCharacteristics) activity.getLoopCharacteristics()).isIsSequential()); } | public void setIsSequential(boolean sequential) { setUpLoopCharacteristics(); miloop.setIsSequential(sequential); } | MultipleInstanceActivityPropertyWriter extends ActivityPropertyWriter { public void setIsSequential(boolean sequential) { setUpLoopCharacteristics(); miloop.setIsSequential(sequential); } } | MultipleInstanceActivityPropertyWriter extends ActivityPropertyWriter { public void setIsSequential(boolean sequential) { setUpLoopCharacteristics(); miloop.setIsSequential(sequential); } MultipleInstanceActivityPropertyWriter(Activity activity,
VariableScope variableScope,
Set<DataObject> dataObjects); } | MultipleInstanceActivityPropertyWriter extends ActivityPropertyWriter { public void setIsSequential(boolean sequential) { setUpLoopCharacteristics(); miloop.setIsSequential(sequential); } MultipleInstanceActivityPropertyWriter(Activity activity,
VariableScope variableScope,
Set<DataObject> dataObjects); void setCollectionInput(String collectionInput); void setCollectionOutput(String collectionOutput); void setInput(String name); void setOutput(String name); void setOutput(String name, boolean addDataOutputAssociation); void setCompletionCondition(String expression); void setIsSequential(boolean sequential); } | MultipleInstanceActivityPropertyWriter extends ActivityPropertyWriter { public void setIsSequential(boolean sequential) { setUpLoopCharacteristics(); miloop.setIsSequential(sequential); } MultipleInstanceActivityPropertyWriter(Activity activity,
VariableScope variableScope,
Set<DataObject> dataObjects); void setCollectionInput(String collectionInput); void setCollectionOutput(String collectionOutput); void setInput(String name); void setOutput(String name); void setOutput(String name, boolean addDataOutputAssociation); void setCompletionCondition(String expression); void setIsSequential(boolean sequential); } |
@Test public void setName() { tested.setName(NAME); assertEquals(NAME, reference.getDataObjectRef().getName()); tested.setName(NAME); assertEquals(NAME, reference.getDataObjectRef().getName()); } | @Override public void setName(String value) { final String escaped = StringUtils.replaceIllegalCharsAttribute(value.trim()); dataObject.setName(escaped); dataObject.setId(escaped); } | DataObjectPropertyWriter extends PropertyWriter { @Override public void setName(String value) { final String escaped = StringUtils.replaceIllegalCharsAttribute(value.trim()); dataObject.setName(escaped); dataObject.setId(escaped); } } | DataObjectPropertyWriter extends PropertyWriter { @Override public void setName(String value) { final String escaped = StringUtils.replaceIllegalCharsAttribute(value.trim()); dataObject.setName(escaped); dataObject.setId(escaped); } DataObjectPropertyWriter(DataObjectReference element,
VariableScope variableScope,
Set<DataObject> dataObjects); } | DataObjectPropertyWriter extends PropertyWriter { @Override public void setName(String value) { final String escaped = StringUtils.replaceIllegalCharsAttribute(value.trim()); dataObject.setName(escaped); dataObject.setId(escaped); } DataObjectPropertyWriter(DataObjectReference element,
VariableScope variableScope,
Set<DataObject> dataObjects); @Override void setName(String value); void setType(String type); @Override DataObjectReference getElement(); Set<DataObject> getDataObjects(); } | DataObjectPropertyWriter extends PropertyWriter { @Override public void setName(String value) { final String escaped = StringUtils.replaceIllegalCharsAttribute(value.trim()); dataObject.setName(escaped); dataObject.setId(escaped); } DataObjectPropertyWriter(DataObjectReference element,
VariableScope variableScope,
Set<DataObject> dataObjects); @Override void setName(String value); void setType(String type); @Override DataObjectReference getElement(); Set<DataObject> getDataObjects(); } |
@Test public void setType() { tested.setType(NAME); assertEquals(NAME, reference.getDataObjectRef().getItemSubjectRef().getStructureRef()); } | public void setType(String type) { ItemDefinition itemDefinition = bpmn2.createItemDefinition(); itemDefinition.setStructureRef(type); dataObject.setItemSubjectRef(itemDefinition); addDataObjectToProcess(dataObject); } | DataObjectPropertyWriter extends PropertyWriter { public void setType(String type) { ItemDefinition itemDefinition = bpmn2.createItemDefinition(); itemDefinition.setStructureRef(type); dataObject.setItemSubjectRef(itemDefinition); addDataObjectToProcess(dataObject); } } | DataObjectPropertyWriter extends PropertyWriter { public void setType(String type) { ItemDefinition itemDefinition = bpmn2.createItemDefinition(); itemDefinition.setStructureRef(type); dataObject.setItemSubjectRef(itemDefinition); addDataObjectToProcess(dataObject); } DataObjectPropertyWriter(DataObjectReference element,
VariableScope variableScope,
Set<DataObject> dataObjects); } | DataObjectPropertyWriter extends PropertyWriter { public void setType(String type) { ItemDefinition itemDefinition = bpmn2.createItemDefinition(); itemDefinition.setStructureRef(type); dataObject.setItemSubjectRef(itemDefinition); addDataObjectToProcess(dataObject); } DataObjectPropertyWriter(DataObjectReference element,
VariableScope variableScope,
Set<DataObject> dataObjects); @Override void setName(String value); void setType(String type); @Override DataObjectReference getElement(); Set<DataObject> getDataObjects(); } | DataObjectPropertyWriter extends PropertyWriter { public void setType(String type) { ItemDefinition itemDefinition = bpmn2.createItemDefinition(); itemDefinition.setStructureRef(type); dataObject.setItemSubjectRef(itemDefinition); addDataObjectToProcess(dataObject); } DataObjectPropertyWriter(DataObjectReference element,
VariableScope variableScope,
Set<DataObject> dataObjects); @Override void setName(String value); void setType(String type); @Override DataObjectReference getElement(); Set<DataObject> getDataObjects(); } |
@Test public void getDataObjects() { assertEquals(0, tested.getDataObjects().size()); } | public Set<DataObject> getDataObjects() { return dataObjects; } | DataObjectPropertyWriter extends PropertyWriter { public Set<DataObject> getDataObjects() { return dataObjects; } } | DataObjectPropertyWriter extends PropertyWriter { public Set<DataObject> getDataObjects() { return dataObjects; } DataObjectPropertyWriter(DataObjectReference element,
VariableScope variableScope,
Set<DataObject> dataObjects); } | DataObjectPropertyWriter extends PropertyWriter { public Set<DataObject> getDataObjects() { return dataObjects; } DataObjectPropertyWriter(DataObjectReference element,
VariableScope variableScope,
Set<DataObject> dataObjects); @Override void setName(String value); void setType(String type); @Override DataObjectReference getElement(); Set<DataObject> getDataObjects(); } | DataObjectPropertyWriter extends PropertyWriter { public Set<DataObject> getDataObjects() { return dataObjects; } DataObjectPropertyWriter(DataObjectReference element,
VariableScope variableScope,
Set<DataObject> dataObjects); @Override void setName(String value); void setType(String type); @Override DataObjectReference getElement(); Set<DataObject> getDataObjects(); } |
@Test public void getElement() { assertEquals(reference, tested.getElement()); } | @Override public DataObjectReference getElement() { return (DataObjectReference) super.getElement(); } | DataObjectPropertyWriter extends PropertyWriter { @Override public DataObjectReference getElement() { return (DataObjectReference) super.getElement(); } } | DataObjectPropertyWriter extends PropertyWriter { @Override public DataObjectReference getElement() { return (DataObjectReference) super.getElement(); } DataObjectPropertyWriter(DataObjectReference element,
VariableScope variableScope,
Set<DataObject> dataObjects); } | DataObjectPropertyWriter extends PropertyWriter { @Override public DataObjectReference getElement() { return (DataObjectReference) super.getElement(); } DataObjectPropertyWriter(DataObjectReference element,
VariableScope variableScope,
Set<DataObject> dataObjects); @Override void setName(String value); void setType(String type); @Override DataObjectReference getElement(); Set<DataObject> getDataObjects(); } | DataObjectPropertyWriter extends PropertyWriter { @Override public DataObjectReference getElement() { return (DataObjectReference) super.getElement(); } DataObjectPropertyWriter(DataObjectReference element,
VariableScope variableScope,
Set<DataObject> dataObjects); @Override void setName(String value); void setType(String type); @Override DataObjectReference getElement(); Set<DataObject> getDataObjects(); } |
@Test public void lookupNotFound() { Optional<VariableScope.Variable> variable = tested.lookup(UUID.randomUUID().toString()); assertFalse(variable.isPresent()); } | public Optional<Variable> lookup(String identifier) { return Optional.ofNullable(variables.get(identifier)); } | FlatVariableScope implements VariableScope { public Optional<Variable> lookup(String identifier) { return Optional.ofNullable(variables.get(identifier)); } } | FlatVariableScope implements VariableScope { public Optional<Variable> lookup(String identifier) { return Optional.ofNullable(variables.get(identifier)); } } | FlatVariableScope implements VariableScope { public Optional<Variable> lookup(String identifier) { return Optional.ofNullable(variables.get(identifier)); } Variable declare(String scopeId, String identifier, String type); Variable declare(String scopeId, String identifier, String type, String tags); Optional<Variable> lookup(String identifier); Collection<Variable> getVariables(String scopeId); } | FlatVariableScope implements VariableScope { public Optional<Variable> lookup(String identifier) { return Optional.ofNullable(variables.get(identifier)); } Variable declare(String scopeId, String identifier, String type); Variable declare(String scopeId, String identifier, String type, String tags); Optional<Variable> lookup(String identifier); Collection<Variable> getVariables(String scopeId); } |
@Test public void addChildElement() { Process process = p.getProcess(); BoundaryEventPropertyWriter boundaryEventPropertyWriter = new BoundaryEventPropertyWriter(bpmn2.createBoundaryEvent(), variableScope, new HashSet<>()); UserTaskPropertyWriter userTaskPropertyWriter = new UserTaskPropertyWriter(bpmn2.createUserTask(), variableScope, new HashSet<>()); SubProcessPropertyWriter subProcessPropertyWriter = new SubProcessPropertyWriter(bpmn2.createSubProcess(), variableScope, new HashSet<>()); final DataObjectReference dataObjectReference = bpmn2.createDataObjectReference(); DataObjectPropertyWriter dataObjectPropertyWriter = new DataObjectPropertyWriter(dataObjectReference, variableScope, new HashSet<>()); final DataObject dataObject = dataObjectPropertyWriter.getElement().getDataObjectRef(); dataObject.getItemSubjectRef(); ItemDefinition itemDefinition = mock(ItemDefinition.class); when(itemDefinition.getId()).thenReturn("someId"); dataObject.setItemSubjectRef(itemDefinition); dataObject.getItemSubjectRef(); subProcessPropertyWriter.addChildElement(dataObjectPropertyWriter); p.addChildElement(subProcessPropertyWriter); p.addChildElement(boundaryEventPropertyWriter); p.addChildElement(userTaskPropertyWriter); assertThat(process.getFlowElements().get(0)).isEqualTo(userTaskPropertyWriter.getFlowElement()); assertThat(process.getFlowElements().get(1)).isEqualTo(subProcessPropertyWriter.getFlowElement()); assertThat(process.getFlowElements().get(2)).isEqualTo(boundaryEventPropertyWriter.getFlowElement()); } | public void addChildElement(BasePropertyWriter p) { Processes.addChildElement( p, childElements, process, simulationParameters, itemDefinitions, rootElements); addChildShape(p.getShape()); addChildEdge(p.getEdge()); if (p instanceof SubProcessPropertyWriter) { addSubProcess((SubProcessPropertyWriter) p); } else if (p instanceof DataObjectPropertyWriter) { DataObject dataObject = ((DataObjectPropertyWriter) p).getElement().getDataObjectRef(); maybeAddDataObjectToItemDefinitions(itemDefinitions, dataObject); } maybeAddDataObjectToItemDefinitions(itemDefinitions, dataObjects); } | ProcessPropertyWriter extends BasePropertyWriter implements ElementContainer { public void addChildElement(BasePropertyWriter p) { Processes.addChildElement( p, childElements, process, simulationParameters, itemDefinitions, rootElements); addChildShape(p.getShape()); addChildEdge(p.getEdge()); if (p instanceof SubProcessPropertyWriter) { addSubProcess((SubProcessPropertyWriter) p); } else if (p instanceof DataObjectPropertyWriter) { DataObject dataObject = ((DataObjectPropertyWriter) p).getElement().getDataObjectRef(); maybeAddDataObjectToItemDefinitions(itemDefinitions, dataObject); } maybeAddDataObjectToItemDefinitions(itemDefinitions, dataObjects); } } | ProcessPropertyWriter extends BasePropertyWriter implements ElementContainer { public void addChildElement(BasePropertyWriter p) { Processes.addChildElement( p, childElements, process, simulationParameters, itemDefinitions, rootElements); addChildShape(p.getShape()); addChildEdge(p.getEdge()); if (p instanceof SubProcessPropertyWriter) { addSubProcess((SubProcessPropertyWriter) p); } else if (p instanceof DataObjectPropertyWriter) { DataObject dataObject = ((DataObjectPropertyWriter) p).getElement().getDataObjectRef(); maybeAddDataObjectToItemDefinitions(itemDefinitions, dataObject); } maybeAddDataObjectToItemDefinitions(itemDefinitions, dataObjects); } ProcessPropertyWriter(Process process, VariableScope variableScope, Set<DataObject> dataObjects); } | ProcessPropertyWriter extends BasePropertyWriter implements ElementContainer { public void addChildElement(BasePropertyWriter p) { Processes.addChildElement( p, childElements, process, simulationParameters, itemDefinitions, rootElements); addChildShape(p.getShape()); addChildEdge(p.getEdge()); if (p instanceof SubProcessPropertyWriter) { addSubProcess((SubProcessPropertyWriter) p); } else if (p instanceof DataObjectPropertyWriter) { DataObject dataObject = ((DataObjectPropertyWriter) p).getElement().getDataObjectRef(); maybeAddDataObjectToItemDefinitions(itemDefinitions, dataObject); } maybeAddDataObjectToItemDefinitions(itemDefinitions, dataObjects); } ProcessPropertyWriter(Process process, VariableScope variableScope, Set<DataObject> dataObjects); void setId(String value); Process getProcess(); void addChildShape(BPMNShape shape); void addChildEdge(BPMNEdge edge); BPMNDiagram getBpmnDiagram(); void addChildElement(BasePropertyWriter p); @Override Collection<BasePropertyWriter> getChildElements(); BasePropertyWriter getChildElement(String id); void setName(String value); void setExecutable(Boolean value); void setPackage(String value); void setType(String value); void setVersion(String value); void setAdHoc(Boolean adHoc); void setDescription(String value); void setProcessVariables(BaseProcessVariables processVariables); void setMetadata(final MetaDataAttributes metaDataAttributes); void setCaseFileVariables(CaseFileVariables caseFileVariables); void setCaseIdPrefix(CaseIdPrefix caseIdPrefix); void setCaseRoles(CaseRoles roles); void setGlobalVariables(GlobalVariables globalVariables); void setDefaultImports(List<DefaultImport> imports); void setSlaDueDate(SLADueDate slaDueDate); void addLaneSet(Collection<LanePropertyWriter> lanes); Collection<ElementParameters> getSimulationParameters(); Relationship getRelationship(); Set<DataObject> getDataObjects(); } | ProcessPropertyWriter extends BasePropertyWriter implements ElementContainer { public void addChildElement(BasePropertyWriter p) { Processes.addChildElement( p, childElements, process, simulationParameters, itemDefinitions, rootElements); addChildShape(p.getShape()); addChildEdge(p.getEdge()); if (p instanceof SubProcessPropertyWriter) { addSubProcess((SubProcessPropertyWriter) p); } else if (p instanceof DataObjectPropertyWriter) { DataObject dataObject = ((DataObjectPropertyWriter) p).getElement().getDataObjectRef(); maybeAddDataObjectToItemDefinitions(itemDefinitions, dataObject); } maybeAddDataObjectToItemDefinitions(itemDefinitions, dataObjects); } ProcessPropertyWriter(Process process, VariableScope variableScope, Set<DataObject> dataObjects); void setId(String value); Process getProcess(); void addChildShape(BPMNShape shape); void addChildEdge(BPMNEdge edge); BPMNDiagram getBpmnDiagram(); void addChildElement(BasePropertyWriter p); @Override Collection<BasePropertyWriter> getChildElements(); BasePropertyWriter getChildElement(String id); void setName(String value); void setExecutable(Boolean value); void setPackage(String value); void setType(String value); void setVersion(String value); void setAdHoc(Boolean adHoc); void setDescription(String value); void setProcessVariables(BaseProcessVariables processVariables); void setMetadata(final MetaDataAttributes metaDataAttributes); void setCaseFileVariables(CaseFileVariables caseFileVariables); void setCaseIdPrefix(CaseIdPrefix caseIdPrefix); void setCaseRoles(CaseRoles roles); void setGlobalVariables(GlobalVariables globalVariables); void setDefaultImports(List<DefaultImport> imports); void setSlaDueDate(SLADueDate slaDueDate); void addLaneSet(Collection<LanePropertyWriter> lanes); Collection<ElementParameters> getSimulationParameters(); Relationship getRelationship(); Set<DataObject> getDataObjects(); } |
@Test public void testClear() { final Node element = mock(Node.class); emptyState.classList = mock(DOMTokenList.class); list.firstChild = element; when(list.removeChild(element)).then(a -> { list.firstChild = null; return element; }); view.clear(); verify(emptyState.classList).add(HIDDEN_CSS_CLASS); } | @Override public void clear() { RemoveHelper.removeChildren(list); hide(emptyState); } | DecisionComponentsView implements DecisionComponents.View { @Override public void clear() { RemoveHelper.removeChildren(list); hide(emptyState); } } | DecisionComponentsView implements DecisionComponents.View { @Override public void clear() { RemoveHelper.removeChildren(list); hide(emptyState); } @Inject DecisionComponentsView(final HTMLSelectElement drgElementFilter,
final HTMLInputElement termFilter,
final HTMLDivElement list,
final HTMLDivElement emptyState,
final HTMLDivElement loading,
final HTMLDivElement componentsCounter,
final TranslationService translationService); } | DecisionComponentsView implements DecisionComponents.View { @Override public void clear() { RemoveHelper.removeChildren(list); hide(emptyState); } @Inject DecisionComponentsView(final HTMLSelectElement drgElementFilter,
final HTMLInputElement termFilter,
final HTMLDivElement list,
final HTMLDivElement emptyState,
final HTMLDivElement loading,
final HTMLDivElement componentsCounter,
final TranslationService translationService); @PostConstruct void init(); @Override void init(final DecisionComponents presenter); @EventHandler("term-filter") void onTermFilterChange(final KeyUpEvent e); @Override void clear(); @Override void addListItem(final HTMLElement htmlElement); @Override void showEmptyState(); @Override void showLoading(); @Override void hideLoading(); @Override void disableFilterInputs(); @Override void enableFilterInputs(); @Override void setComponentsCounter(final Integer count); } | DecisionComponentsView implements DecisionComponents.View { @Override public void clear() { RemoveHelper.removeChildren(list); hide(emptyState); } @Inject DecisionComponentsView(final HTMLSelectElement drgElementFilter,
final HTMLInputElement termFilter,
final HTMLDivElement list,
final HTMLDivElement emptyState,
final HTMLDivElement loading,
final HTMLDivElement componentsCounter,
final TranslationService translationService); @PostConstruct void init(); @Override void init(final DecisionComponents presenter); @EventHandler("term-filter") void onTermFilterChange(final KeyUpEvent e); @Override void clear(); @Override void addListItem(final HTMLElement htmlElement); @Override void showEmptyState(); @Override void showLoading(); @Override void hideLoading(); @Override void disableFilterInputs(); @Override void enableFilterInputs(); @Override void setComponentsCounter(final Integer count); } |
@Test public void addChildShape() { BPMNShape bpmnShape = di.createBPMNShape(); bpmnShape.setId("a"); p.addChildShape(bpmnShape); assertThatThrownBy(() -> p.addChildShape(bpmnShape)) .isInstanceOf(IllegalArgumentException.class) .hasMessageStartingWith("Cannot add the same shape twice"); } | public void addChildShape(BPMNShape shape) { if (shape == null) { return; } List<DiagramElement> planeElement = bpmnPlane.getPlaneElement(); if (planeElement.contains(shape)) { throw new IllegalArgumentException("Cannot add the same shape twice: " + shape.getId()); } planeElement.add(shape); } | ProcessPropertyWriter extends BasePropertyWriter implements ElementContainer { public void addChildShape(BPMNShape shape) { if (shape == null) { return; } List<DiagramElement> planeElement = bpmnPlane.getPlaneElement(); if (planeElement.contains(shape)) { throw new IllegalArgumentException("Cannot add the same shape twice: " + shape.getId()); } planeElement.add(shape); } } | ProcessPropertyWriter extends BasePropertyWriter implements ElementContainer { public void addChildShape(BPMNShape shape) { if (shape == null) { return; } List<DiagramElement> planeElement = bpmnPlane.getPlaneElement(); if (planeElement.contains(shape)) { throw new IllegalArgumentException("Cannot add the same shape twice: " + shape.getId()); } planeElement.add(shape); } ProcessPropertyWriter(Process process, VariableScope variableScope, Set<DataObject> dataObjects); } | ProcessPropertyWriter extends BasePropertyWriter implements ElementContainer { public void addChildShape(BPMNShape shape) { if (shape == null) { return; } List<DiagramElement> planeElement = bpmnPlane.getPlaneElement(); if (planeElement.contains(shape)) { throw new IllegalArgumentException("Cannot add the same shape twice: " + shape.getId()); } planeElement.add(shape); } ProcessPropertyWriter(Process process, VariableScope variableScope, Set<DataObject> dataObjects); void setId(String value); Process getProcess(); void addChildShape(BPMNShape shape); void addChildEdge(BPMNEdge edge); BPMNDiagram getBpmnDiagram(); void addChildElement(BasePropertyWriter p); @Override Collection<BasePropertyWriter> getChildElements(); BasePropertyWriter getChildElement(String id); void setName(String value); void setExecutable(Boolean value); void setPackage(String value); void setType(String value); void setVersion(String value); void setAdHoc(Boolean adHoc); void setDescription(String value); void setProcessVariables(BaseProcessVariables processVariables); void setMetadata(final MetaDataAttributes metaDataAttributes); void setCaseFileVariables(CaseFileVariables caseFileVariables); void setCaseIdPrefix(CaseIdPrefix caseIdPrefix); void setCaseRoles(CaseRoles roles); void setGlobalVariables(GlobalVariables globalVariables); void setDefaultImports(List<DefaultImport> imports); void setSlaDueDate(SLADueDate slaDueDate); void addLaneSet(Collection<LanePropertyWriter> lanes); Collection<ElementParameters> getSimulationParameters(); Relationship getRelationship(); Set<DataObject> getDataObjects(); } | ProcessPropertyWriter extends BasePropertyWriter implements ElementContainer { public void addChildShape(BPMNShape shape) { if (shape == null) { return; } List<DiagramElement> planeElement = bpmnPlane.getPlaneElement(); if (planeElement.contains(shape)) { throw new IllegalArgumentException("Cannot add the same shape twice: " + shape.getId()); } planeElement.add(shape); } ProcessPropertyWriter(Process process, VariableScope variableScope, Set<DataObject> dataObjects); void setId(String value); Process getProcess(); void addChildShape(BPMNShape shape); void addChildEdge(BPMNEdge edge); BPMNDiagram getBpmnDiagram(); void addChildElement(BasePropertyWriter p); @Override Collection<BasePropertyWriter> getChildElements(); BasePropertyWriter getChildElement(String id); void setName(String value); void setExecutable(Boolean value); void setPackage(String value); void setType(String value); void setVersion(String value); void setAdHoc(Boolean adHoc); void setDescription(String value); void setProcessVariables(BaseProcessVariables processVariables); void setMetadata(final MetaDataAttributes metaDataAttributes); void setCaseFileVariables(CaseFileVariables caseFileVariables); void setCaseIdPrefix(CaseIdPrefix caseIdPrefix); void setCaseRoles(CaseRoles roles); void setGlobalVariables(GlobalVariables globalVariables); void setDefaultImports(List<DefaultImport> imports); void setSlaDueDate(SLADueDate slaDueDate); void addLaneSet(Collection<LanePropertyWriter> lanes); Collection<ElementParameters> getSimulationParameters(); Relationship getRelationship(); Set<DataObject> getDataObjects(); } |
@Test public void addChildEdge() { BPMNEdge bpmnEdge = di.createBPMNEdge(); bpmnEdge.setId("a"); p.addChildEdge(bpmnEdge); assertThatThrownBy(() -> p.addChildEdge(bpmnEdge)) .isInstanceOf(IllegalArgumentException.class) .hasMessageStartingWith("Cannot add the same edge twice"); } | public void addChildEdge(BPMNEdge edge) { if (edge == null) { return; } List<DiagramElement> planeElement = bpmnPlane.getPlaneElement(); if (planeElement.contains(edge)) { throw new IllegalArgumentException("Cannot add the same edge twice: " + edge.getId()); } planeElement.add(edge); } | ProcessPropertyWriter extends BasePropertyWriter implements ElementContainer { public void addChildEdge(BPMNEdge edge) { if (edge == null) { return; } List<DiagramElement> planeElement = bpmnPlane.getPlaneElement(); if (planeElement.contains(edge)) { throw new IllegalArgumentException("Cannot add the same edge twice: " + edge.getId()); } planeElement.add(edge); } } | ProcessPropertyWriter extends BasePropertyWriter implements ElementContainer { public void addChildEdge(BPMNEdge edge) { if (edge == null) { return; } List<DiagramElement> planeElement = bpmnPlane.getPlaneElement(); if (planeElement.contains(edge)) { throw new IllegalArgumentException("Cannot add the same edge twice: " + edge.getId()); } planeElement.add(edge); } ProcessPropertyWriter(Process process, VariableScope variableScope, Set<DataObject> dataObjects); } | ProcessPropertyWriter extends BasePropertyWriter implements ElementContainer { public void addChildEdge(BPMNEdge edge) { if (edge == null) { return; } List<DiagramElement> planeElement = bpmnPlane.getPlaneElement(); if (planeElement.contains(edge)) { throw new IllegalArgumentException("Cannot add the same edge twice: " + edge.getId()); } planeElement.add(edge); } ProcessPropertyWriter(Process process, VariableScope variableScope, Set<DataObject> dataObjects); void setId(String value); Process getProcess(); void addChildShape(BPMNShape shape); void addChildEdge(BPMNEdge edge); BPMNDiagram getBpmnDiagram(); void addChildElement(BasePropertyWriter p); @Override Collection<BasePropertyWriter> getChildElements(); BasePropertyWriter getChildElement(String id); void setName(String value); void setExecutable(Boolean value); void setPackage(String value); void setType(String value); void setVersion(String value); void setAdHoc(Boolean adHoc); void setDescription(String value); void setProcessVariables(BaseProcessVariables processVariables); void setMetadata(final MetaDataAttributes metaDataAttributes); void setCaseFileVariables(CaseFileVariables caseFileVariables); void setCaseIdPrefix(CaseIdPrefix caseIdPrefix); void setCaseRoles(CaseRoles roles); void setGlobalVariables(GlobalVariables globalVariables); void setDefaultImports(List<DefaultImport> imports); void setSlaDueDate(SLADueDate slaDueDate); void addLaneSet(Collection<LanePropertyWriter> lanes); Collection<ElementParameters> getSimulationParameters(); Relationship getRelationship(); Set<DataObject> getDataObjects(); } | ProcessPropertyWriter extends BasePropertyWriter implements ElementContainer { public void addChildEdge(BPMNEdge edge) { if (edge == null) { return; } List<DiagramElement> planeElement = bpmnPlane.getPlaneElement(); if (planeElement.contains(edge)) { throw new IllegalArgumentException("Cannot add the same edge twice: " + edge.getId()); } planeElement.add(edge); } ProcessPropertyWriter(Process process, VariableScope variableScope, Set<DataObject> dataObjects); void setId(String value); Process getProcess(); void addChildShape(BPMNShape shape); void addChildEdge(BPMNEdge edge); BPMNDiagram getBpmnDiagram(); void addChildElement(BasePropertyWriter p); @Override Collection<BasePropertyWriter> getChildElements(); BasePropertyWriter getChildElement(String id); void setName(String value); void setExecutable(Boolean value); void setPackage(String value); void setType(String value); void setVersion(String value); void setAdHoc(Boolean adHoc); void setDescription(String value); void setProcessVariables(BaseProcessVariables processVariables); void setMetadata(final MetaDataAttributes metaDataAttributes); void setCaseFileVariables(CaseFileVariables caseFileVariables); void setCaseIdPrefix(CaseIdPrefix caseIdPrefix); void setCaseRoles(CaseRoles roles); void setGlobalVariables(GlobalVariables globalVariables); void setDefaultImports(List<DefaultImport> imports); void setSlaDueDate(SLADueDate slaDueDate); void addLaneSet(Collection<LanePropertyWriter> lanes); Collection<ElementParameters> getSimulationParameters(); Relationship getRelationship(); Set<DataObject> getDataObjects(); } |
@Test public void caseFileVariables() { CaseFileVariables caseFileVariables = new CaseFileVariables("CFV1:Boolean,CFV2:Boolean,CFV3:Boolean"); p.setCaseFileVariables(caseFileVariables); assertThat(p.itemDefinitions.size() == 3); } | public void setCaseFileVariables(CaseFileVariables caseFileVariables) { String value = caseFileVariables.getValue(); DeclarationList declarationList = DeclarationList.fromString(value); List<Property> properties = process.getProperties(); declarationList.getDeclarations().forEach(decl -> { VariableScope.Variable variable = variableScope.declare(this.process.getId(), CaseFileVariables.CASE_FILE_PREFIX + decl.getIdentifier(), decl.getType()); properties.add(variable.getTypedIdentifier()); this.itemDefinitions.add(variable.getTypeDeclaration()); }); } | ProcessPropertyWriter extends BasePropertyWriter implements ElementContainer { public void setCaseFileVariables(CaseFileVariables caseFileVariables) { String value = caseFileVariables.getValue(); DeclarationList declarationList = DeclarationList.fromString(value); List<Property> properties = process.getProperties(); declarationList.getDeclarations().forEach(decl -> { VariableScope.Variable variable = variableScope.declare(this.process.getId(), CaseFileVariables.CASE_FILE_PREFIX + decl.getIdentifier(), decl.getType()); properties.add(variable.getTypedIdentifier()); this.itemDefinitions.add(variable.getTypeDeclaration()); }); } } | ProcessPropertyWriter extends BasePropertyWriter implements ElementContainer { public void setCaseFileVariables(CaseFileVariables caseFileVariables) { String value = caseFileVariables.getValue(); DeclarationList declarationList = DeclarationList.fromString(value); List<Property> properties = process.getProperties(); declarationList.getDeclarations().forEach(decl -> { VariableScope.Variable variable = variableScope.declare(this.process.getId(), CaseFileVariables.CASE_FILE_PREFIX + decl.getIdentifier(), decl.getType()); properties.add(variable.getTypedIdentifier()); this.itemDefinitions.add(variable.getTypeDeclaration()); }); } ProcessPropertyWriter(Process process, VariableScope variableScope, Set<DataObject> dataObjects); } | ProcessPropertyWriter extends BasePropertyWriter implements ElementContainer { public void setCaseFileVariables(CaseFileVariables caseFileVariables) { String value = caseFileVariables.getValue(); DeclarationList declarationList = DeclarationList.fromString(value); List<Property> properties = process.getProperties(); declarationList.getDeclarations().forEach(decl -> { VariableScope.Variable variable = variableScope.declare(this.process.getId(), CaseFileVariables.CASE_FILE_PREFIX + decl.getIdentifier(), decl.getType()); properties.add(variable.getTypedIdentifier()); this.itemDefinitions.add(variable.getTypeDeclaration()); }); } ProcessPropertyWriter(Process process, VariableScope variableScope, Set<DataObject> dataObjects); void setId(String value); Process getProcess(); void addChildShape(BPMNShape shape); void addChildEdge(BPMNEdge edge); BPMNDiagram getBpmnDiagram(); void addChildElement(BasePropertyWriter p); @Override Collection<BasePropertyWriter> getChildElements(); BasePropertyWriter getChildElement(String id); void setName(String value); void setExecutable(Boolean value); void setPackage(String value); void setType(String value); void setVersion(String value); void setAdHoc(Boolean adHoc); void setDescription(String value); void setProcessVariables(BaseProcessVariables processVariables); void setMetadata(final MetaDataAttributes metaDataAttributes); void setCaseFileVariables(CaseFileVariables caseFileVariables); void setCaseIdPrefix(CaseIdPrefix caseIdPrefix); void setCaseRoles(CaseRoles roles); void setGlobalVariables(GlobalVariables globalVariables); void setDefaultImports(List<DefaultImport> imports); void setSlaDueDate(SLADueDate slaDueDate); void addLaneSet(Collection<LanePropertyWriter> lanes); Collection<ElementParameters> getSimulationParameters(); Relationship getRelationship(); Set<DataObject> getDataObjects(); } | ProcessPropertyWriter extends BasePropertyWriter implements ElementContainer { public void setCaseFileVariables(CaseFileVariables caseFileVariables) { String value = caseFileVariables.getValue(); DeclarationList declarationList = DeclarationList.fromString(value); List<Property> properties = process.getProperties(); declarationList.getDeclarations().forEach(decl -> { VariableScope.Variable variable = variableScope.declare(this.process.getId(), CaseFileVariables.CASE_FILE_PREFIX + decl.getIdentifier(), decl.getType()); properties.add(variable.getTypedIdentifier()); this.itemDefinitions.add(variable.getTypeDeclaration()); }); } ProcessPropertyWriter(Process process, VariableScope variableScope, Set<DataObject> dataObjects); void setId(String value); Process getProcess(); void addChildShape(BPMNShape shape); void addChildEdge(BPMNEdge edge); BPMNDiagram getBpmnDiagram(); void addChildElement(BasePropertyWriter p); @Override Collection<BasePropertyWriter> getChildElements(); BasePropertyWriter getChildElement(String id); void setName(String value); void setExecutable(Boolean value); void setPackage(String value); void setType(String value); void setVersion(String value); void setAdHoc(Boolean adHoc); void setDescription(String value); void setProcessVariables(BaseProcessVariables processVariables); void setMetadata(final MetaDataAttributes metaDataAttributes); void setCaseFileVariables(CaseFileVariables caseFileVariables); void setCaseIdPrefix(CaseIdPrefix caseIdPrefix); void setCaseRoles(CaseRoles roles); void setGlobalVariables(GlobalVariables globalVariables); void setDefaultImports(List<DefaultImport> imports); void setSlaDueDate(SLADueDate slaDueDate); void addLaneSet(Collection<LanePropertyWriter> lanes); Collection<ElementParameters> getSimulationParameters(); Relationship getRelationship(); Set<DataObject> getDataObjects(); } |
@Test public void testSetDocumentationNotEmpty() { p.setDocumentation("DocumentationValue"); assertNotNull(p.getProcess().getDocumentation()); assertEquals(1, p.getProcess().getDocumentation().size()); assertEquals("<![CDATA[DocumentationValue]]>", p.getProcess().getDocumentation().get(0).getText()); } | public Process getProcess() { return process; } | ProcessPropertyWriter extends BasePropertyWriter implements ElementContainer { public Process getProcess() { return process; } } | ProcessPropertyWriter extends BasePropertyWriter implements ElementContainer { public Process getProcess() { return process; } ProcessPropertyWriter(Process process, VariableScope variableScope, Set<DataObject> dataObjects); } | ProcessPropertyWriter extends BasePropertyWriter implements ElementContainer { public Process getProcess() { return process; } ProcessPropertyWriter(Process process, VariableScope variableScope, Set<DataObject> dataObjects); void setId(String value); Process getProcess(); void addChildShape(BPMNShape shape); void addChildEdge(BPMNEdge edge); BPMNDiagram getBpmnDiagram(); void addChildElement(BasePropertyWriter p); @Override Collection<BasePropertyWriter> getChildElements(); BasePropertyWriter getChildElement(String id); void setName(String value); void setExecutable(Boolean value); void setPackage(String value); void setType(String value); void setVersion(String value); void setAdHoc(Boolean adHoc); void setDescription(String value); void setProcessVariables(BaseProcessVariables processVariables); void setMetadata(final MetaDataAttributes metaDataAttributes); void setCaseFileVariables(CaseFileVariables caseFileVariables); void setCaseIdPrefix(CaseIdPrefix caseIdPrefix); void setCaseRoles(CaseRoles roles); void setGlobalVariables(GlobalVariables globalVariables); void setDefaultImports(List<DefaultImport> imports); void setSlaDueDate(SLADueDate slaDueDate); void addLaneSet(Collection<LanePropertyWriter> lanes); Collection<ElementParameters> getSimulationParameters(); Relationship getRelationship(); Set<DataObject> getDataObjects(); } | ProcessPropertyWriter extends BasePropertyWriter implements ElementContainer { public Process getProcess() { return process; } ProcessPropertyWriter(Process process, VariableScope variableScope, Set<DataObject> dataObjects); void setId(String value); Process getProcess(); void addChildShape(BPMNShape shape); void addChildEdge(BPMNEdge edge); BPMNDiagram getBpmnDiagram(); void addChildElement(BasePropertyWriter p); @Override Collection<BasePropertyWriter> getChildElements(); BasePropertyWriter getChildElement(String id); void setName(String value); void setExecutable(Boolean value); void setPackage(String value); void setType(String value); void setVersion(String value); void setAdHoc(Boolean adHoc); void setDescription(String value); void setProcessVariables(BaseProcessVariables processVariables); void setMetadata(final MetaDataAttributes metaDataAttributes); void setCaseFileVariables(CaseFileVariables caseFileVariables); void setCaseIdPrefix(CaseIdPrefix caseIdPrefix); void setCaseRoles(CaseRoles roles); void setGlobalVariables(GlobalVariables globalVariables); void setDefaultImports(List<DefaultImport> imports); void setSlaDueDate(SLADueDate slaDueDate); void addLaneSet(Collection<LanePropertyWriter> lanes); Collection<ElementParameters> getSimulationParameters(); Relationship getRelationship(); Set<DataObject> getDataObjects(); } |
@Test public void testSetMetaData() { MetaDataAttributes metaDataAttributes = new MetaDataAttributes("att1ßval1Øatt2ßval2"); p.setMetadata(metaDataAttributes); String metaDataString = CustomElement.metaDataAttributes.of(p.getProcess()).get(); assertThat(metaDataString).isEqualTo("att1ß<![CDATA[val1]]>Øatt2ß<![CDATA[val2]]>"); } | public void setMetadata(final MetaDataAttributes metaDataAttributes) { if (null != metaDataAttributes.getValue() && !metaDataAttributes.getValue().isEmpty()) { CustomElement.metaDataAttributes.of(process).set(metaDataAttributes.getValue()); } } | ProcessPropertyWriter extends BasePropertyWriter implements ElementContainer { public void setMetadata(final MetaDataAttributes metaDataAttributes) { if (null != metaDataAttributes.getValue() && !metaDataAttributes.getValue().isEmpty()) { CustomElement.metaDataAttributes.of(process).set(metaDataAttributes.getValue()); } } } | ProcessPropertyWriter extends BasePropertyWriter implements ElementContainer { public void setMetadata(final MetaDataAttributes metaDataAttributes) { if (null != metaDataAttributes.getValue() && !metaDataAttributes.getValue().isEmpty()) { CustomElement.metaDataAttributes.of(process).set(metaDataAttributes.getValue()); } } ProcessPropertyWriter(Process process, VariableScope variableScope, Set<DataObject> dataObjects); } | ProcessPropertyWriter extends BasePropertyWriter implements ElementContainer { public void setMetadata(final MetaDataAttributes metaDataAttributes) { if (null != metaDataAttributes.getValue() && !metaDataAttributes.getValue().isEmpty()) { CustomElement.metaDataAttributes.of(process).set(metaDataAttributes.getValue()); } } ProcessPropertyWriter(Process process, VariableScope variableScope, Set<DataObject> dataObjects); void setId(String value); Process getProcess(); void addChildShape(BPMNShape shape); void addChildEdge(BPMNEdge edge); BPMNDiagram getBpmnDiagram(); void addChildElement(BasePropertyWriter p); @Override Collection<BasePropertyWriter> getChildElements(); BasePropertyWriter getChildElement(String id); void setName(String value); void setExecutable(Boolean value); void setPackage(String value); void setType(String value); void setVersion(String value); void setAdHoc(Boolean adHoc); void setDescription(String value); void setProcessVariables(BaseProcessVariables processVariables); void setMetadata(final MetaDataAttributes metaDataAttributes); void setCaseFileVariables(CaseFileVariables caseFileVariables); void setCaseIdPrefix(CaseIdPrefix caseIdPrefix); void setCaseRoles(CaseRoles roles); void setGlobalVariables(GlobalVariables globalVariables); void setDefaultImports(List<DefaultImport> imports); void setSlaDueDate(SLADueDate slaDueDate); void addLaneSet(Collection<LanePropertyWriter> lanes); Collection<ElementParameters> getSimulationParameters(); Relationship getRelationship(); Set<DataObject> getDataObjects(); } | ProcessPropertyWriter extends BasePropertyWriter implements ElementContainer { public void setMetadata(final MetaDataAttributes metaDataAttributes) { if (null != metaDataAttributes.getValue() && !metaDataAttributes.getValue().isEmpty()) { CustomElement.metaDataAttributes.of(process).set(metaDataAttributes.getValue()); } } ProcessPropertyWriter(Process process, VariableScope variableScope, Set<DataObject> dataObjects); void setId(String value); Process getProcess(); void addChildShape(BPMNShape shape); void addChildEdge(BPMNEdge edge); BPMNDiagram getBpmnDiagram(); void addChildElement(BasePropertyWriter p); @Override Collection<BasePropertyWriter> getChildElements(); BasePropertyWriter getChildElement(String id); void setName(String value); void setExecutable(Boolean value); void setPackage(String value); void setType(String value); void setVersion(String value); void setAdHoc(Boolean adHoc); void setDescription(String value); void setProcessVariables(BaseProcessVariables processVariables); void setMetadata(final MetaDataAttributes metaDataAttributes); void setCaseFileVariables(CaseFileVariables caseFileVariables); void setCaseIdPrefix(CaseIdPrefix caseIdPrefix); void setCaseRoles(CaseRoles roles); void setGlobalVariables(GlobalVariables globalVariables); void setDefaultImports(List<DefaultImport> imports); void setSlaDueDate(SLADueDate slaDueDate); void addLaneSet(Collection<LanePropertyWriter> lanes); Collection<ElementParameters> getSimulationParameters(); Relationship getRelationship(); Set<DataObject> getDataObjects(); } |
@Test public void JBPM_7523_shouldPreserveNameChars() { Lane lane = bpmn2.createLane(); PropertyWriterFactory writerFactory = new PropertyWriterFactory(); LanePropertyWriter w = writerFactory.of(lane); String aWeirdName = " XXX !!@@ <><> "; String aWeirdDoc = " XXX !!@@ <><> Docs "; w.setName(aWeirdName); w.setDocumentation(aWeirdDoc); assertThat(lane.getName()).isEqualTo(StringEscapeUtils.escapeXml10(aWeirdName.trim())); assertThat(CustomElement.name.of(lane).get()).isEqualTo(asCData(aWeirdName)); assertThat(lane.getDocumentation().get(0).getText()).isEqualTo(asCData(aWeirdDoc)); } | public void setName(String value) { lane.setName(StringEscapeUtils.escapeXml10(value.trim())); CustomElement.name.of(lane).set(value); } | LanePropertyWriter extends BasePropertyWriter { public void setName(String value) { lane.setName(StringEscapeUtils.escapeXml10(value.trim())); CustomElement.name.of(lane).set(value); } } | LanePropertyWriter extends BasePropertyWriter { public void setName(String value) { lane.setName(StringEscapeUtils.escapeXml10(value.trim())); CustomElement.name.of(lane).set(value); } LanePropertyWriter(Lane lane, VariableScope variableScope); } | LanePropertyWriter extends BasePropertyWriter { public void setName(String value) { lane.setName(StringEscapeUtils.escapeXml10(value.trim())); CustomElement.name.of(lane).set(value); } LanePropertyWriter(Lane lane, VariableScope variableScope); void setName(String value); @Override Lane getElement(); @Override void addChild(BasePropertyWriter child); } | LanePropertyWriter extends BasePropertyWriter { public void setName(String value) { lane.setName(StringEscapeUtils.escapeXml10(value.trim())); CustomElement.name.of(lane).set(value); } LanePropertyWriter(Lane lane, VariableScope variableScope); void setName(String value); @Override Lane getElement(); @Override void addChild(BasePropertyWriter child); } |
@Test public void testSetParentActivity() { ActivityPropertyWriter parentActivityWriter = mock(ActivityPropertyWriter.class); Activity activity = mock(Activity.class); when(parentActivityWriter.getFlowElement()).thenReturn(activity); propertyWriter.setParentActivity(parentActivityWriter); verify(element).setAttachedToRef(activity); } | public void setParentActivity(ActivityPropertyWriter parent) { event.setAttachedToRef(parent.getFlowElement()); } | BoundaryEventPropertyWriter extends CatchEventPropertyWriter { public void setParentActivity(ActivityPropertyWriter parent) { event.setAttachedToRef(parent.getFlowElement()); } } | BoundaryEventPropertyWriter extends CatchEventPropertyWriter { public void setParentActivity(ActivityPropertyWriter parent) { event.setAttachedToRef(parent.getFlowElement()); } BoundaryEventPropertyWriter(BoundaryEvent event, VariableScope variableScope, Set<DataObject> dataObjects); } | BoundaryEventPropertyWriter extends CatchEventPropertyWriter { public void setParentActivity(ActivityPropertyWriter parent) { event.setAttachedToRef(parent.getFlowElement()); } BoundaryEventPropertyWriter(BoundaryEvent event, VariableScope variableScope, Set<DataObject> dataObjects); @Override void setCancelActivity(Boolean value); void setParentActivity(ActivityPropertyWriter parent); @Override void addEventDefinition(EventDefinition eventDefinition); @Override void setAbsoluteBounds(Node<? extends View, ?> node); } | BoundaryEventPropertyWriter extends CatchEventPropertyWriter { public void setParentActivity(ActivityPropertyWriter parent) { event.setAttachedToRef(parent.getFlowElement()); } BoundaryEventPropertyWriter(BoundaryEvent event, VariableScope variableScope, Set<DataObject> dataObjects); @Override void setCancelActivity(Boolean value); void setParentActivity(ActivityPropertyWriter parent); @Override void addEventDefinition(EventDefinition eventDefinition); @Override void setAbsoluteBounds(Node<? extends View, ?> node); } |
@Test @SuppressWarnings("unchecked") public void testAddEventDefinition() { List<EventDefinition> eventDefinitions = mock(List.class); when(element.getEventDefinitions()).thenReturn(eventDefinitions); EventDefinition eventDefinition = mock(EventDefinition.class); propertyWriter.addEventDefinition(eventDefinition); verify(eventDefinitions).add(eventDefinition); } | @Override public void addEventDefinition(EventDefinition eventDefinition) { this.event.getEventDefinitions().add(eventDefinition); } | BoundaryEventPropertyWriter extends CatchEventPropertyWriter { @Override public void addEventDefinition(EventDefinition eventDefinition) { this.event.getEventDefinitions().add(eventDefinition); } } | BoundaryEventPropertyWriter extends CatchEventPropertyWriter { @Override public void addEventDefinition(EventDefinition eventDefinition) { this.event.getEventDefinitions().add(eventDefinition); } BoundaryEventPropertyWriter(BoundaryEvent event, VariableScope variableScope, Set<DataObject> dataObjects); } | BoundaryEventPropertyWriter extends CatchEventPropertyWriter { @Override public void addEventDefinition(EventDefinition eventDefinition) { this.event.getEventDefinitions().add(eventDefinition); } BoundaryEventPropertyWriter(BoundaryEvent event, VariableScope variableScope, Set<DataObject> dataObjects); @Override void setCancelActivity(Boolean value); void setParentActivity(ActivityPropertyWriter parent); @Override void addEventDefinition(EventDefinition eventDefinition); @Override void setAbsoluteBounds(Node<? extends View, ?> node); } | BoundaryEventPropertyWriter extends CatchEventPropertyWriter { @Override public void addEventDefinition(EventDefinition eventDefinition) { this.event.getEventDefinitions().add(eventDefinition); } BoundaryEventPropertyWriter(BoundaryEvent event, VariableScope variableScope, Set<DataObject> dataObjects); @Override void setCancelActivity(Boolean value); void setParentActivity(ActivityPropertyWriter parent); @Override void addEventDefinition(EventDefinition eventDefinition); @Override void setAbsoluteBounds(Node<? extends View, ?> node); } |
@Test @SuppressWarnings("unchecked") public void testSetAbsoluteBounds() { Node<View, Edge> node = (Node<View, Edge>) super.createNode(); Node<View, ?> dockSourceParentNode = mockNode(new Object(), org.kie.workbench.common.stunner.core.graph.content.Bounds.create(PARENT_ABSOLUTE_X1, PARENT_ABSOLUTE_Y1, PARENT_ABSOLUTE_X2, PARENT_ABSOLUTE_Y2)); double dockSourceRelativeX1 = 15d; double dockSourceRelativeY1 = 20d; double dockSourceRelativeX2 = 50d; double dockSourceAbsoluteY2 = 45d; Node<View, ?> dockSourceNode = mockNode(new Object(), org.kie.workbench.common.stunner.core.graph.content.Bounds.create(dockSourceRelativeX1, dockSourceRelativeY1, dockSourceRelativeX2, dockSourceAbsoluteY2), dockSourceParentNode); Edge dockEdge = mock(Edge.class); when(dockEdge.getSourceNode()).thenReturn(dockSourceNode); Dock dock = mock(Dock.class); when(dockEdge.getContent()).thenReturn(dock); node.getInEdges().clear(); node.getInEdges().add(dockEdge); propertyWriter.setAbsoluteBounds(node); Bounds shapeBounds = propertyWriter.getShape().getBounds(); org.kie.workbench.common.stunner.core.graph.content.Bounds relativeBounds = node.getContent().getBounds(); double dockSourceAbsoluteX = PARENT_ABSOLUTE_X1 + dockSourceRelativeX1; double dockSourceAbsoluteY = PARENT_ABSOLUTE_Y1 + dockSourceRelativeY1; assertEquals(dockSourceAbsoluteX + relativeBounds.getX(), shapeBounds.getX(), 0); assertEquals(dockSourceAbsoluteY + relativeBounds.getY(), shapeBounds.getY(), 0); assertEquals(relativeBounds.getWidth(), shapeBounds.getWidth(), 0); assertEquals(relativeBounds.getHeight(), shapeBounds.getHeight(), 0); verifyDockerInfoWasSet(relativeBounds); } | @Override public void setAbsoluteBounds(Node<? extends View, ?> node) { Bound ul = node.getContent().getBounds().getUpperLeft(); setDockerInfo(Point2D.create(ul.getX(), ul.getY())); Optional<Node<View, Edge>> dockSourceNode = getDockSourceNode(node); if (dockSourceNode.isPresent()) { Bounds dockSourceNodeBounds = absoluteBounds(dockSourceNode.get()); Bounds nodeBounds = node.getContent().getBounds(); double x = dockSourceNodeBounds.getX() + nodeBounds.getUpperLeft().getX(); double y = dockSourceNodeBounds.getY() + nodeBounds.getUpperLeft().getY(); super.setBounds(Bounds.create(x, y, x + nodeBounds.getWidth(), y + nodeBounds.getHeight())); } else { super.setAbsoluteBounds(node); } } | BoundaryEventPropertyWriter extends CatchEventPropertyWriter { @Override public void setAbsoluteBounds(Node<? extends View, ?> node) { Bound ul = node.getContent().getBounds().getUpperLeft(); setDockerInfo(Point2D.create(ul.getX(), ul.getY())); Optional<Node<View, Edge>> dockSourceNode = getDockSourceNode(node); if (dockSourceNode.isPresent()) { Bounds dockSourceNodeBounds = absoluteBounds(dockSourceNode.get()); Bounds nodeBounds = node.getContent().getBounds(); double x = dockSourceNodeBounds.getX() + nodeBounds.getUpperLeft().getX(); double y = dockSourceNodeBounds.getY() + nodeBounds.getUpperLeft().getY(); super.setBounds(Bounds.create(x, y, x + nodeBounds.getWidth(), y + nodeBounds.getHeight())); } else { super.setAbsoluteBounds(node); } } } | BoundaryEventPropertyWriter extends CatchEventPropertyWriter { @Override public void setAbsoluteBounds(Node<? extends View, ?> node) { Bound ul = node.getContent().getBounds().getUpperLeft(); setDockerInfo(Point2D.create(ul.getX(), ul.getY())); Optional<Node<View, Edge>> dockSourceNode = getDockSourceNode(node); if (dockSourceNode.isPresent()) { Bounds dockSourceNodeBounds = absoluteBounds(dockSourceNode.get()); Bounds nodeBounds = node.getContent().getBounds(); double x = dockSourceNodeBounds.getX() + nodeBounds.getUpperLeft().getX(); double y = dockSourceNodeBounds.getY() + nodeBounds.getUpperLeft().getY(); super.setBounds(Bounds.create(x, y, x + nodeBounds.getWidth(), y + nodeBounds.getHeight())); } else { super.setAbsoluteBounds(node); } } BoundaryEventPropertyWriter(BoundaryEvent event, VariableScope variableScope, Set<DataObject> dataObjects); } | BoundaryEventPropertyWriter extends CatchEventPropertyWriter { @Override public void setAbsoluteBounds(Node<? extends View, ?> node) { Bound ul = node.getContent().getBounds().getUpperLeft(); setDockerInfo(Point2D.create(ul.getX(), ul.getY())); Optional<Node<View, Edge>> dockSourceNode = getDockSourceNode(node); if (dockSourceNode.isPresent()) { Bounds dockSourceNodeBounds = absoluteBounds(dockSourceNode.get()); Bounds nodeBounds = node.getContent().getBounds(); double x = dockSourceNodeBounds.getX() + nodeBounds.getUpperLeft().getX(); double y = dockSourceNodeBounds.getY() + nodeBounds.getUpperLeft().getY(); super.setBounds(Bounds.create(x, y, x + nodeBounds.getWidth(), y + nodeBounds.getHeight())); } else { super.setAbsoluteBounds(node); } } BoundaryEventPropertyWriter(BoundaryEvent event, VariableScope variableScope, Set<DataObject> dataObjects); @Override void setCancelActivity(Boolean value); void setParentActivity(ActivityPropertyWriter parent); @Override void addEventDefinition(EventDefinition eventDefinition); @Override void setAbsoluteBounds(Node<? extends View, ?> node); } | BoundaryEventPropertyWriter extends CatchEventPropertyWriter { @Override public void setAbsoluteBounds(Node<? extends View, ?> node) { Bound ul = node.getContent().getBounds().getUpperLeft(); setDockerInfo(Point2D.create(ul.getX(), ul.getY())); Optional<Node<View, Edge>> dockSourceNode = getDockSourceNode(node); if (dockSourceNode.isPresent()) { Bounds dockSourceNodeBounds = absoluteBounds(dockSourceNode.get()); Bounds nodeBounds = node.getContent().getBounds(); double x = dockSourceNodeBounds.getX() + nodeBounds.getUpperLeft().getX(); double y = dockSourceNodeBounds.getY() + nodeBounds.getUpperLeft().getY(); super.setBounds(Bounds.create(x, y, x + nodeBounds.getWidth(), y + nodeBounds.getHeight())); } else { super.setAbsoluteBounds(node); } } BoundaryEventPropertyWriter(BoundaryEvent event, VariableScope variableScope, Set<DataObject> dataObjects); @Override void setCancelActivity(Boolean value); void setParentActivity(ActivityPropertyWriter parent); @Override void addEventDefinition(EventDefinition eventDefinition); @Override void setAbsoluteBounds(Node<? extends View, ?> node); } |
@Test @SuppressWarnings("unchecked") public void testSetAbsoluteBoundsWhenDockedSourceNodeIsNotPresent() { Node<View, Edge> node = (Node<View, Edge>) super.createNode(); org.kie.workbench.common.stunner.core.graph.content.Bounds relativeBounds = node.getContent().getBounds(); double absoluteX = PARENT_ABSOLUTE_X1 + relativeBounds.getUpperLeft().getX(); double absoluteY = PARENT_ABSOLUTE_Y1 + relativeBounds.getUpperLeft().getY(); propertyWriter.setAbsoluteBounds(node); Bounds shapeBounds = propertyWriter.getShape().getBounds(); assertEquals(absoluteX, shapeBounds.getX(), 0); assertEquals(absoluteY, shapeBounds.getY(), 0); assertEquals(relativeBounds.getWidth(), shapeBounds.getWidth(), 0); assertEquals(relativeBounds.getHeight(), shapeBounds.getHeight(), 0); verifyDockerInfoWasSet(relativeBounds); } | @Override public void setAbsoluteBounds(Node<? extends View, ?> node) { Bound ul = node.getContent().getBounds().getUpperLeft(); setDockerInfo(Point2D.create(ul.getX(), ul.getY())); Optional<Node<View, Edge>> dockSourceNode = getDockSourceNode(node); if (dockSourceNode.isPresent()) { Bounds dockSourceNodeBounds = absoluteBounds(dockSourceNode.get()); Bounds nodeBounds = node.getContent().getBounds(); double x = dockSourceNodeBounds.getX() + nodeBounds.getUpperLeft().getX(); double y = dockSourceNodeBounds.getY() + nodeBounds.getUpperLeft().getY(); super.setBounds(Bounds.create(x, y, x + nodeBounds.getWidth(), y + nodeBounds.getHeight())); } else { super.setAbsoluteBounds(node); } } | BoundaryEventPropertyWriter extends CatchEventPropertyWriter { @Override public void setAbsoluteBounds(Node<? extends View, ?> node) { Bound ul = node.getContent().getBounds().getUpperLeft(); setDockerInfo(Point2D.create(ul.getX(), ul.getY())); Optional<Node<View, Edge>> dockSourceNode = getDockSourceNode(node); if (dockSourceNode.isPresent()) { Bounds dockSourceNodeBounds = absoluteBounds(dockSourceNode.get()); Bounds nodeBounds = node.getContent().getBounds(); double x = dockSourceNodeBounds.getX() + nodeBounds.getUpperLeft().getX(); double y = dockSourceNodeBounds.getY() + nodeBounds.getUpperLeft().getY(); super.setBounds(Bounds.create(x, y, x + nodeBounds.getWidth(), y + nodeBounds.getHeight())); } else { super.setAbsoluteBounds(node); } } } | BoundaryEventPropertyWriter extends CatchEventPropertyWriter { @Override public void setAbsoluteBounds(Node<? extends View, ?> node) { Bound ul = node.getContent().getBounds().getUpperLeft(); setDockerInfo(Point2D.create(ul.getX(), ul.getY())); Optional<Node<View, Edge>> dockSourceNode = getDockSourceNode(node); if (dockSourceNode.isPresent()) { Bounds dockSourceNodeBounds = absoluteBounds(dockSourceNode.get()); Bounds nodeBounds = node.getContent().getBounds(); double x = dockSourceNodeBounds.getX() + nodeBounds.getUpperLeft().getX(); double y = dockSourceNodeBounds.getY() + nodeBounds.getUpperLeft().getY(); super.setBounds(Bounds.create(x, y, x + nodeBounds.getWidth(), y + nodeBounds.getHeight())); } else { super.setAbsoluteBounds(node); } } BoundaryEventPropertyWriter(BoundaryEvent event, VariableScope variableScope, Set<DataObject> dataObjects); } | BoundaryEventPropertyWriter extends CatchEventPropertyWriter { @Override public void setAbsoluteBounds(Node<? extends View, ?> node) { Bound ul = node.getContent().getBounds().getUpperLeft(); setDockerInfo(Point2D.create(ul.getX(), ul.getY())); Optional<Node<View, Edge>> dockSourceNode = getDockSourceNode(node); if (dockSourceNode.isPresent()) { Bounds dockSourceNodeBounds = absoluteBounds(dockSourceNode.get()); Bounds nodeBounds = node.getContent().getBounds(); double x = dockSourceNodeBounds.getX() + nodeBounds.getUpperLeft().getX(); double y = dockSourceNodeBounds.getY() + nodeBounds.getUpperLeft().getY(); super.setBounds(Bounds.create(x, y, x + nodeBounds.getWidth(), y + nodeBounds.getHeight())); } else { super.setAbsoluteBounds(node); } } BoundaryEventPropertyWriter(BoundaryEvent event, VariableScope variableScope, Set<DataObject> dataObjects); @Override void setCancelActivity(Boolean value); void setParentActivity(ActivityPropertyWriter parent); @Override void addEventDefinition(EventDefinition eventDefinition); @Override void setAbsoluteBounds(Node<? extends View, ?> node); } | BoundaryEventPropertyWriter extends CatchEventPropertyWriter { @Override public void setAbsoluteBounds(Node<? extends View, ?> node) { Bound ul = node.getContent().getBounds().getUpperLeft(); setDockerInfo(Point2D.create(ul.getX(), ul.getY())); Optional<Node<View, Edge>> dockSourceNode = getDockSourceNode(node); if (dockSourceNode.isPresent()) { Bounds dockSourceNodeBounds = absoluteBounds(dockSourceNode.get()); Bounds nodeBounds = node.getContent().getBounds(); double x = dockSourceNodeBounds.getX() + nodeBounds.getUpperLeft().getX(); double y = dockSourceNodeBounds.getY() + nodeBounds.getUpperLeft().getY(); super.setBounds(Bounds.create(x, y, x + nodeBounds.getWidth(), y + nodeBounds.getHeight())); } else { super.setAbsoluteBounds(node); } } BoundaryEventPropertyWriter(BoundaryEvent event, VariableScope variableScope, Set<DataObject> dataObjects); @Override void setCancelActivity(Boolean value); void setParentActivity(ActivityPropertyWriter parent); @Override void addEventDefinition(EventDefinition eventDefinition); @Override void setAbsoluteBounds(Node<? extends View, ?> node); } |
@Test public void testAddListItem() { final HTMLElement listItemElement = mock(HTMLElement.class); view.addListItem(listItemElement); verify(list).appendChild(listItemElement); } | @Override public void addListItem(final HTMLElement htmlElement) { list.appendChild(htmlElement); } | DecisionComponentsView implements DecisionComponents.View { @Override public void addListItem(final HTMLElement htmlElement) { list.appendChild(htmlElement); } } | DecisionComponentsView implements DecisionComponents.View { @Override public void addListItem(final HTMLElement htmlElement) { list.appendChild(htmlElement); } @Inject DecisionComponentsView(final HTMLSelectElement drgElementFilter,
final HTMLInputElement termFilter,
final HTMLDivElement list,
final HTMLDivElement emptyState,
final HTMLDivElement loading,
final HTMLDivElement componentsCounter,
final TranslationService translationService); } | DecisionComponentsView implements DecisionComponents.View { @Override public void addListItem(final HTMLElement htmlElement) { list.appendChild(htmlElement); } @Inject DecisionComponentsView(final HTMLSelectElement drgElementFilter,
final HTMLInputElement termFilter,
final HTMLDivElement list,
final HTMLDivElement emptyState,
final HTMLDivElement loading,
final HTMLDivElement componentsCounter,
final TranslationService translationService); @PostConstruct void init(); @Override void init(final DecisionComponents presenter); @EventHandler("term-filter") void onTermFilterChange(final KeyUpEvent e); @Override void clear(); @Override void addListItem(final HTMLElement htmlElement); @Override void showEmptyState(); @Override void showLoading(); @Override void hideLoading(); @Override void disableFilterInputs(); @Override void enableFilterInputs(); @Override void setComponentsCounter(final Integer count); } | DecisionComponentsView implements DecisionComponents.View { @Override public void addListItem(final HTMLElement htmlElement) { list.appendChild(htmlElement); } @Inject DecisionComponentsView(final HTMLSelectElement drgElementFilter,
final HTMLInputElement termFilter,
final HTMLDivElement list,
final HTMLDivElement emptyState,
final HTMLDivElement loading,
final HTMLDivElement componentsCounter,
final TranslationService translationService); @PostConstruct void init(); @Override void init(final DecisionComponents presenter); @EventHandler("term-filter") void onTermFilterChange(final KeyUpEvent e); @Override void clear(); @Override void addListItem(final HTMLElement htmlElement); @Override void showEmptyState(); @Override void showLoading(); @Override void hideLoading(); @Override void disableFilterInputs(); @Override void enableFilterInputs(); @Override void setComponentsCounter(final Integer count); } |
@Test public void testAddEmptyError() { final ArgumentCaptor<RootElement> captor = ArgumentCaptor.forClass(RootElement.class); ErrorRef errorRef = new ErrorRef(); propertyWriter.addError(errorRef); ErrorEventDefinition definition = getErrorDefinition(); assertNull(definition.getErrorRef().getErrorCode()); assertFalse(definition.getErrorRef().getId().isEmpty()); verify(propertyWriter).addRootElement(captor.capture()); Error error = (Error) captor.getValue(); assertNull(error.getErrorCode()); assertFalse(error.getId().isEmpty()); } | public void addError(ErrorRef errorRef) { Error error = bpmn2.createError(); ErrorEventDefinition errorEventDefinition = bpmn2.createErrorEventDefinition(); addEventDefinition(errorEventDefinition); String errorCode = errorRef.getValue(); String errorId; if (StringUtils.nonEmpty(errorCode)) { error.setErrorCode(errorCode); CustomAttribute.errorName.of(errorEventDefinition).set(errorCode); errorId = errorCode; } else { errorId = UUID.uuid(); } error.setId(errorId); errorEventDefinition.setErrorRef(error); addRootElement(error); } | EventPropertyWriter extends PropertyWriter { public void addError(ErrorRef errorRef) { Error error = bpmn2.createError(); ErrorEventDefinition errorEventDefinition = bpmn2.createErrorEventDefinition(); addEventDefinition(errorEventDefinition); String errorCode = errorRef.getValue(); String errorId; if (StringUtils.nonEmpty(errorCode)) { error.setErrorCode(errorCode); CustomAttribute.errorName.of(errorEventDefinition).set(errorCode); errorId = errorCode; } else { errorId = UUID.uuid(); } error.setId(errorId); errorEventDefinition.setErrorRef(error); addRootElement(error); } } | EventPropertyWriter extends PropertyWriter { public void addError(ErrorRef errorRef) { Error error = bpmn2.createError(); ErrorEventDefinition errorEventDefinition = bpmn2.createErrorEventDefinition(); addEventDefinition(errorEventDefinition); String errorCode = errorRef.getValue(); String errorId; if (StringUtils.nonEmpty(errorCode)) { error.setErrorCode(errorCode); CustomAttribute.errorName.of(errorEventDefinition).set(errorCode); errorId = errorCode; } else { errorId = UUID.uuid(); } error.setId(errorId); errorEventDefinition.setErrorRef(error); addRootElement(error); } EventPropertyWriter(Event event, VariableScope variableScope); } | EventPropertyWriter extends PropertyWriter { public void addError(ErrorRef errorRef) { Error error = bpmn2.createError(); ErrorEventDefinition errorEventDefinition = bpmn2.createErrorEventDefinition(); addEventDefinition(errorEventDefinition); String errorCode = errorRef.getValue(); String errorId; if (StringUtils.nonEmpty(errorCode)) { error.setErrorCode(errorCode); CustomAttribute.errorName.of(errorEventDefinition).set(errorCode); errorId = errorCode; } else { errorId = UUID.uuid(); } error.setId(errorId); errorEventDefinition.setErrorRef(error); addRootElement(error); } EventPropertyWriter(Event event, VariableScope variableScope); abstract void setAssignmentsInfo(AssignmentsInfo assignmentsInfo); void addMessage(MessageRef messageRef); void addSignal(SignalRef signalRef); void addLink(LinkRef linkRef); void addSignalScope(SignalScope signalScope); void addError(ErrorRef errorRef); void addTerminate(); void addTimer(TimerSettings timerSettings); void addCondition(ConditionExpression condition); void addEscalation(EscalationRef escalationRef); void addCompensation(); void addSlaDueDate(SLADueDate slaDueDate); } | EventPropertyWriter extends PropertyWriter { public void addError(ErrorRef errorRef) { Error error = bpmn2.createError(); ErrorEventDefinition errorEventDefinition = bpmn2.createErrorEventDefinition(); addEventDefinition(errorEventDefinition); String errorCode = errorRef.getValue(); String errorId; if (StringUtils.nonEmpty(errorCode)) { error.setErrorCode(errorCode); CustomAttribute.errorName.of(errorEventDefinition).set(errorCode); errorId = errorCode; } else { errorId = UUID.uuid(); } error.setId(errorId); errorEventDefinition.setErrorRef(error); addRootElement(error); } EventPropertyWriter(Event event, VariableScope variableScope); abstract void setAssignmentsInfo(AssignmentsInfo assignmentsInfo); void addMessage(MessageRef messageRef); void addSignal(SignalRef signalRef); void addLink(LinkRef linkRef); void addSignalScope(SignalScope signalScope); void addError(ErrorRef errorRef); void addTerminate(); void addTimer(TimerSettings timerSettings); void addCondition(ConditionExpression condition); void addEscalation(EscalationRef escalationRef); void addCompensation(); void addSlaDueDate(SLADueDate slaDueDate); } |
@Test public void testAddError() { final ArgumentCaptor<RootElement> captor = ArgumentCaptor.forClass(RootElement.class); ErrorRef errorRef = new ErrorRef(); errorRef.setValue(ERROR_CODE); propertyWriter.addError(errorRef); ErrorEventDefinition definition = getErrorDefinition(); assertEquals(ERROR_CODE, definition.getErrorRef().getErrorCode()); assertFalse(definition.getErrorRef().getId().isEmpty()); verify(propertyWriter).addRootElement(captor.capture()); Error error = (Error) captor.getValue(); assertEquals(ERROR_CODE, error.getErrorCode()); assertFalse(error.getId().isEmpty()); } | public void addError(ErrorRef errorRef) { Error error = bpmn2.createError(); ErrorEventDefinition errorEventDefinition = bpmn2.createErrorEventDefinition(); addEventDefinition(errorEventDefinition); String errorCode = errorRef.getValue(); String errorId; if (StringUtils.nonEmpty(errorCode)) { error.setErrorCode(errorCode); CustomAttribute.errorName.of(errorEventDefinition).set(errorCode); errorId = errorCode; } else { errorId = UUID.uuid(); } error.setId(errorId); errorEventDefinition.setErrorRef(error); addRootElement(error); } | EventPropertyWriter extends PropertyWriter { public void addError(ErrorRef errorRef) { Error error = bpmn2.createError(); ErrorEventDefinition errorEventDefinition = bpmn2.createErrorEventDefinition(); addEventDefinition(errorEventDefinition); String errorCode = errorRef.getValue(); String errorId; if (StringUtils.nonEmpty(errorCode)) { error.setErrorCode(errorCode); CustomAttribute.errorName.of(errorEventDefinition).set(errorCode); errorId = errorCode; } else { errorId = UUID.uuid(); } error.setId(errorId); errorEventDefinition.setErrorRef(error); addRootElement(error); } } | EventPropertyWriter extends PropertyWriter { public void addError(ErrorRef errorRef) { Error error = bpmn2.createError(); ErrorEventDefinition errorEventDefinition = bpmn2.createErrorEventDefinition(); addEventDefinition(errorEventDefinition); String errorCode = errorRef.getValue(); String errorId; if (StringUtils.nonEmpty(errorCode)) { error.setErrorCode(errorCode); CustomAttribute.errorName.of(errorEventDefinition).set(errorCode); errorId = errorCode; } else { errorId = UUID.uuid(); } error.setId(errorId); errorEventDefinition.setErrorRef(error); addRootElement(error); } EventPropertyWriter(Event event, VariableScope variableScope); } | EventPropertyWriter extends PropertyWriter { public void addError(ErrorRef errorRef) { Error error = bpmn2.createError(); ErrorEventDefinition errorEventDefinition = bpmn2.createErrorEventDefinition(); addEventDefinition(errorEventDefinition); String errorCode = errorRef.getValue(); String errorId; if (StringUtils.nonEmpty(errorCode)) { error.setErrorCode(errorCode); CustomAttribute.errorName.of(errorEventDefinition).set(errorCode); errorId = errorCode; } else { errorId = UUID.uuid(); } error.setId(errorId); errorEventDefinition.setErrorRef(error); addRootElement(error); } EventPropertyWriter(Event event, VariableScope variableScope); abstract void setAssignmentsInfo(AssignmentsInfo assignmentsInfo); void addMessage(MessageRef messageRef); void addSignal(SignalRef signalRef); void addLink(LinkRef linkRef); void addSignalScope(SignalScope signalScope); void addError(ErrorRef errorRef); void addTerminate(); void addTimer(TimerSettings timerSettings); void addCondition(ConditionExpression condition); void addEscalation(EscalationRef escalationRef); void addCompensation(); void addSlaDueDate(SLADueDate slaDueDate); } | EventPropertyWriter extends PropertyWriter { public void addError(ErrorRef errorRef) { Error error = bpmn2.createError(); ErrorEventDefinition errorEventDefinition = bpmn2.createErrorEventDefinition(); addEventDefinition(errorEventDefinition); String errorCode = errorRef.getValue(); String errorId; if (StringUtils.nonEmpty(errorCode)) { error.setErrorCode(errorCode); CustomAttribute.errorName.of(errorEventDefinition).set(errorCode); errorId = errorCode; } else { errorId = UUID.uuid(); } error.setId(errorId); errorEventDefinition.setErrorRef(error); addRootElement(error); } EventPropertyWriter(Event event, VariableScope variableScope); abstract void setAssignmentsInfo(AssignmentsInfo assignmentsInfo); void addMessage(MessageRef messageRef); void addSignal(SignalRef signalRef); void addLink(LinkRef linkRef); void addSignalScope(SignalScope signalScope); void addError(ErrorRef errorRef); void addTerminate(); void addTimer(TimerSettings timerSettings); void addCondition(ConditionExpression condition); void addEscalation(EscalationRef escalationRef); void addCompensation(); void addSlaDueDate(SLADueDate slaDueDate); } |
@Test public void addChildElement() { SubProcess process = (SubProcess) propertyWriter.getElement(); List<FlowElement> flowElements = new ArrayList<>(); when(process.getFlowElements()).thenReturn(flowElements); BoundaryEventPropertyWriter boundaryEventPropertyWriter = new BoundaryEventPropertyWriter(bpmn2.createBoundaryEvent(), variableScope, new HashSet<>()); UserTaskPropertyWriter userTaskPropertyWriter = new UserTaskPropertyWriter(bpmn2.createUserTask(), variableScope, new HashSet<>()); propertyWriter.addChildElement(boundaryEventPropertyWriter); propertyWriter.addChildElement(userTaskPropertyWriter); assertThat(process.getFlowElements().get(0)).isEqualTo(userTaskPropertyWriter.getFlowElement()); assertThat(process.getFlowElements().get(1)).isEqualTo(boundaryEventPropertyWriter.getFlowElement()); } | public void addChildElement(BasePropertyWriter p) { p.setParent(this); Processes.addChildElement( p, childElements, process, simulationParameters, itemDefinitions, rootElements); } | SubProcessPropertyWriter extends MultipleInstanceActivityPropertyWriter implements ElementContainer { public void addChildElement(BasePropertyWriter p) { p.setParent(this); Processes.addChildElement( p, childElements, process, simulationParameters, itemDefinitions, rootElements); } } | SubProcessPropertyWriter extends MultipleInstanceActivityPropertyWriter implements ElementContainer { public void addChildElement(BasePropertyWriter p) { p.setParent(this); Processes.addChildElement( p, childElements, process, simulationParameters, itemDefinitions, rootElements); } SubProcessPropertyWriter(SubProcess process, VariableScope variableScope, Set<DataObject> dataObjects); } | SubProcessPropertyWriter extends MultipleInstanceActivityPropertyWriter implements ElementContainer { public void addChildElement(BasePropertyWriter p) { p.setParent(this); Processes.addChildElement( p, childElements, process, simulationParameters, itemDefinitions, rootElements); } SubProcessPropertyWriter(SubProcess process, VariableScope variableScope, Set<DataObject> dataObjects); void addChildElement(BasePropertyWriter p); @Override Collection<BasePropertyWriter> getChildElements(); BasePropertyWriter getChildElement(String id); @Override void addChildEdge(BPMNEdge edge); void setDescription(String value); void setSimulationSet(SimulationSet simulations); void setProcessVariables(BaseProcessVariables processVariables); void addLaneSet(Collection<LanePropertyWriter> lanes); void setOnEntryAction(OnEntryAction onEntryAction); void setOnExitAction(OnExitAction onExitAction); void setAsync(Boolean isAsync); void setSlaDueDate(SLADueDate slaDueDate); @Override void setAbsoluteBounds(Node<? extends View, ?> node); } | SubProcessPropertyWriter extends MultipleInstanceActivityPropertyWriter implements ElementContainer { public void addChildElement(BasePropertyWriter p) { p.setParent(this); Processes.addChildElement( p, childElements, process, simulationParameters, itemDefinitions, rootElements); } SubProcessPropertyWriter(SubProcess process, VariableScope variableScope, Set<DataObject> dataObjects); void addChildElement(BasePropertyWriter p); @Override Collection<BasePropertyWriter> getChildElements(); BasePropertyWriter getChildElement(String id); @Override void addChildEdge(BPMNEdge edge); void setDescription(String value); void setSimulationSet(SimulationSet simulations); void setProcessVariables(BaseProcessVariables processVariables); void addLaneSet(Collection<LanePropertyWriter> lanes); void setOnEntryAction(OnEntryAction onEntryAction); void setOnExitAction(OnExitAction onExitAction); void setAsync(Boolean isAsync); void setSlaDueDate(SLADueDate slaDueDate); @Override void setAbsoluteBounds(Node<? extends View, ?> node); } |
@Test public void testSetDefaultRoute() { testSetDefaultRoute("defaultRoute", "defaultRoute"); } | public void setDefaultRoute(String defaultRouteExpression) { if (defaultRouteExpression == null) { return; } CustomAttribute.dg.of(gateway).set(defaultRouteExpression); String[] split = defaultRouteExpression.split(" : "); this.defaultGatewayId = (split.length == 1) ? split[0] : split[1]; } | GatewayPropertyWriter extends PropertyWriter { public void setDefaultRoute(String defaultRouteExpression) { if (defaultRouteExpression == null) { return; } CustomAttribute.dg.of(gateway).set(defaultRouteExpression); String[] split = defaultRouteExpression.split(" : "); this.defaultGatewayId = (split.length == 1) ? split[0] : split[1]; } } | GatewayPropertyWriter extends PropertyWriter { public void setDefaultRoute(String defaultRouteExpression) { if (defaultRouteExpression == null) { return; } CustomAttribute.dg.of(gateway).set(defaultRouteExpression); String[] split = defaultRouteExpression.split(" : "); this.defaultGatewayId = (split.length == 1) ? split[0] : split[1]; } GatewayPropertyWriter(Gateway gateway, VariableScope variableScope); } | GatewayPropertyWriter extends PropertyWriter { public void setDefaultRoute(String defaultRouteExpression) { if (defaultRouteExpression == null) { return; } CustomAttribute.dg.of(gateway).set(defaultRouteExpression); String[] split = defaultRouteExpression.split(" : "); this.defaultGatewayId = (split.length == 1) ? split[0] : split[1]; } GatewayPropertyWriter(Gateway gateway, VariableScope variableScope); void setDefaultRoute(String defaultRouteExpression); void setSource(BasePropertyWriter source); void setTarget(BasePropertyWriter target); void setGatewayDirection(Node n); void setGatewayDirection(GatewayDirection direction); } | GatewayPropertyWriter extends PropertyWriter { public void setDefaultRoute(String defaultRouteExpression) { if (defaultRouteExpression == null) { return; } CustomAttribute.dg.of(gateway).set(defaultRouteExpression); String[] split = defaultRouteExpression.split(" : "); this.defaultGatewayId = (split.length == 1) ? split[0] : split[1]; } GatewayPropertyWriter(Gateway gateway, VariableScope variableScope); void setDefaultRoute(String defaultRouteExpression); void setSource(BasePropertyWriter source); void setTarget(BasePropertyWriter target); void setGatewayDirection(Node n); void setGatewayDirection(GatewayDirection direction); } |
@Test public void testSetDefaultRouteNull() { propertyWriter.setDefaultRoute(null); verify(featureMap, never()).add(any()); } | public void setDefaultRoute(String defaultRouteExpression) { if (defaultRouteExpression == null) { return; } CustomAttribute.dg.of(gateway).set(defaultRouteExpression); String[] split = defaultRouteExpression.split(" : "); this.defaultGatewayId = (split.length == 1) ? split[0] : split[1]; } | GatewayPropertyWriter extends PropertyWriter { public void setDefaultRoute(String defaultRouteExpression) { if (defaultRouteExpression == null) { return; } CustomAttribute.dg.of(gateway).set(defaultRouteExpression); String[] split = defaultRouteExpression.split(" : "); this.defaultGatewayId = (split.length == 1) ? split[0] : split[1]; } } | GatewayPropertyWriter extends PropertyWriter { public void setDefaultRoute(String defaultRouteExpression) { if (defaultRouteExpression == null) { return; } CustomAttribute.dg.of(gateway).set(defaultRouteExpression); String[] split = defaultRouteExpression.split(" : "); this.defaultGatewayId = (split.length == 1) ? split[0] : split[1]; } GatewayPropertyWriter(Gateway gateway, VariableScope variableScope); } | GatewayPropertyWriter extends PropertyWriter { public void setDefaultRoute(String defaultRouteExpression) { if (defaultRouteExpression == null) { return; } CustomAttribute.dg.of(gateway).set(defaultRouteExpression); String[] split = defaultRouteExpression.split(" : "); this.defaultGatewayId = (split.length == 1) ? split[0] : split[1]; } GatewayPropertyWriter(Gateway gateway, VariableScope variableScope); void setDefaultRoute(String defaultRouteExpression); void setSource(BasePropertyWriter source); void setTarget(BasePropertyWriter target); void setGatewayDirection(Node n); void setGatewayDirection(GatewayDirection direction); } | GatewayPropertyWriter extends PropertyWriter { public void setDefaultRoute(String defaultRouteExpression) { if (defaultRouteExpression == null) { return; } CustomAttribute.dg.of(gateway).set(defaultRouteExpression); String[] split = defaultRouteExpression.split(" : "); this.defaultGatewayId = (split.length == 1) ? split[0] : split[1]; } GatewayPropertyWriter(Gateway gateway, VariableScope variableScope); void setDefaultRoute(String defaultRouteExpression); void setSource(BasePropertyWriter source); void setTarget(BasePropertyWriter target); void setGatewayDirection(Node n); void setGatewayDirection(GatewayDirection direction); } |
@Test public void testSetSourceForExclusiveGateway() { ExclusiveGateway exclusiveGateway = mockGateway(ExclusiveGateway.class, ID); prepareTestSetSourceOrTarget(exclusiveGateway); propertyWriter.setSource(anotherPropertyWriter); verify(exclusiveGateway).setDefault(sequenceFlow); } | public void setSource(BasePropertyWriter source) { setDefaultGateway(source); } | GatewayPropertyWriter extends PropertyWriter { public void setSource(BasePropertyWriter source) { setDefaultGateway(source); } } | GatewayPropertyWriter extends PropertyWriter { public void setSource(BasePropertyWriter source) { setDefaultGateway(source); } GatewayPropertyWriter(Gateway gateway, VariableScope variableScope); } | GatewayPropertyWriter extends PropertyWriter { public void setSource(BasePropertyWriter source) { setDefaultGateway(source); } GatewayPropertyWriter(Gateway gateway, VariableScope variableScope); void setDefaultRoute(String defaultRouteExpression); void setSource(BasePropertyWriter source); void setTarget(BasePropertyWriter target); void setGatewayDirection(Node n); void setGatewayDirection(GatewayDirection direction); } | GatewayPropertyWriter extends PropertyWriter { public void setSource(BasePropertyWriter source) { setDefaultGateway(source); } GatewayPropertyWriter(Gateway gateway, VariableScope variableScope); void setDefaultRoute(String defaultRouteExpression); void setSource(BasePropertyWriter source); void setTarget(BasePropertyWriter target); void setGatewayDirection(Node n); void setGatewayDirection(GatewayDirection direction); } |
@Test public void testSetSourceForInclusiveGateway() { InclusiveGateway inclusiveGateway = mockGateway(InclusiveGateway.class, ID); prepareTestSetSourceOrTarget(inclusiveGateway); propertyWriter.setSource(anotherPropertyWriter); verify(inclusiveGateway).setDefault(sequenceFlow); } | public void setSource(BasePropertyWriter source) { setDefaultGateway(source); } | GatewayPropertyWriter extends PropertyWriter { public void setSource(BasePropertyWriter source) { setDefaultGateway(source); } } | GatewayPropertyWriter extends PropertyWriter { public void setSource(BasePropertyWriter source) { setDefaultGateway(source); } GatewayPropertyWriter(Gateway gateway, VariableScope variableScope); } | GatewayPropertyWriter extends PropertyWriter { public void setSource(BasePropertyWriter source) { setDefaultGateway(source); } GatewayPropertyWriter(Gateway gateway, VariableScope variableScope); void setDefaultRoute(String defaultRouteExpression); void setSource(BasePropertyWriter source); void setTarget(BasePropertyWriter target); void setGatewayDirection(Node n); void setGatewayDirection(GatewayDirection direction); } | GatewayPropertyWriter extends PropertyWriter { public void setSource(BasePropertyWriter source) { setDefaultGateway(source); } GatewayPropertyWriter(Gateway gateway, VariableScope variableScope); void setDefaultRoute(String defaultRouteExpression); void setSource(BasePropertyWriter source); void setTarget(BasePropertyWriter target); void setGatewayDirection(Node n); void setGatewayDirection(GatewayDirection direction); } |
@Test public void testSetTargetForExclusiveGateway() { ExclusiveGateway exclusiveGateway = mockGateway(ExclusiveGateway.class, ID); prepareTestSetSourceOrTarget(exclusiveGateway); propertyWriter.setTarget(anotherPropertyWriter); verify(exclusiveGateway).setDefault(sequenceFlow); } | public void setTarget(BasePropertyWriter target) { setDefaultGateway(target); } | GatewayPropertyWriter extends PropertyWriter { public void setTarget(BasePropertyWriter target) { setDefaultGateway(target); } } | GatewayPropertyWriter extends PropertyWriter { public void setTarget(BasePropertyWriter target) { setDefaultGateway(target); } GatewayPropertyWriter(Gateway gateway, VariableScope variableScope); } | GatewayPropertyWriter extends PropertyWriter { public void setTarget(BasePropertyWriter target) { setDefaultGateway(target); } GatewayPropertyWriter(Gateway gateway, VariableScope variableScope); void setDefaultRoute(String defaultRouteExpression); void setSource(BasePropertyWriter source); void setTarget(BasePropertyWriter target); void setGatewayDirection(Node n); void setGatewayDirection(GatewayDirection direction); } | GatewayPropertyWriter extends PropertyWriter { public void setTarget(BasePropertyWriter target) { setDefaultGateway(target); } GatewayPropertyWriter(Gateway gateway, VariableScope variableScope); void setDefaultRoute(String defaultRouteExpression); void setSource(BasePropertyWriter source); void setTarget(BasePropertyWriter target); void setGatewayDirection(Node n); void setGatewayDirection(GatewayDirection direction); } |
@Test public void testSetTargetForInclusiveGateway() { InclusiveGateway inclusiveGateway = mockGateway(InclusiveGateway.class, ID); prepareTestSetSourceOrTarget(inclusiveGateway); propertyWriter.setTarget(anotherPropertyWriter); verify(inclusiveGateway).setDefault(sequenceFlow); } | public void setTarget(BasePropertyWriter target) { setDefaultGateway(target); } | GatewayPropertyWriter extends PropertyWriter { public void setTarget(BasePropertyWriter target) { setDefaultGateway(target); } } | GatewayPropertyWriter extends PropertyWriter { public void setTarget(BasePropertyWriter target) { setDefaultGateway(target); } GatewayPropertyWriter(Gateway gateway, VariableScope variableScope); } | GatewayPropertyWriter extends PropertyWriter { public void setTarget(BasePropertyWriter target) { setDefaultGateway(target); } GatewayPropertyWriter(Gateway gateway, VariableScope variableScope); void setDefaultRoute(String defaultRouteExpression); void setSource(BasePropertyWriter source); void setTarget(BasePropertyWriter target); void setGatewayDirection(Node n); void setGatewayDirection(GatewayDirection direction); } | GatewayPropertyWriter extends PropertyWriter { public void setTarget(BasePropertyWriter target) { setDefaultGateway(target); } GatewayPropertyWriter(Gateway gateway, VariableScope variableScope); void setDefaultRoute(String defaultRouteExpression); void setSource(BasePropertyWriter source); void setTarget(BasePropertyWriter target); void setGatewayDirection(Node n); void setGatewayDirection(GatewayDirection direction); } |
@Test public void testSetGatewayDirectionWithDivergingNode() { Node node = mockNode(1, 2); propertyWriter.setGatewayDirection(node); verify(element).setGatewayDirection(GatewayDirection.DIVERGING); } | public void setGatewayDirection(Node n) { long incoming = countEdges(n.getInEdges()); long outgoing = countEdges(n.getOutEdges()); if (incoming <= 1 && outgoing > 1) { gateway.setGatewayDirection(GatewayDirection.DIVERGING); } else if (incoming > 1 && outgoing <= 1) { gateway.setGatewayDirection(GatewayDirection.CONVERGING); } else { gateway.setGatewayDirection(GatewayDirection.UNSPECIFIED); } } | GatewayPropertyWriter extends PropertyWriter { public void setGatewayDirection(Node n) { long incoming = countEdges(n.getInEdges()); long outgoing = countEdges(n.getOutEdges()); if (incoming <= 1 && outgoing > 1) { gateway.setGatewayDirection(GatewayDirection.DIVERGING); } else if (incoming > 1 && outgoing <= 1) { gateway.setGatewayDirection(GatewayDirection.CONVERGING); } else { gateway.setGatewayDirection(GatewayDirection.UNSPECIFIED); } } } | GatewayPropertyWriter extends PropertyWriter { public void setGatewayDirection(Node n) { long incoming = countEdges(n.getInEdges()); long outgoing = countEdges(n.getOutEdges()); if (incoming <= 1 && outgoing > 1) { gateway.setGatewayDirection(GatewayDirection.DIVERGING); } else if (incoming > 1 && outgoing <= 1) { gateway.setGatewayDirection(GatewayDirection.CONVERGING); } else { gateway.setGatewayDirection(GatewayDirection.UNSPECIFIED); } } GatewayPropertyWriter(Gateway gateway, VariableScope variableScope); } | GatewayPropertyWriter extends PropertyWriter { public void setGatewayDirection(Node n) { long incoming = countEdges(n.getInEdges()); long outgoing = countEdges(n.getOutEdges()); if (incoming <= 1 && outgoing > 1) { gateway.setGatewayDirection(GatewayDirection.DIVERGING); } else if (incoming > 1 && outgoing <= 1) { gateway.setGatewayDirection(GatewayDirection.CONVERGING); } else { gateway.setGatewayDirection(GatewayDirection.UNSPECIFIED); } } GatewayPropertyWriter(Gateway gateway, VariableScope variableScope); void setDefaultRoute(String defaultRouteExpression); void setSource(BasePropertyWriter source); void setTarget(BasePropertyWriter target); void setGatewayDirection(Node n); void setGatewayDirection(GatewayDirection direction); } | GatewayPropertyWriter extends PropertyWriter { public void setGatewayDirection(Node n) { long incoming = countEdges(n.getInEdges()); long outgoing = countEdges(n.getOutEdges()); if (incoming <= 1 && outgoing > 1) { gateway.setGatewayDirection(GatewayDirection.DIVERGING); } else if (incoming > 1 && outgoing <= 1) { gateway.setGatewayDirection(GatewayDirection.CONVERGING); } else { gateway.setGatewayDirection(GatewayDirection.UNSPECIFIED); } } GatewayPropertyWriter(Gateway gateway, VariableScope variableScope); void setDefaultRoute(String defaultRouteExpression); void setSource(BasePropertyWriter source); void setTarget(BasePropertyWriter target); void setGatewayDirection(Node n); void setGatewayDirection(GatewayDirection direction); } |
@Test public void testShowEmptyState() { emptyState.classList = mock(DOMTokenList.class); view.showEmptyState(); verify(emptyState.classList).remove(HIDDEN_CSS_CLASS); } | @Override public void showEmptyState() { show(emptyState); } | DecisionComponentsView implements DecisionComponents.View { @Override public void showEmptyState() { show(emptyState); } } | DecisionComponentsView implements DecisionComponents.View { @Override public void showEmptyState() { show(emptyState); } @Inject DecisionComponentsView(final HTMLSelectElement drgElementFilter,
final HTMLInputElement termFilter,
final HTMLDivElement list,
final HTMLDivElement emptyState,
final HTMLDivElement loading,
final HTMLDivElement componentsCounter,
final TranslationService translationService); } | DecisionComponentsView implements DecisionComponents.View { @Override public void showEmptyState() { show(emptyState); } @Inject DecisionComponentsView(final HTMLSelectElement drgElementFilter,
final HTMLInputElement termFilter,
final HTMLDivElement list,
final HTMLDivElement emptyState,
final HTMLDivElement loading,
final HTMLDivElement componentsCounter,
final TranslationService translationService); @PostConstruct void init(); @Override void init(final DecisionComponents presenter); @EventHandler("term-filter") void onTermFilterChange(final KeyUpEvent e); @Override void clear(); @Override void addListItem(final HTMLElement htmlElement); @Override void showEmptyState(); @Override void showLoading(); @Override void hideLoading(); @Override void disableFilterInputs(); @Override void enableFilterInputs(); @Override void setComponentsCounter(final Integer count); } | DecisionComponentsView implements DecisionComponents.View { @Override public void showEmptyState() { show(emptyState); } @Inject DecisionComponentsView(final HTMLSelectElement drgElementFilter,
final HTMLInputElement termFilter,
final HTMLDivElement list,
final HTMLDivElement emptyState,
final HTMLDivElement loading,
final HTMLDivElement componentsCounter,
final TranslationService translationService); @PostConstruct void init(); @Override void init(final DecisionComponents presenter); @EventHandler("term-filter") void onTermFilterChange(final KeyUpEvent e); @Override void clear(); @Override void addListItem(final HTMLElement htmlElement); @Override void showEmptyState(); @Override void showLoading(); @Override void hideLoading(); @Override void disableFilterInputs(); @Override void enableFilterInputs(); @Override void setComponentsCounter(final Integer count); } |
@Test public void testSetGatewayDirectionWithConvergingNode() { Node node = mockNode(2, 1); propertyWriter.setGatewayDirection(node); verify(element).setGatewayDirection(GatewayDirection.CONVERGING); } | public void setGatewayDirection(Node n) { long incoming = countEdges(n.getInEdges()); long outgoing = countEdges(n.getOutEdges()); if (incoming <= 1 && outgoing > 1) { gateway.setGatewayDirection(GatewayDirection.DIVERGING); } else if (incoming > 1 && outgoing <= 1) { gateway.setGatewayDirection(GatewayDirection.CONVERGING); } else { gateway.setGatewayDirection(GatewayDirection.UNSPECIFIED); } } | GatewayPropertyWriter extends PropertyWriter { public void setGatewayDirection(Node n) { long incoming = countEdges(n.getInEdges()); long outgoing = countEdges(n.getOutEdges()); if (incoming <= 1 && outgoing > 1) { gateway.setGatewayDirection(GatewayDirection.DIVERGING); } else if (incoming > 1 && outgoing <= 1) { gateway.setGatewayDirection(GatewayDirection.CONVERGING); } else { gateway.setGatewayDirection(GatewayDirection.UNSPECIFIED); } } } | GatewayPropertyWriter extends PropertyWriter { public void setGatewayDirection(Node n) { long incoming = countEdges(n.getInEdges()); long outgoing = countEdges(n.getOutEdges()); if (incoming <= 1 && outgoing > 1) { gateway.setGatewayDirection(GatewayDirection.DIVERGING); } else if (incoming > 1 && outgoing <= 1) { gateway.setGatewayDirection(GatewayDirection.CONVERGING); } else { gateway.setGatewayDirection(GatewayDirection.UNSPECIFIED); } } GatewayPropertyWriter(Gateway gateway, VariableScope variableScope); } | GatewayPropertyWriter extends PropertyWriter { public void setGatewayDirection(Node n) { long incoming = countEdges(n.getInEdges()); long outgoing = countEdges(n.getOutEdges()); if (incoming <= 1 && outgoing > 1) { gateway.setGatewayDirection(GatewayDirection.DIVERGING); } else if (incoming > 1 && outgoing <= 1) { gateway.setGatewayDirection(GatewayDirection.CONVERGING); } else { gateway.setGatewayDirection(GatewayDirection.UNSPECIFIED); } } GatewayPropertyWriter(Gateway gateway, VariableScope variableScope); void setDefaultRoute(String defaultRouteExpression); void setSource(BasePropertyWriter source); void setTarget(BasePropertyWriter target); void setGatewayDirection(Node n); void setGatewayDirection(GatewayDirection direction); } | GatewayPropertyWriter extends PropertyWriter { public void setGatewayDirection(Node n) { long incoming = countEdges(n.getInEdges()); long outgoing = countEdges(n.getOutEdges()); if (incoming <= 1 && outgoing > 1) { gateway.setGatewayDirection(GatewayDirection.DIVERGING); } else if (incoming > 1 && outgoing <= 1) { gateway.setGatewayDirection(GatewayDirection.CONVERGING); } else { gateway.setGatewayDirection(GatewayDirection.UNSPECIFIED); } } GatewayPropertyWriter(Gateway gateway, VariableScope variableScope); void setDefaultRoute(String defaultRouteExpression); void setSource(BasePropertyWriter source); void setTarget(BasePropertyWriter target); void setGatewayDirection(Node n); void setGatewayDirection(GatewayDirection direction); } |
@Test public void testSetGatewayDirectionWithNotConfiguredNode() { Node node = mockNode(0, 0); propertyWriter.setGatewayDirection(node); verify(element).setGatewayDirection(GatewayDirection.UNSPECIFIED); } | public void setGatewayDirection(Node n) { long incoming = countEdges(n.getInEdges()); long outgoing = countEdges(n.getOutEdges()); if (incoming <= 1 && outgoing > 1) { gateway.setGatewayDirection(GatewayDirection.DIVERGING); } else if (incoming > 1 && outgoing <= 1) { gateway.setGatewayDirection(GatewayDirection.CONVERGING); } else { gateway.setGatewayDirection(GatewayDirection.UNSPECIFIED); } } | GatewayPropertyWriter extends PropertyWriter { public void setGatewayDirection(Node n) { long incoming = countEdges(n.getInEdges()); long outgoing = countEdges(n.getOutEdges()); if (incoming <= 1 && outgoing > 1) { gateway.setGatewayDirection(GatewayDirection.DIVERGING); } else if (incoming > 1 && outgoing <= 1) { gateway.setGatewayDirection(GatewayDirection.CONVERGING); } else { gateway.setGatewayDirection(GatewayDirection.UNSPECIFIED); } } } | GatewayPropertyWriter extends PropertyWriter { public void setGatewayDirection(Node n) { long incoming = countEdges(n.getInEdges()); long outgoing = countEdges(n.getOutEdges()); if (incoming <= 1 && outgoing > 1) { gateway.setGatewayDirection(GatewayDirection.DIVERGING); } else if (incoming > 1 && outgoing <= 1) { gateway.setGatewayDirection(GatewayDirection.CONVERGING); } else { gateway.setGatewayDirection(GatewayDirection.UNSPECIFIED); } } GatewayPropertyWriter(Gateway gateway, VariableScope variableScope); } | GatewayPropertyWriter extends PropertyWriter { public void setGatewayDirection(Node n) { long incoming = countEdges(n.getInEdges()); long outgoing = countEdges(n.getOutEdges()); if (incoming <= 1 && outgoing > 1) { gateway.setGatewayDirection(GatewayDirection.DIVERGING); } else if (incoming > 1 && outgoing <= 1) { gateway.setGatewayDirection(GatewayDirection.CONVERGING); } else { gateway.setGatewayDirection(GatewayDirection.UNSPECIFIED); } } GatewayPropertyWriter(Gateway gateway, VariableScope variableScope); void setDefaultRoute(String defaultRouteExpression); void setSource(BasePropertyWriter source); void setTarget(BasePropertyWriter target); void setGatewayDirection(Node n); void setGatewayDirection(GatewayDirection direction); } | GatewayPropertyWriter extends PropertyWriter { public void setGatewayDirection(Node n) { long incoming = countEdges(n.getInEdges()); long outgoing = countEdges(n.getOutEdges()); if (incoming <= 1 && outgoing > 1) { gateway.setGatewayDirection(GatewayDirection.DIVERGING); } else if (incoming > 1 && outgoing <= 1) { gateway.setGatewayDirection(GatewayDirection.CONVERGING); } else { gateway.setGatewayDirection(GatewayDirection.UNSPECIFIED); } } GatewayPropertyWriter(Gateway gateway, VariableScope variableScope); void setDefaultRoute(String defaultRouteExpression); void setSource(BasePropertyWriter source); void setTarget(BasePropertyWriter target); void setGatewayDirection(Node n); void setGatewayDirection(GatewayDirection direction); } |
@Test public void testSetGatewayDirection() { GatewayDirection randomDirection = GatewayDirection.CONVERGING; propertyWriter.setGatewayDirection(randomDirection); verify(element).setGatewayDirection(randomDirection); } | public void setGatewayDirection(Node n) { long incoming = countEdges(n.getInEdges()); long outgoing = countEdges(n.getOutEdges()); if (incoming <= 1 && outgoing > 1) { gateway.setGatewayDirection(GatewayDirection.DIVERGING); } else if (incoming > 1 && outgoing <= 1) { gateway.setGatewayDirection(GatewayDirection.CONVERGING); } else { gateway.setGatewayDirection(GatewayDirection.UNSPECIFIED); } } | GatewayPropertyWriter extends PropertyWriter { public void setGatewayDirection(Node n) { long incoming = countEdges(n.getInEdges()); long outgoing = countEdges(n.getOutEdges()); if (incoming <= 1 && outgoing > 1) { gateway.setGatewayDirection(GatewayDirection.DIVERGING); } else if (incoming > 1 && outgoing <= 1) { gateway.setGatewayDirection(GatewayDirection.CONVERGING); } else { gateway.setGatewayDirection(GatewayDirection.UNSPECIFIED); } } } | GatewayPropertyWriter extends PropertyWriter { public void setGatewayDirection(Node n) { long incoming = countEdges(n.getInEdges()); long outgoing = countEdges(n.getOutEdges()); if (incoming <= 1 && outgoing > 1) { gateway.setGatewayDirection(GatewayDirection.DIVERGING); } else if (incoming > 1 && outgoing <= 1) { gateway.setGatewayDirection(GatewayDirection.CONVERGING); } else { gateway.setGatewayDirection(GatewayDirection.UNSPECIFIED); } } GatewayPropertyWriter(Gateway gateway, VariableScope variableScope); } | GatewayPropertyWriter extends PropertyWriter { public void setGatewayDirection(Node n) { long incoming = countEdges(n.getInEdges()); long outgoing = countEdges(n.getOutEdges()); if (incoming <= 1 && outgoing > 1) { gateway.setGatewayDirection(GatewayDirection.DIVERGING); } else if (incoming > 1 && outgoing <= 1) { gateway.setGatewayDirection(GatewayDirection.CONVERGING); } else { gateway.setGatewayDirection(GatewayDirection.UNSPECIFIED); } } GatewayPropertyWriter(Gateway gateway, VariableScope variableScope); void setDefaultRoute(String defaultRouteExpression); void setSource(BasePropertyWriter source); void setTarget(BasePropertyWriter target); void setGatewayDirection(Node n); void setGatewayDirection(GatewayDirection direction); } | GatewayPropertyWriter extends PropertyWriter { public void setGatewayDirection(Node n) { long incoming = countEdges(n.getInEdges()); long outgoing = countEdges(n.getOutEdges()); if (incoming <= 1 && outgoing > 1) { gateway.setGatewayDirection(GatewayDirection.DIVERGING); } else if (incoming > 1 && outgoing <= 1) { gateway.setGatewayDirection(GatewayDirection.CONVERGING); } else { gateway.setGatewayDirection(GatewayDirection.UNSPECIFIED); } } GatewayPropertyWriter(Gateway gateway, VariableScope variableScope); void setDefaultRoute(String defaultRouteExpression); void setSource(BasePropertyWriter source); void setTarget(BasePropertyWriter target); void setGatewayDirection(Node n); void setGatewayDirection(GatewayDirection direction); } |
@Test public void startsFromUnderscore() { UserTask userTask = bpmn2.createUserTask(); UserTaskPropertyWriter userTaskPropertyWriter = new UserTaskPropertyWriter(userTask, variableScope, new HashSet<>()); Actors actor = new Actors(); actor.setValue("startsFromUnderscore"); userTaskPropertyWriter.setActors(actor); assertEquals("startsFromUnderscore", getActors(userTask).get(0).a); assertTrue(getActors(userTask).get(0).b.startsWith("_")); } | public void setActors(Actors actors) { for (String actor : fromActorString(actors.getValue())) { PotentialOwner potentialOwner = bpmn2.createPotentialOwner(); potentialOwner.setId("_"+UUID.randomUUID().toString()); FormalExpression formalExpression = bpmn2.createFormalExpression(); formalExpression.setBody(actor); ResourceAssignmentExpression resourceAssignmentExpression = bpmn2.createResourceAssignmentExpression(); resourceAssignmentExpression.setExpression(formalExpression); potentialOwner.setResourceAssignmentExpression(resourceAssignmentExpression); task.getResources().add(potentialOwner); } } | UserTaskPropertyWriter extends MultipleInstanceActivityPropertyWriter { public void setActors(Actors actors) { for (String actor : fromActorString(actors.getValue())) { PotentialOwner potentialOwner = bpmn2.createPotentialOwner(); potentialOwner.setId("_"+UUID.randomUUID().toString()); FormalExpression formalExpression = bpmn2.createFormalExpression(); formalExpression.setBody(actor); ResourceAssignmentExpression resourceAssignmentExpression = bpmn2.createResourceAssignmentExpression(); resourceAssignmentExpression.setExpression(formalExpression); potentialOwner.setResourceAssignmentExpression(resourceAssignmentExpression); task.getResources().add(potentialOwner); } } } | UserTaskPropertyWriter extends MultipleInstanceActivityPropertyWriter { public void setActors(Actors actors) { for (String actor : fromActorString(actors.getValue())) { PotentialOwner potentialOwner = bpmn2.createPotentialOwner(); potentialOwner.setId("_"+UUID.randomUUID().toString()); FormalExpression formalExpression = bpmn2.createFormalExpression(); formalExpression.setBody(actor); ResourceAssignmentExpression resourceAssignmentExpression = bpmn2.createResourceAssignmentExpression(); resourceAssignmentExpression.setExpression(formalExpression); potentialOwner.setResourceAssignmentExpression(resourceAssignmentExpression); task.getResources().add(potentialOwner); } } UserTaskPropertyWriter(UserTask task, VariableScope variableScope, Set<DataObject> dataObjects); } | UserTaskPropertyWriter extends MultipleInstanceActivityPropertyWriter { public void setActors(Actors actors) { for (String actor : fromActorString(actors.getValue())) { PotentialOwner potentialOwner = bpmn2.createPotentialOwner(); potentialOwner.setId("_"+UUID.randomUUID().toString()); FormalExpression formalExpression = bpmn2.createFormalExpression(); formalExpression.setBody(actor); ResourceAssignmentExpression resourceAssignmentExpression = bpmn2.createResourceAssignmentExpression(); resourceAssignmentExpression.setExpression(formalExpression); potentialOwner.setResourceAssignmentExpression(resourceAssignmentExpression); task.getResources().add(potentialOwner); } } UserTaskPropertyWriter(UserTask task, VariableScope variableScope, Set<DataObject> dataObjects); void setAsync(boolean async); void setSkippable(boolean skippable); void setPriority(String priority); void setSubject(String subject); void setDescription(String description); void setCreatedBy(String createdBy); void setAdHocAutostart(boolean autoStart); void setTaskName(String taskName); void setActors(Actors actors); void setReassignments(ReassignmentsInfo reassignments); void setGroupId(String value); void setOnEntryAction(OnEntryAction onEntryAction); void setOnExitAction(OnExitAction onExitAction); void setContent(String content); void setSLADueDate(String slaDueDate); void setNotifications(NotificationsInfo notificationsInfo); } | UserTaskPropertyWriter extends MultipleInstanceActivityPropertyWriter { public void setActors(Actors actors) { for (String actor : fromActorString(actors.getValue())) { PotentialOwner potentialOwner = bpmn2.createPotentialOwner(); potentialOwner.setId("_"+UUID.randomUUID().toString()); FormalExpression formalExpression = bpmn2.createFormalExpression(); formalExpression.setBody(actor); ResourceAssignmentExpression resourceAssignmentExpression = bpmn2.createResourceAssignmentExpression(); resourceAssignmentExpression.setExpression(formalExpression); potentialOwner.setResourceAssignmentExpression(resourceAssignmentExpression); task.getResources().add(potentialOwner); } } UserTaskPropertyWriter(UserTask task, VariableScope variableScope, Set<DataObject> dataObjects); void setAsync(boolean async); void setSkippable(boolean skippable); void setPriority(String priority); void setSubject(String subject); void setDescription(String description); void setCreatedBy(String createdBy); void setAdHocAutostart(boolean autoStart); void setTaskName(String taskName); void setActors(Actors actors); void setReassignments(ReassignmentsInfo reassignments); void setGroupId(String value); void setOnEntryAction(OnEntryAction onEntryAction); void setOnExitAction(OnExitAction onExitAction); void setContent(String content); void setSLADueDate(String slaDueDate); void setNotifications(NotificationsInfo notificationsInfo); } |
@Test public void setName() { tested.setName(NAME); verify(element).setText(NAME); verify(element).setName(NAME); verify(valueMap).add(entryArgumentCaptor.capture()); final MetaDataTypeImpl value = (MetaDataTypeImpl) entryArgumentCaptor.getValue().getValue(); assertEquals(NAME, CustomElement.name.stripCData(value.getMetaValue())); } | public void setName(String value) { final String escaped = StringEscapeUtils.escapeXml10(value.trim()); element.setText(escaped); element.setName(escaped); CustomElement.name.of(element).set(value); } | TextAnnotationPropertyWriter extends PropertyWriter { public void setName(String value) { final String escaped = StringEscapeUtils.escapeXml10(value.trim()); element.setText(escaped); element.setName(escaped); CustomElement.name.of(element).set(value); } } | TextAnnotationPropertyWriter extends PropertyWriter { public void setName(String value) { final String escaped = StringEscapeUtils.escapeXml10(value.trim()); element.setText(escaped); element.setName(escaped); CustomElement.name.of(element).set(value); } TextAnnotationPropertyWriter(TextAnnotation element, VariableScope variableScope); } | TextAnnotationPropertyWriter extends PropertyWriter { public void setName(String value) { final String escaped = StringEscapeUtils.escapeXml10(value.trim()); element.setText(escaped); element.setName(escaped); CustomElement.name.of(element).set(value); } TextAnnotationPropertyWriter(TextAnnotation element, VariableScope variableScope); void setName(String value); @Override TextAnnotation getElement(); } | TextAnnotationPropertyWriter extends PropertyWriter { public void setName(String value) { final String escaped = StringEscapeUtils.escapeXml10(value.trim()); element.setText(escaped); element.setName(escaped); CustomElement.name.of(element).set(value); } TextAnnotationPropertyWriter(TextAnnotation element, VariableScope variableScope); void setName(String value); @Override TextAnnotation getElement(); } |
@Test public void getElement() { assertEquals(element, tested.getElement()); } | @Override public TextAnnotation getElement() { return (TextAnnotation) super.getElement(); } | TextAnnotationPropertyWriter extends PropertyWriter { @Override public TextAnnotation getElement() { return (TextAnnotation) super.getElement(); } } | TextAnnotationPropertyWriter extends PropertyWriter { @Override public TextAnnotation getElement() { return (TextAnnotation) super.getElement(); } TextAnnotationPropertyWriter(TextAnnotation element, VariableScope variableScope); } | TextAnnotationPropertyWriter extends PropertyWriter { @Override public TextAnnotation getElement() { return (TextAnnotation) super.getElement(); } TextAnnotationPropertyWriter(TextAnnotation element, VariableScope variableScope); void setName(String value); @Override TextAnnotation getElement(); } | TextAnnotationPropertyWriter extends PropertyWriter { @Override public TextAnnotation getElement() { return (TextAnnotation) super.getElement(); } TextAnnotationPropertyWriter(TextAnnotation element, VariableScope variableScope); void setName(String value); @Override TextAnnotation getElement(); } |
@Test public void testSetAdHocAutostart_true() throws Exception { tested.setAdHocAutostart(Boolean.TRUE); assertTrue(CustomElement.autoStart.of(tested.getFlowElement()).get()); } | public void setAdHocAutostart(boolean autoStart) { CustomElement.autoStart.of(flowElement).set(autoStart); } | AdHocSubProcessPropertyWriter extends SubProcessPropertyWriter { public void setAdHocAutostart(boolean autoStart) { CustomElement.autoStart.of(flowElement).set(autoStart); } } | AdHocSubProcessPropertyWriter extends SubProcessPropertyWriter { public void setAdHocAutostart(boolean autoStart) { CustomElement.autoStart.of(flowElement).set(autoStart); } AdHocSubProcessPropertyWriter(AdHocSubProcess process, VariableScope variableScope, Set<DataObject> dataObjects); } | AdHocSubProcessPropertyWriter extends SubProcessPropertyWriter { public void setAdHocAutostart(boolean autoStart) { CustomElement.autoStart.of(flowElement).set(autoStart); } AdHocSubProcessPropertyWriter(AdHocSubProcess process, VariableScope variableScope, Set<DataObject> dataObjects); void setAdHocActivationCondition(BaseAdHocActivationCondition adHocActivationCondition); void setAdHocOrdering(org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocOrdering value); void setAdHocCompletionCondition(BaseAdHocCompletionCondition adHocCompletionCondition); void setAdHocAutostart(boolean autoStart); } | AdHocSubProcessPropertyWriter extends SubProcessPropertyWriter { public void setAdHocAutostart(boolean autoStart) { CustomElement.autoStart.of(flowElement).set(autoStart); } AdHocSubProcessPropertyWriter(AdHocSubProcess process, VariableScope variableScope, Set<DataObject> dataObjects); void setAdHocActivationCondition(BaseAdHocActivationCondition adHocActivationCondition); void setAdHocOrdering(org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocOrdering value); void setAdHocCompletionCondition(BaseAdHocCompletionCondition adHocCompletionCondition); void setAdHocAutostart(boolean autoStart); } |
@Test public void testSetAdHocAutostart_false() throws Exception { tested.setAdHocAutostart(Boolean.FALSE); assertFalse(CustomElement.autoStart.of(tested.getFlowElement()).get()); } | public void setAdHocAutostart(boolean autoStart) { CustomElement.autoStart.of(flowElement).set(autoStart); } | AdHocSubProcessPropertyWriter extends SubProcessPropertyWriter { public void setAdHocAutostart(boolean autoStart) { CustomElement.autoStart.of(flowElement).set(autoStart); } } | AdHocSubProcessPropertyWriter extends SubProcessPropertyWriter { public void setAdHocAutostart(boolean autoStart) { CustomElement.autoStart.of(flowElement).set(autoStart); } AdHocSubProcessPropertyWriter(AdHocSubProcess process, VariableScope variableScope, Set<DataObject> dataObjects); } | AdHocSubProcessPropertyWriter extends SubProcessPropertyWriter { public void setAdHocAutostart(boolean autoStart) { CustomElement.autoStart.of(flowElement).set(autoStart); } AdHocSubProcessPropertyWriter(AdHocSubProcess process, VariableScope variableScope, Set<DataObject> dataObjects); void setAdHocActivationCondition(BaseAdHocActivationCondition adHocActivationCondition); void setAdHocOrdering(org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocOrdering value); void setAdHocCompletionCondition(BaseAdHocCompletionCondition adHocCompletionCondition); void setAdHocAutostart(boolean autoStart); } | AdHocSubProcessPropertyWriter extends SubProcessPropertyWriter { public void setAdHocAutostart(boolean autoStart) { CustomElement.autoStart.of(flowElement).set(autoStart); } AdHocSubProcessPropertyWriter(AdHocSubProcess process, VariableScope variableScope, Set<DataObject> dataObjects); void setAdHocActivationCondition(BaseAdHocActivationCondition adHocActivationCondition); void setAdHocOrdering(org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocOrdering value); void setAdHocCompletionCondition(BaseAdHocCompletionCondition adHocCompletionCondition); void setAdHocAutostart(boolean autoStart); } |
@Test public void testSetAdHocActivationCondition() { tested.setAdHocActivationCondition(new AdHocActivationCondition("condition expression")); assertEquals(asCData("condition expression"), CustomElement.customActivationCondition.of(tested.getFlowElement()).get()); } | public void setAdHocActivationCondition(BaseAdHocActivationCondition adHocActivationCondition) { if (StringUtils.nonEmpty(adHocActivationCondition.getValue())) { CustomElement.customActivationCondition.of(flowElement).set(adHocActivationCondition.getValue()); } } | AdHocSubProcessPropertyWriter extends SubProcessPropertyWriter { public void setAdHocActivationCondition(BaseAdHocActivationCondition adHocActivationCondition) { if (StringUtils.nonEmpty(adHocActivationCondition.getValue())) { CustomElement.customActivationCondition.of(flowElement).set(adHocActivationCondition.getValue()); } } } | AdHocSubProcessPropertyWriter extends SubProcessPropertyWriter { public void setAdHocActivationCondition(BaseAdHocActivationCondition adHocActivationCondition) { if (StringUtils.nonEmpty(adHocActivationCondition.getValue())) { CustomElement.customActivationCondition.of(flowElement).set(adHocActivationCondition.getValue()); } } AdHocSubProcessPropertyWriter(AdHocSubProcess process, VariableScope variableScope, Set<DataObject> dataObjects); } | AdHocSubProcessPropertyWriter extends SubProcessPropertyWriter { public void setAdHocActivationCondition(BaseAdHocActivationCondition adHocActivationCondition) { if (StringUtils.nonEmpty(adHocActivationCondition.getValue())) { CustomElement.customActivationCondition.of(flowElement).set(adHocActivationCondition.getValue()); } } AdHocSubProcessPropertyWriter(AdHocSubProcess process, VariableScope variableScope, Set<DataObject> dataObjects); void setAdHocActivationCondition(BaseAdHocActivationCondition adHocActivationCondition); void setAdHocOrdering(org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocOrdering value); void setAdHocCompletionCondition(BaseAdHocCompletionCondition adHocCompletionCondition); void setAdHocAutostart(boolean autoStart); } | AdHocSubProcessPropertyWriter extends SubProcessPropertyWriter { public void setAdHocActivationCondition(BaseAdHocActivationCondition adHocActivationCondition) { if (StringUtils.nonEmpty(adHocActivationCondition.getValue())) { CustomElement.customActivationCondition.of(flowElement).set(adHocActivationCondition.getValue()); } } AdHocSubProcessPropertyWriter(AdHocSubProcess process, VariableScope variableScope, Set<DataObject> dataObjects); void setAdHocActivationCondition(BaseAdHocActivationCondition adHocActivationCondition); void setAdHocOrdering(org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocOrdering value); void setAdHocCompletionCondition(BaseAdHocCompletionCondition adHocCompletionCondition); void setAdHocAutostart(boolean autoStart); } |
@Test public void testSetAdHocActivationConditionNull() { tested.setAdHocActivationCondition(new AdHocActivationCondition(null)); assertEquals("", CustomElement.customActivationCondition.of(tested.getFlowElement()).get()); } | public void setAdHocActivationCondition(BaseAdHocActivationCondition adHocActivationCondition) { if (StringUtils.nonEmpty(adHocActivationCondition.getValue())) { CustomElement.customActivationCondition.of(flowElement).set(adHocActivationCondition.getValue()); } } | AdHocSubProcessPropertyWriter extends SubProcessPropertyWriter { public void setAdHocActivationCondition(BaseAdHocActivationCondition adHocActivationCondition) { if (StringUtils.nonEmpty(adHocActivationCondition.getValue())) { CustomElement.customActivationCondition.of(flowElement).set(adHocActivationCondition.getValue()); } } } | AdHocSubProcessPropertyWriter extends SubProcessPropertyWriter { public void setAdHocActivationCondition(BaseAdHocActivationCondition adHocActivationCondition) { if (StringUtils.nonEmpty(adHocActivationCondition.getValue())) { CustomElement.customActivationCondition.of(flowElement).set(adHocActivationCondition.getValue()); } } AdHocSubProcessPropertyWriter(AdHocSubProcess process, VariableScope variableScope, Set<DataObject> dataObjects); } | AdHocSubProcessPropertyWriter extends SubProcessPropertyWriter { public void setAdHocActivationCondition(BaseAdHocActivationCondition adHocActivationCondition) { if (StringUtils.nonEmpty(adHocActivationCondition.getValue())) { CustomElement.customActivationCondition.of(flowElement).set(adHocActivationCondition.getValue()); } } AdHocSubProcessPropertyWriter(AdHocSubProcess process, VariableScope variableScope, Set<DataObject> dataObjects); void setAdHocActivationCondition(BaseAdHocActivationCondition adHocActivationCondition); void setAdHocOrdering(org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocOrdering value); void setAdHocCompletionCondition(BaseAdHocCompletionCondition adHocCompletionCondition); void setAdHocAutostart(boolean autoStart); } | AdHocSubProcessPropertyWriter extends SubProcessPropertyWriter { public void setAdHocActivationCondition(BaseAdHocActivationCondition adHocActivationCondition) { if (StringUtils.nonEmpty(adHocActivationCondition.getValue())) { CustomElement.customActivationCondition.of(flowElement).set(adHocActivationCondition.getValue()); } } AdHocSubProcessPropertyWriter(AdHocSubProcess process, VariableScope variableScope, Set<DataObject> dataObjects); void setAdHocActivationCondition(BaseAdHocActivationCondition adHocActivationCondition); void setAdHocOrdering(org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocOrdering value); void setAdHocCompletionCondition(BaseAdHocCompletionCondition adHocCompletionCondition); void setAdHocAutostart(boolean autoStart); } |
@Test public void testShowLoading() { loading.classList = mock(DOMTokenList.class); view.showLoading(); verify(loading.classList).remove(HIDDEN_CSS_CLASS); } | @Override public void showLoading() { show(loading); } | DecisionComponentsView implements DecisionComponents.View { @Override public void showLoading() { show(loading); } } | DecisionComponentsView implements DecisionComponents.View { @Override public void showLoading() { show(loading); } @Inject DecisionComponentsView(final HTMLSelectElement drgElementFilter,
final HTMLInputElement termFilter,
final HTMLDivElement list,
final HTMLDivElement emptyState,
final HTMLDivElement loading,
final HTMLDivElement componentsCounter,
final TranslationService translationService); } | DecisionComponentsView implements DecisionComponents.View { @Override public void showLoading() { show(loading); } @Inject DecisionComponentsView(final HTMLSelectElement drgElementFilter,
final HTMLInputElement termFilter,
final HTMLDivElement list,
final HTMLDivElement emptyState,
final HTMLDivElement loading,
final HTMLDivElement componentsCounter,
final TranslationService translationService); @PostConstruct void init(); @Override void init(final DecisionComponents presenter); @EventHandler("term-filter") void onTermFilterChange(final KeyUpEvent e); @Override void clear(); @Override void addListItem(final HTMLElement htmlElement); @Override void showEmptyState(); @Override void showLoading(); @Override void hideLoading(); @Override void disableFilterInputs(); @Override void enableFilterInputs(); @Override void setComponentsCounter(final Integer count); } | DecisionComponentsView implements DecisionComponents.View { @Override public void showLoading() { show(loading); } @Inject DecisionComponentsView(final HTMLSelectElement drgElementFilter,
final HTMLInputElement termFilter,
final HTMLDivElement list,
final HTMLDivElement emptyState,
final HTMLDivElement loading,
final HTMLDivElement componentsCounter,
final TranslationService translationService); @PostConstruct void init(); @Override void init(final DecisionComponents presenter); @EventHandler("term-filter") void onTermFilterChange(final KeyUpEvent e); @Override void clear(); @Override void addListItem(final HTMLElement htmlElement); @Override void showEmptyState(); @Override void showLoading(); @Override void hideLoading(); @Override void disableFilterInputs(); @Override void enableFilterInputs(); @Override void setComponentsCounter(final Integer count); } |
@Test public void testSetAdHocActivationConditionEmpty() { tested.setAdHocActivationCondition(new AdHocActivationCondition("")); assertEquals("", CustomElement.customActivationCondition.of(tested.getFlowElement()).get()); } | public void setAdHocActivationCondition(BaseAdHocActivationCondition adHocActivationCondition) { if (StringUtils.nonEmpty(adHocActivationCondition.getValue())) { CustomElement.customActivationCondition.of(flowElement).set(adHocActivationCondition.getValue()); } } | AdHocSubProcessPropertyWriter extends SubProcessPropertyWriter { public void setAdHocActivationCondition(BaseAdHocActivationCondition adHocActivationCondition) { if (StringUtils.nonEmpty(adHocActivationCondition.getValue())) { CustomElement.customActivationCondition.of(flowElement).set(adHocActivationCondition.getValue()); } } } | AdHocSubProcessPropertyWriter extends SubProcessPropertyWriter { public void setAdHocActivationCondition(BaseAdHocActivationCondition adHocActivationCondition) { if (StringUtils.nonEmpty(adHocActivationCondition.getValue())) { CustomElement.customActivationCondition.of(flowElement).set(adHocActivationCondition.getValue()); } } AdHocSubProcessPropertyWriter(AdHocSubProcess process, VariableScope variableScope, Set<DataObject> dataObjects); } | AdHocSubProcessPropertyWriter extends SubProcessPropertyWriter { public void setAdHocActivationCondition(BaseAdHocActivationCondition adHocActivationCondition) { if (StringUtils.nonEmpty(adHocActivationCondition.getValue())) { CustomElement.customActivationCondition.of(flowElement).set(adHocActivationCondition.getValue()); } } AdHocSubProcessPropertyWriter(AdHocSubProcess process, VariableScope variableScope, Set<DataObject> dataObjects); void setAdHocActivationCondition(BaseAdHocActivationCondition adHocActivationCondition); void setAdHocOrdering(org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocOrdering value); void setAdHocCompletionCondition(BaseAdHocCompletionCondition adHocCompletionCondition); void setAdHocAutostart(boolean autoStart); } | AdHocSubProcessPropertyWriter extends SubProcessPropertyWriter { public void setAdHocActivationCondition(BaseAdHocActivationCondition adHocActivationCondition) { if (StringUtils.nonEmpty(adHocActivationCondition.getValue())) { CustomElement.customActivationCondition.of(flowElement).set(adHocActivationCondition.getValue()); } } AdHocSubProcessPropertyWriter(AdHocSubProcess process, VariableScope variableScope, Set<DataObject> dataObjects); void setAdHocActivationCondition(BaseAdHocActivationCondition adHocActivationCondition); void setAdHocOrdering(org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocOrdering value); void setAdHocCompletionCondition(BaseAdHocCompletionCondition adHocCompletionCondition); void setAdHocAutostart(boolean autoStart); } |
@Test public void testSetAdHocOrderingSequential() { tested.setAdHocOrdering(new AdHocOrdering("Sequential")); assertEquals(org.eclipse.bpmn2.AdHocOrdering.SEQUENTIAL, ((AdHocSubProcess) tested.getFlowElement()).getOrdering()); } | public void setAdHocOrdering(org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocOrdering value) { process.setOrdering(AdHocOrdering.getByName(value.getValue())); } | AdHocSubProcessPropertyWriter extends SubProcessPropertyWriter { public void setAdHocOrdering(org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocOrdering value) { process.setOrdering(AdHocOrdering.getByName(value.getValue())); } } | AdHocSubProcessPropertyWriter extends SubProcessPropertyWriter { public void setAdHocOrdering(org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocOrdering value) { process.setOrdering(AdHocOrdering.getByName(value.getValue())); } AdHocSubProcessPropertyWriter(AdHocSubProcess process, VariableScope variableScope, Set<DataObject> dataObjects); } | AdHocSubProcessPropertyWriter extends SubProcessPropertyWriter { public void setAdHocOrdering(org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocOrdering value) { process.setOrdering(AdHocOrdering.getByName(value.getValue())); } AdHocSubProcessPropertyWriter(AdHocSubProcess process, VariableScope variableScope, Set<DataObject> dataObjects); void setAdHocActivationCondition(BaseAdHocActivationCondition adHocActivationCondition); void setAdHocOrdering(org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocOrdering value); void setAdHocCompletionCondition(BaseAdHocCompletionCondition adHocCompletionCondition); void setAdHocAutostart(boolean autoStart); } | AdHocSubProcessPropertyWriter extends SubProcessPropertyWriter { public void setAdHocOrdering(org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocOrdering value) { process.setOrdering(AdHocOrdering.getByName(value.getValue())); } AdHocSubProcessPropertyWriter(AdHocSubProcess process, VariableScope variableScope, Set<DataObject> dataObjects); void setAdHocActivationCondition(BaseAdHocActivationCondition adHocActivationCondition); void setAdHocOrdering(org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocOrdering value); void setAdHocCompletionCondition(BaseAdHocCompletionCondition adHocCompletionCondition); void setAdHocAutostart(boolean autoStart); } |
@Test public void testSetAdHocOrderingParallel() { tested.setAdHocOrdering(new AdHocOrdering("Parallel")); assertEquals(org.eclipse.bpmn2.AdHocOrdering.PARALLEL, ((AdHocSubProcess) tested.getFlowElement()).getOrdering()); } | public void setAdHocOrdering(org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocOrdering value) { process.setOrdering(AdHocOrdering.getByName(value.getValue())); } | AdHocSubProcessPropertyWriter extends SubProcessPropertyWriter { public void setAdHocOrdering(org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocOrdering value) { process.setOrdering(AdHocOrdering.getByName(value.getValue())); } } | AdHocSubProcessPropertyWriter extends SubProcessPropertyWriter { public void setAdHocOrdering(org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocOrdering value) { process.setOrdering(AdHocOrdering.getByName(value.getValue())); } AdHocSubProcessPropertyWriter(AdHocSubProcess process, VariableScope variableScope, Set<DataObject> dataObjects); } | AdHocSubProcessPropertyWriter extends SubProcessPropertyWriter { public void setAdHocOrdering(org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocOrdering value) { process.setOrdering(AdHocOrdering.getByName(value.getValue())); } AdHocSubProcessPropertyWriter(AdHocSubProcess process, VariableScope variableScope, Set<DataObject> dataObjects); void setAdHocActivationCondition(BaseAdHocActivationCondition adHocActivationCondition); void setAdHocOrdering(org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocOrdering value); void setAdHocCompletionCondition(BaseAdHocCompletionCondition adHocCompletionCondition); void setAdHocAutostart(boolean autoStart); } | AdHocSubProcessPropertyWriter extends SubProcessPropertyWriter { public void setAdHocOrdering(org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocOrdering value) { process.setOrdering(AdHocOrdering.getByName(value.getValue())); } AdHocSubProcessPropertyWriter(AdHocSubProcess process, VariableScope variableScope, Set<DataObject> dataObjects); void setAdHocActivationCondition(BaseAdHocActivationCondition adHocActivationCondition); void setAdHocOrdering(org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocOrdering value); void setAdHocCompletionCondition(BaseAdHocCompletionCondition adHocCompletionCondition); void setAdHocAutostart(boolean autoStart); } |
@Test public void testSetAdHocCompletionCondition() { AdHocCompletionCondition condition = new AdHocCompletionCondition(new ScriptTypeValue("java", "some code")); tested.setAdHocCompletionCondition(condition); FormalExpression expression = (FormalExpression) ((AdHocSubProcess) tested.getFlowElement()).getCompletionCondition(); assertEquals(condition.getValue().getLanguage(), Scripts.scriptLanguageFromUri(expression.getLanguage())); assertEquals(asCData(condition.getValue().getScript()), expression.getBody()); } | public void setAdHocCompletionCondition(BaseAdHocCompletionCondition adHocCompletionCondition) { FormalExpression e = bpmn2.createFormalExpression(); ScriptTypeValue s = adHocCompletionCondition.getValue(); e.setLanguage(scriptLanguageToUri(s.getLanguage())); e.setBody(asCData(s.getScript())); process.setCompletionCondition(e); } | AdHocSubProcessPropertyWriter extends SubProcessPropertyWriter { public void setAdHocCompletionCondition(BaseAdHocCompletionCondition adHocCompletionCondition) { FormalExpression e = bpmn2.createFormalExpression(); ScriptTypeValue s = adHocCompletionCondition.getValue(); e.setLanguage(scriptLanguageToUri(s.getLanguage())); e.setBody(asCData(s.getScript())); process.setCompletionCondition(e); } } | AdHocSubProcessPropertyWriter extends SubProcessPropertyWriter { public void setAdHocCompletionCondition(BaseAdHocCompletionCondition adHocCompletionCondition) { FormalExpression e = bpmn2.createFormalExpression(); ScriptTypeValue s = adHocCompletionCondition.getValue(); e.setLanguage(scriptLanguageToUri(s.getLanguage())); e.setBody(asCData(s.getScript())); process.setCompletionCondition(e); } AdHocSubProcessPropertyWriter(AdHocSubProcess process, VariableScope variableScope, Set<DataObject> dataObjects); } | AdHocSubProcessPropertyWriter extends SubProcessPropertyWriter { public void setAdHocCompletionCondition(BaseAdHocCompletionCondition adHocCompletionCondition) { FormalExpression e = bpmn2.createFormalExpression(); ScriptTypeValue s = adHocCompletionCondition.getValue(); e.setLanguage(scriptLanguageToUri(s.getLanguage())); e.setBody(asCData(s.getScript())); process.setCompletionCondition(e); } AdHocSubProcessPropertyWriter(AdHocSubProcess process, VariableScope variableScope, Set<DataObject> dataObjects); void setAdHocActivationCondition(BaseAdHocActivationCondition adHocActivationCondition); void setAdHocOrdering(org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocOrdering value); void setAdHocCompletionCondition(BaseAdHocCompletionCondition adHocCompletionCondition); void setAdHocAutostart(boolean autoStart); } | AdHocSubProcessPropertyWriter extends SubProcessPropertyWriter { public void setAdHocCompletionCondition(BaseAdHocCompletionCondition adHocCompletionCondition) { FormalExpression e = bpmn2.createFormalExpression(); ScriptTypeValue s = adHocCompletionCondition.getValue(); e.setLanguage(scriptLanguageToUri(s.getLanguage())); e.setBody(asCData(s.getScript())); process.setCompletionCondition(e); } AdHocSubProcessPropertyWriter(AdHocSubProcess process, VariableScope variableScope, Set<DataObject> dataObjects); void setAdHocActivationCondition(BaseAdHocActivationCondition adHocActivationCondition); void setAdHocOrdering(org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocOrdering value); void setAdHocCompletionCondition(BaseAdHocCompletionCondition adHocCompletionCondition); void setAdHocAutostart(boolean autoStart); } |
@Test public void testInclusive() { InclusiveGateway gateway = new InclusiveGateway(); gateway.getGeneral().getName().setValue(NAME); gateway.getGeneral().getDocumentation().setValue(DOCUMENTATION); gateway.getExecutionSet().getDefaultRoute().setValue(DEFAULT_ROUTE); Node<View<BaseGateway>, ?> node = newNode(UUID, gateway); when(propertyWriterFactory.of(any(org.eclipse.bpmn2.InclusiveGateway.class))).thenReturn(gatewayPropertyWriter); assertEquals(gatewayPropertyWriter, converter.toFlowElement(node)); verifyCommonValues(gatewayPropertyWriter, node); verify(gatewayPropertyWriter).setDefaultRoute(DEFAULT_ROUTE); verify(gatewayPropertyWriter).setGatewayDirection(node); } | private PropertyWriter inclusive(Node<View<InclusiveGateway>, ?> n) { GatewayPropertyWriter p = propertyWriterFactory.of(bpmn2.createInclusiveGateway()); p.setId(n.getUUID()); InclusiveGateway definition = n.getContent().getDefinition(); p.setGatewayDirection(n); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); GatewayExecutionSet executionSet = definition.getExecutionSet(); p.setDefaultRoute(executionSet.getDefaultRoute().getValue()); p.setAbsoluteBounds(n); return p; } | GatewayConverter { private PropertyWriter inclusive(Node<View<InclusiveGateway>, ?> n) { GatewayPropertyWriter p = propertyWriterFactory.of(bpmn2.createInclusiveGateway()); p.setId(n.getUUID()); InclusiveGateway definition = n.getContent().getDefinition(); p.setGatewayDirection(n); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); GatewayExecutionSet executionSet = definition.getExecutionSet(); p.setDefaultRoute(executionSet.getDefaultRoute().getValue()); p.setAbsoluteBounds(n); return p; } } | GatewayConverter { private PropertyWriter inclusive(Node<View<InclusiveGateway>, ?> n) { GatewayPropertyWriter p = propertyWriterFactory.of(bpmn2.createInclusiveGateway()); p.setId(n.getUUID()); InclusiveGateway definition = n.getContent().getDefinition(); p.setGatewayDirection(n); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); GatewayExecutionSet executionSet = definition.getExecutionSet(); p.setDefaultRoute(executionSet.getDefaultRoute().getValue()); p.setAbsoluteBounds(n); return p; } GatewayConverter(PropertyWriterFactory propertyWriterFactory); } | GatewayConverter { private PropertyWriter inclusive(Node<View<InclusiveGateway>, ?> n) { GatewayPropertyWriter p = propertyWriterFactory.of(bpmn2.createInclusiveGateway()); p.setId(n.getUUID()); InclusiveGateway definition = n.getContent().getDefinition(); p.setGatewayDirection(n); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); GatewayExecutionSet executionSet = definition.getExecutionSet(); p.setDefaultRoute(executionSet.getDefaultRoute().getValue()); p.setAbsoluteBounds(n); return p; } GatewayConverter(PropertyWriterFactory propertyWriterFactory); PropertyWriter toFlowElement(Node<View<BaseGateway>, ?> node); } | GatewayConverter { private PropertyWriter inclusive(Node<View<InclusiveGateway>, ?> n) { GatewayPropertyWriter p = propertyWriterFactory.of(bpmn2.createInclusiveGateway()); p.setId(n.getUUID()); InclusiveGateway definition = n.getContent().getDefinition(); p.setGatewayDirection(n); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); GatewayExecutionSet executionSet = definition.getExecutionSet(); p.setDefaultRoute(executionSet.getDefaultRoute().getValue()); p.setAbsoluteBounds(n); return p; } GatewayConverter(PropertyWriterFactory propertyWriterFactory); PropertyWriter toFlowElement(Node<View<BaseGateway>, ?> node); } |
@Test public void testExclusive() { ExclusiveGateway gateway = new ExclusiveGateway(); gateway.getGeneral().getName().setValue(NAME); gateway.getGeneral().getDocumentation().setValue(DOCUMENTATION); gateway.getExecutionSet().getDefaultRoute().setValue(DEFAULT_ROUTE); Node<View<BaseGateway>, ?> node = newNode(UUID, gateway); when(propertyWriterFactory.of(any(org.eclipse.bpmn2.ExclusiveGateway.class))).thenReturn(gatewayPropertyWriter); assertEquals(gatewayPropertyWriter, converter.toFlowElement(node)); verifyCommonValues(gatewayPropertyWriter, node); verify(gatewayPropertyWriter).setDefaultRoute(DEFAULT_ROUTE); verify(gatewayPropertyWriter).setGatewayDirection(node); } | private PropertyWriter exclusive(Node<View<ExclusiveGateway>, ?> n) { GatewayPropertyWriter p = propertyWriterFactory.of(bpmn2.createExclusiveGateway()); p.setId(n.getUUID()); ExclusiveGateway definition = n.getContent().getDefinition(); p.setGatewayDirection(n); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); GatewayExecutionSet executionSet = definition.getExecutionSet(); p.setDefaultRoute(executionSet.getDefaultRoute().getValue()); p.setAbsoluteBounds(n); return p; } | GatewayConverter { private PropertyWriter exclusive(Node<View<ExclusiveGateway>, ?> n) { GatewayPropertyWriter p = propertyWriterFactory.of(bpmn2.createExclusiveGateway()); p.setId(n.getUUID()); ExclusiveGateway definition = n.getContent().getDefinition(); p.setGatewayDirection(n); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); GatewayExecutionSet executionSet = definition.getExecutionSet(); p.setDefaultRoute(executionSet.getDefaultRoute().getValue()); p.setAbsoluteBounds(n); return p; } } | GatewayConverter { private PropertyWriter exclusive(Node<View<ExclusiveGateway>, ?> n) { GatewayPropertyWriter p = propertyWriterFactory.of(bpmn2.createExclusiveGateway()); p.setId(n.getUUID()); ExclusiveGateway definition = n.getContent().getDefinition(); p.setGatewayDirection(n); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); GatewayExecutionSet executionSet = definition.getExecutionSet(); p.setDefaultRoute(executionSet.getDefaultRoute().getValue()); p.setAbsoluteBounds(n); return p; } GatewayConverter(PropertyWriterFactory propertyWriterFactory); } | GatewayConverter { private PropertyWriter exclusive(Node<View<ExclusiveGateway>, ?> n) { GatewayPropertyWriter p = propertyWriterFactory.of(bpmn2.createExclusiveGateway()); p.setId(n.getUUID()); ExclusiveGateway definition = n.getContent().getDefinition(); p.setGatewayDirection(n); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); GatewayExecutionSet executionSet = definition.getExecutionSet(); p.setDefaultRoute(executionSet.getDefaultRoute().getValue()); p.setAbsoluteBounds(n); return p; } GatewayConverter(PropertyWriterFactory propertyWriterFactory); PropertyWriter toFlowElement(Node<View<BaseGateway>, ?> node); } | GatewayConverter { private PropertyWriter exclusive(Node<View<ExclusiveGateway>, ?> n) { GatewayPropertyWriter p = propertyWriterFactory.of(bpmn2.createExclusiveGateway()); p.setId(n.getUUID()); ExclusiveGateway definition = n.getContent().getDefinition(); p.setGatewayDirection(n); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); GatewayExecutionSet executionSet = definition.getExecutionSet(); p.setDefaultRoute(executionSet.getDefaultRoute().getValue()); p.setAbsoluteBounds(n); return p; } GatewayConverter(PropertyWriterFactory propertyWriterFactory); PropertyWriter toFlowElement(Node<View<BaseGateway>, ?> node); } |
@Test public void testParallel() { ParallelGateway gateway = new ParallelGateway(); gateway.getGeneral().getName().setValue(NAME); gateway.getGeneral().getDocumentation().setValue(DOCUMENTATION); Node<View<BaseGateway>, ?> node = newNode(UUID, gateway); when(propertyWriterFactory.of(any(org.eclipse.bpmn2.ParallelGateway.class))).thenReturn(gatewayPropertyWriter); assertEquals(gatewayPropertyWriter, converter.toFlowElement(node)); verifyCommonValues(gatewayPropertyWriter, node); verify(gatewayPropertyWriter).setGatewayDirection(node); } | private PropertyWriter parallel(Node<View<ParallelGateway>, ?> n) { GatewayPropertyWriter p = propertyWriterFactory.of(bpmn2.createParallelGateway()); p.setId(n.getUUID()); ParallelGateway definition = n.getContent().getDefinition(); p.setGatewayDirection(n); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); p.setAbsoluteBounds(n); return p; } | GatewayConverter { private PropertyWriter parallel(Node<View<ParallelGateway>, ?> n) { GatewayPropertyWriter p = propertyWriterFactory.of(bpmn2.createParallelGateway()); p.setId(n.getUUID()); ParallelGateway definition = n.getContent().getDefinition(); p.setGatewayDirection(n); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); p.setAbsoluteBounds(n); return p; } } | GatewayConverter { private PropertyWriter parallel(Node<View<ParallelGateway>, ?> n) { GatewayPropertyWriter p = propertyWriterFactory.of(bpmn2.createParallelGateway()); p.setId(n.getUUID()); ParallelGateway definition = n.getContent().getDefinition(); p.setGatewayDirection(n); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); p.setAbsoluteBounds(n); return p; } GatewayConverter(PropertyWriterFactory propertyWriterFactory); } | GatewayConverter { private PropertyWriter parallel(Node<View<ParallelGateway>, ?> n) { GatewayPropertyWriter p = propertyWriterFactory.of(bpmn2.createParallelGateway()); p.setId(n.getUUID()); ParallelGateway definition = n.getContent().getDefinition(); p.setGatewayDirection(n); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); p.setAbsoluteBounds(n); return p; } GatewayConverter(PropertyWriterFactory propertyWriterFactory); PropertyWriter toFlowElement(Node<View<BaseGateway>, ?> node); } | GatewayConverter { private PropertyWriter parallel(Node<View<ParallelGateway>, ?> n) { GatewayPropertyWriter p = propertyWriterFactory.of(bpmn2.createParallelGateway()); p.setId(n.getUUID()); ParallelGateway definition = n.getContent().getDefinition(); p.setGatewayDirection(n); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); p.setAbsoluteBounds(n); return p; } GatewayConverter(PropertyWriterFactory propertyWriterFactory); PropertyWriter toFlowElement(Node<View<BaseGateway>, ?> node); } |
@Test public void testEvent() { EventGateway gateway = new EventGateway(); gateway.getGeneral().getName().setValue(NAME); gateway.getGeneral().getDocumentation().setValue(DOCUMENTATION); Node<View<BaseGateway>, ?> node = newNode(UUID, gateway); when(propertyWriterFactory.of(any(org.eclipse.bpmn2.EventBasedGateway.class))).thenReturn(gatewayPropertyWriter); assertEquals(gatewayPropertyWriter, converter.toFlowElement(node)); verifyCommonValues(gatewayPropertyWriter, node); } | private PropertyWriter event(Node<View<EventGateway>, ?> n) { GatewayPropertyWriter p = propertyWriterFactory.of(bpmn2.createEventBasedGateway()); p.setId(n.getUUID()); p.setGatewayDirection(GatewayDirection.DIVERGING); EventGateway definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); p.setAbsoluteBounds(n); return p; } | GatewayConverter { private PropertyWriter event(Node<View<EventGateway>, ?> n) { GatewayPropertyWriter p = propertyWriterFactory.of(bpmn2.createEventBasedGateway()); p.setId(n.getUUID()); p.setGatewayDirection(GatewayDirection.DIVERGING); EventGateway definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); p.setAbsoluteBounds(n); return p; } } | GatewayConverter { private PropertyWriter event(Node<View<EventGateway>, ?> n) { GatewayPropertyWriter p = propertyWriterFactory.of(bpmn2.createEventBasedGateway()); p.setId(n.getUUID()); p.setGatewayDirection(GatewayDirection.DIVERGING); EventGateway definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); p.setAbsoluteBounds(n); return p; } GatewayConverter(PropertyWriterFactory propertyWriterFactory); } | GatewayConverter { private PropertyWriter event(Node<View<EventGateway>, ?> n) { GatewayPropertyWriter p = propertyWriterFactory.of(bpmn2.createEventBasedGateway()); p.setId(n.getUUID()); p.setGatewayDirection(GatewayDirection.DIVERGING); EventGateway definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); p.setAbsoluteBounds(n); return p; } GatewayConverter(PropertyWriterFactory propertyWriterFactory); PropertyWriter toFlowElement(Node<View<BaseGateway>, ?> node); } | GatewayConverter { private PropertyWriter event(Node<View<EventGateway>, ?> n) { GatewayPropertyWriter p = propertyWriterFactory.of(bpmn2.createEventBasedGateway()); p.setId(n.getUUID()); p.setGatewayDirection(GatewayDirection.DIVERGING); EventGateway definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); p.setAbsoluteBounds(n); return p; } GatewayConverter(PropertyWriterFactory propertyWriterFactory); PropertyWriter toFlowElement(Node<View<BaseGateway>, ?> node); } |
@Test public void testToFlowElementMI() { assertEquals(propertyWriter, converter.toFlowElement(node)); verifyCommonValues(); verify(propertyWriter).setIsSequential(SEQUENTIAL); verify(propertyWriter).setCollectionInput(COLLECTION_INPUT); verify(propertyWriter).setInput(DATA_INPUT); verify(propertyWriter).setCollectionOutput(COLLECTION_OUTPUT); verify(propertyWriter).setOutput(DATA_OUTPUT); verify(propertyWriter).setCompletionCondition(COMPLETION_CONDITION); } | public PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n) { CallActivity activity = bpmn2.createCallActivity(); activity.setId(n.getUUID()); CallActivityPropertyWriter p = propertyWriterFactory.of(activity); BaseReusableSubprocess definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); BaseReusableSubprocessTaskExecutionSet executionSet = definition.getExecutionSet(); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setCalledElement(replaceIllegalCharsAttribute(executionSet.getCalledElement().getValue())); p.setAsync(executionSet.getIsAsync().getValue()); p.setIndependent(executionSet.getIndependent().getValue()); if (Boolean.FALSE.equals(executionSet.getIndependent().getValue())) { p.setAbortParent(executionSet.getAbortParent().getValue()); } p.setWaitForCompletion(executionSet.getWaitForCompletion().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo()); if (Boolean.TRUE.equals(executionSet.getIsMultipleInstance().getValue())) { p.setIsSequential(executionSet.getMultipleInstanceExecutionMode().isSequential()); p.setCollectionInput(executionSet.getMultipleInstanceCollectionInput().getValue()); p.setInput(executionSet.getMultipleInstanceDataInput().getValue()); p.setCollectionOutput(executionSet.getMultipleInstanceCollectionOutput().getValue()); p.setOutput(executionSet.getMultipleInstanceDataOutput().getValue()); p.setCompletionCondition(executionSet.getMultipleInstanceCompletionCondition().getValue()); } p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); p.setCase(executionSet.getIsCase().getValue()); p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); return p; } | ReusableSubprocessConverter { public PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n) { CallActivity activity = bpmn2.createCallActivity(); activity.setId(n.getUUID()); CallActivityPropertyWriter p = propertyWriterFactory.of(activity); BaseReusableSubprocess definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); BaseReusableSubprocessTaskExecutionSet executionSet = definition.getExecutionSet(); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setCalledElement(replaceIllegalCharsAttribute(executionSet.getCalledElement().getValue())); p.setAsync(executionSet.getIsAsync().getValue()); p.setIndependent(executionSet.getIndependent().getValue()); if (Boolean.FALSE.equals(executionSet.getIndependent().getValue())) { p.setAbortParent(executionSet.getAbortParent().getValue()); } p.setWaitForCompletion(executionSet.getWaitForCompletion().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo()); if (Boolean.TRUE.equals(executionSet.getIsMultipleInstance().getValue())) { p.setIsSequential(executionSet.getMultipleInstanceExecutionMode().isSequential()); p.setCollectionInput(executionSet.getMultipleInstanceCollectionInput().getValue()); p.setInput(executionSet.getMultipleInstanceDataInput().getValue()); p.setCollectionOutput(executionSet.getMultipleInstanceCollectionOutput().getValue()); p.setOutput(executionSet.getMultipleInstanceDataOutput().getValue()); p.setCompletionCondition(executionSet.getMultipleInstanceCompletionCondition().getValue()); } p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); p.setCase(executionSet.getIsCase().getValue()); p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); return p; } } | ReusableSubprocessConverter { public PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n) { CallActivity activity = bpmn2.createCallActivity(); activity.setId(n.getUUID()); CallActivityPropertyWriter p = propertyWriterFactory.of(activity); BaseReusableSubprocess definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); BaseReusableSubprocessTaskExecutionSet executionSet = definition.getExecutionSet(); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setCalledElement(replaceIllegalCharsAttribute(executionSet.getCalledElement().getValue())); p.setAsync(executionSet.getIsAsync().getValue()); p.setIndependent(executionSet.getIndependent().getValue()); if (Boolean.FALSE.equals(executionSet.getIndependent().getValue())) { p.setAbortParent(executionSet.getAbortParent().getValue()); } p.setWaitForCompletion(executionSet.getWaitForCompletion().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo()); if (Boolean.TRUE.equals(executionSet.getIsMultipleInstance().getValue())) { p.setIsSequential(executionSet.getMultipleInstanceExecutionMode().isSequential()); p.setCollectionInput(executionSet.getMultipleInstanceCollectionInput().getValue()); p.setInput(executionSet.getMultipleInstanceDataInput().getValue()); p.setCollectionOutput(executionSet.getMultipleInstanceCollectionOutput().getValue()); p.setOutput(executionSet.getMultipleInstanceDataOutput().getValue()); p.setCompletionCondition(executionSet.getMultipleInstanceCompletionCondition().getValue()); } p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); p.setCase(executionSet.getIsCase().getValue()); p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); return p; } ReusableSubprocessConverter(PropertyWriterFactory propertyWriterFactory); } | ReusableSubprocessConverter { public PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n) { CallActivity activity = bpmn2.createCallActivity(); activity.setId(n.getUUID()); CallActivityPropertyWriter p = propertyWriterFactory.of(activity); BaseReusableSubprocess definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); BaseReusableSubprocessTaskExecutionSet executionSet = definition.getExecutionSet(); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setCalledElement(replaceIllegalCharsAttribute(executionSet.getCalledElement().getValue())); p.setAsync(executionSet.getIsAsync().getValue()); p.setIndependent(executionSet.getIndependent().getValue()); if (Boolean.FALSE.equals(executionSet.getIndependent().getValue())) { p.setAbortParent(executionSet.getAbortParent().getValue()); } p.setWaitForCompletion(executionSet.getWaitForCompletion().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo()); if (Boolean.TRUE.equals(executionSet.getIsMultipleInstance().getValue())) { p.setIsSequential(executionSet.getMultipleInstanceExecutionMode().isSequential()); p.setCollectionInput(executionSet.getMultipleInstanceCollectionInput().getValue()); p.setInput(executionSet.getMultipleInstanceDataInput().getValue()); p.setCollectionOutput(executionSet.getMultipleInstanceCollectionOutput().getValue()); p.setOutput(executionSet.getMultipleInstanceDataOutput().getValue()); p.setCompletionCondition(executionSet.getMultipleInstanceCompletionCondition().getValue()); } p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); p.setCase(executionSet.getIsCase().getValue()); p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); return p; } ReusableSubprocessConverter(PropertyWriterFactory propertyWriterFactory); PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n); } | ReusableSubprocessConverter { public PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n) { CallActivity activity = bpmn2.createCallActivity(); activity.setId(n.getUUID()); CallActivityPropertyWriter p = propertyWriterFactory.of(activity); BaseReusableSubprocess definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); BaseReusableSubprocessTaskExecutionSet executionSet = definition.getExecutionSet(); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setCalledElement(replaceIllegalCharsAttribute(executionSet.getCalledElement().getValue())); p.setAsync(executionSet.getIsAsync().getValue()); p.setIndependent(executionSet.getIndependent().getValue()); if (Boolean.FALSE.equals(executionSet.getIndependent().getValue())) { p.setAbortParent(executionSet.getAbortParent().getValue()); } p.setWaitForCompletion(executionSet.getWaitForCompletion().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo()); if (Boolean.TRUE.equals(executionSet.getIsMultipleInstance().getValue())) { p.setIsSequential(executionSet.getMultipleInstanceExecutionMode().isSequential()); p.setCollectionInput(executionSet.getMultipleInstanceCollectionInput().getValue()); p.setInput(executionSet.getMultipleInstanceDataInput().getValue()); p.setCollectionOutput(executionSet.getMultipleInstanceCollectionOutput().getValue()); p.setOutput(executionSet.getMultipleInstanceDataOutput().getValue()); p.setCompletionCondition(executionSet.getMultipleInstanceCompletionCondition().getValue()); } p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); p.setCase(executionSet.getIsCase().getValue()); p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); return p; } ReusableSubprocessConverter(PropertyWriterFactory propertyWriterFactory); PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n); } |
@Test public void testToFlowElementNonMI() { node.getContent().getDefinition().getExecutionSet().getIsMultipleInstance().setValue(false); assertEquals(propertyWriter, converter.toFlowElement(node)); verifyCommonValues(); verify(propertyWriter, never()).setIsSequential(anyBoolean()); verify(propertyWriter, never()).setCollectionInput(anyString()); verify(propertyWriter, never()).setInput(anyString()); verify(propertyWriter, never()).setCollectionOutput(anyString()); verify(propertyWriter, never()).setOutput(anyString()); verify(propertyWriter, never()).setCompletionCondition(anyString()); } | public PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n) { CallActivity activity = bpmn2.createCallActivity(); activity.setId(n.getUUID()); CallActivityPropertyWriter p = propertyWriterFactory.of(activity); BaseReusableSubprocess definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); BaseReusableSubprocessTaskExecutionSet executionSet = definition.getExecutionSet(); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setCalledElement(replaceIllegalCharsAttribute(executionSet.getCalledElement().getValue())); p.setAsync(executionSet.getIsAsync().getValue()); p.setIndependent(executionSet.getIndependent().getValue()); if (Boolean.FALSE.equals(executionSet.getIndependent().getValue())) { p.setAbortParent(executionSet.getAbortParent().getValue()); } p.setWaitForCompletion(executionSet.getWaitForCompletion().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo()); if (Boolean.TRUE.equals(executionSet.getIsMultipleInstance().getValue())) { p.setIsSequential(executionSet.getMultipleInstanceExecutionMode().isSequential()); p.setCollectionInput(executionSet.getMultipleInstanceCollectionInput().getValue()); p.setInput(executionSet.getMultipleInstanceDataInput().getValue()); p.setCollectionOutput(executionSet.getMultipleInstanceCollectionOutput().getValue()); p.setOutput(executionSet.getMultipleInstanceDataOutput().getValue()); p.setCompletionCondition(executionSet.getMultipleInstanceCompletionCondition().getValue()); } p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); p.setCase(executionSet.getIsCase().getValue()); p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); return p; } | ReusableSubprocessConverter { public PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n) { CallActivity activity = bpmn2.createCallActivity(); activity.setId(n.getUUID()); CallActivityPropertyWriter p = propertyWriterFactory.of(activity); BaseReusableSubprocess definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); BaseReusableSubprocessTaskExecutionSet executionSet = definition.getExecutionSet(); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setCalledElement(replaceIllegalCharsAttribute(executionSet.getCalledElement().getValue())); p.setAsync(executionSet.getIsAsync().getValue()); p.setIndependent(executionSet.getIndependent().getValue()); if (Boolean.FALSE.equals(executionSet.getIndependent().getValue())) { p.setAbortParent(executionSet.getAbortParent().getValue()); } p.setWaitForCompletion(executionSet.getWaitForCompletion().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo()); if (Boolean.TRUE.equals(executionSet.getIsMultipleInstance().getValue())) { p.setIsSequential(executionSet.getMultipleInstanceExecutionMode().isSequential()); p.setCollectionInput(executionSet.getMultipleInstanceCollectionInput().getValue()); p.setInput(executionSet.getMultipleInstanceDataInput().getValue()); p.setCollectionOutput(executionSet.getMultipleInstanceCollectionOutput().getValue()); p.setOutput(executionSet.getMultipleInstanceDataOutput().getValue()); p.setCompletionCondition(executionSet.getMultipleInstanceCompletionCondition().getValue()); } p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); p.setCase(executionSet.getIsCase().getValue()); p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); return p; } } | ReusableSubprocessConverter { public PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n) { CallActivity activity = bpmn2.createCallActivity(); activity.setId(n.getUUID()); CallActivityPropertyWriter p = propertyWriterFactory.of(activity); BaseReusableSubprocess definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); BaseReusableSubprocessTaskExecutionSet executionSet = definition.getExecutionSet(); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setCalledElement(replaceIllegalCharsAttribute(executionSet.getCalledElement().getValue())); p.setAsync(executionSet.getIsAsync().getValue()); p.setIndependent(executionSet.getIndependent().getValue()); if (Boolean.FALSE.equals(executionSet.getIndependent().getValue())) { p.setAbortParent(executionSet.getAbortParent().getValue()); } p.setWaitForCompletion(executionSet.getWaitForCompletion().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo()); if (Boolean.TRUE.equals(executionSet.getIsMultipleInstance().getValue())) { p.setIsSequential(executionSet.getMultipleInstanceExecutionMode().isSequential()); p.setCollectionInput(executionSet.getMultipleInstanceCollectionInput().getValue()); p.setInput(executionSet.getMultipleInstanceDataInput().getValue()); p.setCollectionOutput(executionSet.getMultipleInstanceCollectionOutput().getValue()); p.setOutput(executionSet.getMultipleInstanceDataOutput().getValue()); p.setCompletionCondition(executionSet.getMultipleInstanceCompletionCondition().getValue()); } p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); p.setCase(executionSet.getIsCase().getValue()); p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); return p; } ReusableSubprocessConverter(PropertyWriterFactory propertyWriterFactory); } | ReusableSubprocessConverter { public PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n) { CallActivity activity = bpmn2.createCallActivity(); activity.setId(n.getUUID()); CallActivityPropertyWriter p = propertyWriterFactory.of(activity); BaseReusableSubprocess definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); BaseReusableSubprocessTaskExecutionSet executionSet = definition.getExecutionSet(); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setCalledElement(replaceIllegalCharsAttribute(executionSet.getCalledElement().getValue())); p.setAsync(executionSet.getIsAsync().getValue()); p.setIndependent(executionSet.getIndependent().getValue()); if (Boolean.FALSE.equals(executionSet.getIndependent().getValue())) { p.setAbortParent(executionSet.getAbortParent().getValue()); } p.setWaitForCompletion(executionSet.getWaitForCompletion().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo()); if (Boolean.TRUE.equals(executionSet.getIsMultipleInstance().getValue())) { p.setIsSequential(executionSet.getMultipleInstanceExecutionMode().isSequential()); p.setCollectionInput(executionSet.getMultipleInstanceCollectionInput().getValue()); p.setInput(executionSet.getMultipleInstanceDataInput().getValue()); p.setCollectionOutput(executionSet.getMultipleInstanceCollectionOutput().getValue()); p.setOutput(executionSet.getMultipleInstanceDataOutput().getValue()); p.setCompletionCondition(executionSet.getMultipleInstanceCompletionCondition().getValue()); } p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); p.setCase(executionSet.getIsCase().getValue()); p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); return p; } ReusableSubprocessConverter(PropertyWriterFactory propertyWriterFactory); PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n); } | ReusableSubprocessConverter { public PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n) { CallActivity activity = bpmn2.createCallActivity(); activity.setId(n.getUUID()); CallActivityPropertyWriter p = propertyWriterFactory.of(activity); BaseReusableSubprocess definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); BaseReusableSubprocessTaskExecutionSet executionSet = definition.getExecutionSet(); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setCalledElement(replaceIllegalCharsAttribute(executionSet.getCalledElement().getValue())); p.setAsync(executionSet.getIsAsync().getValue()); p.setIndependent(executionSet.getIndependent().getValue()); if (Boolean.FALSE.equals(executionSet.getIndependent().getValue())) { p.setAbortParent(executionSet.getAbortParent().getValue()); } p.setWaitForCompletion(executionSet.getWaitForCompletion().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo()); if (Boolean.TRUE.equals(executionSet.getIsMultipleInstance().getValue())) { p.setIsSequential(executionSet.getMultipleInstanceExecutionMode().isSequential()); p.setCollectionInput(executionSet.getMultipleInstanceCollectionInput().getValue()); p.setInput(executionSet.getMultipleInstanceDataInput().getValue()); p.setCollectionOutput(executionSet.getMultipleInstanceCollectionOutput().getValue()); p.setOutput(executionSet.getMultipleInstanceDataOutput().getValue()); p.setCompletionCondition(executionSet.getMultipleInstanceCompletionCondition().getValue()); } p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); p.setCase(executionSet.getIsCase().getValue()); p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); return p; } ReusableSubprocessConverter(PropertyWriterFactory propertyWriterFactory); PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n); } |
@Test public void testHideLoading() { loading.classList = mock(DOMTokenList.class); view.hideLoading(); verify(loading.classList).add(HIDDEN_CSS_CLASS); } | @Override public void hideLoading() { hide(loading); } | DecisionComponentsView implements DecisionComponents.View { @Override public void hideLoading() { hide(loading); } } | DecisionComponentsView implements DecisionComponents.View { @Override public void hideLoading() { hide(loading); } @Inject DecisionComponentsView(final HTMLSelectElement drgElementFilter,
final HTMLInputElement termFilter,
final HTMLDivElement list,
final HTMLDivElement emptyState,
final HTMLDivElement loading,
final HTMLDivElement componentsCounter,
final TranslationService translationService); } | DecisionComponentsView implements DecisionComponents.View { @Override public void hideLoading() { hide(loading); } @Inject DecisionComponentsView(final HTMLSelectElement drgElementFilter,
final HTMLInputElement termFilter,
final HTMLDivElement list,
final HTMLDivElement emptyState,
final HTMLDivElement loading,
final HTMLDivElement componentsCounter,
final TranslationService translationService); @PostConstruct void init(); @Override void init(final DecisionComponents presenter); @EventHandler("term-filter") void onTermFilterChange(final KeyUpEvent e); @Override void clear(); @Override void addListItem(final HTMLElement htmlElement); @Override void showEmptyState(); @Override void showLoading(); @Override void hideLoading(); @Override void disableFilterInputs(); @Override void enableFilterInputs(); @Override void setComponentsCounter(final Integer count); } | DecisionComponentsView implements DecisionComponents.View { @Override public void hideLoading() { hide(loading); } @Inject DecisionComponentsView(final HTMLSelectElement drgElementFilter,
final HTMLInputElement termFilter,
final HTMLDivElement list,
final HTMLDivElement emptyState,
final HTMLDivElement loading,
final HTMLDivElement componentsCounter,
final TranslationService translationService); @PostConstruct void init(); @Override void init(final DecisionComponents presenter); @EventHandler("term-filter") void onTermFilterChange(final KeyUpEvent e); @Override void clear(); @Override void addListItem(final HTMLElement htmlElement); @Override void showEmptyState(); @Override void showLoading(); @Override void hideLoading(); @Override void disableFilterInputs(); @Override void enableFilterInputs(); @Override void setComponentsCounter(final Integer count); } |
@Test public void testToFlowElement_case() { final BaseReusableSubprocess definition = new ReusableSubprocess(); definition.getExecutionSet().setIsCase(new IsCase(true)); final View<BaseReusableSubprocess> view = new ViewImpl<>(definition, Bounds.create()); final Node<View<BaseReusableSubprocess>, ?> node = new NodeImpl<>(java.util.UUID.randomUUID().toString()); node.setContent(view); final PropertyWriter propertyWriter = tested.toFlowElement(node); assertTrue(CallActivityPropertyWriter.class.isInstance(propertyWriter)); assertTrue(CustomElement.isCase.of(propertyWriter.getFlowElement()).get()); } | public PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n) { CallActivity activity = bpmn2.createCallActivity(); activity.setId(n.getUUID()); CallActivityPropertyWriter p = propertyWriterFactory.of(activity); BaseReusableSubprocess definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); BaseReusableSubprocessTaskExecutionSet executionSet = definition.getExecutionSet(); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setCalledElement(replaceIllegalCharsAttribute(executionSet.getCalledElement().getValue())); p.setAsync(executionSet.getIsAsync().getValue()); p.setIndependent(executionSet.getIndependent().getValue()); if (Boolean.FALSE.equals(executionSet.getIndependent().getValue())) { p.setAbortParent(executionSet.getAbortParent().getValue()); } p.setWaitForCompletion(executionSet.getWaitForCompletion().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo()); if (Boolean.TRUE.equals(executionSet.getIsMultipleInstance().getValue())) { p.setIsSequential(executionSet.getMultipleInstanceExecutionMode().isSequential()); p.setCollectionInput(executionSet.getMultipleInstanceCollectionInput().getValue()); p.setInput(executionSet.getMultipleInstanceDataInput().getValue()); p.setCollectionOutput(executionSet.getMultipleInstanceCollectionOutput().getValue()); p.setOutput(executionSet.getMultipleInstanceDataOutput().getValue()); p.setCompletionCondition(executionSet.getMultipleInstanceCompletionCondition().getValue()); } p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); p.setCase(executionSet.getIsCase().getValue()); p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); return p; } | ReusableSubprocessConverter { public PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n) { CallActivity activity = bpmn2.createCallActivity(); activity.setId(n.getUUID()); CallActivityPropertyWriter p = propertyWriterFactory.of(activity); BaseReusableSubprocess definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); BaseReusableSubprocessTaskExecutionSet executionSet = definition.getExecutionSet(); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setCalledElement(replaceIllegalCharsAttribute(executionSet.getCalledElement().getValue())); p.setAsync(executionSet.getIsAsync().getValue()); p.setIndependent(executionSet.getIndependent().getValue()); if (Boolean.FALSE.equals(executionSet.getIndependent().getValue())) { p.setAbortParent(executionSet.getAbortParent().getValue()); } p.setWaitForCompletion(executionSet.getWaitForCompletion().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo()); if (Boolean.TRUE.equals(executionSet.getIsMultipleInstance().getValue())) { p.setIsSequential(executionSet.getMultipleInstanceExecutionMode().isSequential()); p.setCollectionInput(executionSet.getMultipleInstanceCollectionInput().getValue()); p.setInput(executionSet.getMultipleInstanceDataInput().getValue()); p.setCollectionOutput(executionSet.getMultipleInstanceCollectionOutput().getValue()); p.setOutput(executionSet.getMultipleInstanceDataOutput().getValue()); p.setCompletionCondition(executionSet.getMultipleInstanceCompletionCondition().getValue()); } p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); p.setCase(executionSet.getIsCase().getValue()); p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); return p; } } | ReusableSubprocessConverter { public PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n) { CallActivity activity = bpmn2.createCallActivity(); activity.setId(n.getUUID()); CallActivityPropertyWriter p = propertyWriterFactory.of(activity); BaseReusableSubprocess definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); BaseReusableSubprocessTaskExecutionSet executionSet = definition.getExecutionSet(); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setCalledElement(replaceIllegalCharsAttribute(executionSet.getCalledElement().getValue())); p.setAsync(executionSet.getIsAsync().getValue()); p.setIndependent(executionSet.getIndependent().getValue()); if (Boolean.FALSE.equals(executionSet.getIndependent().getValue())) { p.setAbortParent(executionSet.getAbortParent().getValue()); } p.setWaitForCompletion(executionSet.getWaitForCompletion().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo()); if (Boolean.TRUE.equals(executionSet.getIsMultipleInstance().getValue())) { p.setIsSequential(executionSet.getMultipleInstanceExecutionMode().isSequential()); p.setCollectionInput(executionSet.getMultipleInstanceCollectionInput().getValue()); p.setInput(executionSet.getMultipleInstanceDataInput().getValue()); p.setCollectionOutput(executionSet.getMultipleInstanceCollectionOutput().getValue()); p.setOutput(executionSet.getMultipleInstanceDataOutput().getValue()); p.setCompletionCondition(executionSet.getMultipleInstanceCompletionCondition().getValue()); } p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); p.setCase(executionSet.getIsCase().getValue()); p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); return p; } ReusableSubprocessConverter(PropertyWriterFactory propertyWriterFactory); } | ReusableSubprocessConverter { public PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n) { CallActivity activity = bpmn2.createCallActivity(); activity.setId(n.getUUID()); CallActivityPropertyWriter p = propertyWriterFactory.of(activity); BaseReusableSubprocess definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); BaseReusableSubprocessTaskExecutionSet executionSet = definition.getExecutionSet(); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setCalledElement(replaceIllegalCharsAttribute(executionSet.getCalledElement().getValue())); p.setAsync(executionSet.getIsAsync().getValue()); p.setIndependent(executionSet.getIndependent().getValue()); if (Boolean.FALSE.equals(executionSet.getIndependent().getValue())) { p.setAbortParent(executionSet.getAbortParent().getValue()); } p.setWaitForCompletion(executionSet.getWaitForCompletion().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo()); if (Boolean.TRUE.equals(executionSet.getIsMultipleInstance().getValue())) { p.setIsSequential(executionSet.getMultipleInstanceExecutionMode().isSequential()); p.setCollectionInput(executionSet.getMultipleInstanceCollectionInput().getValue()); p.setInput(executionSet.getMultipleInstanceDataInput().getValue()); p.setCollectionOutput(executionSet.getMultipleInstanceCollectionOutput().getValue()); p.setOutput(executionSet.getMultipleInstanceDataOutput().getValue()); p.setCompletionCondition(executionSet.getMultipleInstanceCompletionCondition().getValue()); } p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); p.setCase(executionSet.getIsCase().getValue()); p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); return p; } ReusableSubprocessConverter(PropertyWriterFactory propertyWriterFactory); PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n); } | ReusableSubprocessConverter { public PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n) { CallActivity activity = bpmn2.createCallActivity(); activity.setId(n.getUUID()); CallActivityPropertyWriter p = propertyWriterFactory.of(activity); BaseReusableSubprocess definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); BaseReusableSubprocessTaskExecutionSet executionSet = definition.getExecutionSet(); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setCalledElement(replaceIllegalCharsAttribute(executionSet.getCalledElement().getValue())); p.setAsync(executionSet.getIsAsync().getValue()); p.setIndependent(executionSet.getIndependent().getValue()); if (Boolean.FALSE.equals(executionSet.getIndependent().getValue())) { p.setAbortParent(executionSet.getAbortParent().getValue()); } p.setWaitForCompletion(executionSet.getWaitForCompletion().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo()); if (Boolean.TRUE.equals(executionSet.getIsMultipleInstance().getValue())) { p.setIsSequential(executionSet.getMultipleInstanceExecutionMode().isSequential()); p.setCollectionInput(executionSet.getMultipleInstanceCollectionInput().getValue()); p.setInput(executionSet.getMultipleInstanceDataInput().getValue()); p.setCollectionOutput(executionSet.getMultipleInstanceCollectionOutput().getValue()); p.setOutput(executionSet.getMultipleInstanceDataOutput().getValue()); p.setCompletionCondition(executionSet.getMultipleInstanceCompletionCondition().getValue()); } p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); p.setCase(executionSet.getIsCase().getValue()); p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); return p; } ReusableSubprocessConverter(PropertyWriterFactory propertyWriterFactory); PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n); } |
@Test public void testToFlowElement_process() { final BaseReusableSubprocess definition = new ReusableSubprocess(); final View<BaseReusableSubprocess> view = new ViewImpl<>(definition, Bounds.create()); final Node<View<BaseReusableSubprocess>, ?> node = new NodeImpl<>(java.util.UUID.randomUUID().toString()); node.setContent(view); final PropertyWriter propertyWriter = tested.toFlowElement(node); assertTrue(CallActivityPropertyWriter.class.isInstance(propertyWriter)); assertFalse(CustomElement.isCase.of(propertyWriter.getFlowElement()).get()); } | public PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n) { CallActivity activity = bpmn2.createCallActivity(); activity.setId(n.getUUID()); CallActivityPropertyWriter p = propertyWriterFactory.of(activity); BaseReusableSubprocess definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); BaseReusableSubprocessTaskExecutionSet executionSet = definition.getExecutionSet(); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setCalledElement(replaceIllegalCharsAttribute(executionSet.getCalledElement().getValue())); p.setAsync(executionSet.getIsAsync().getValue()); p.setIndependent(executionSet.getIndependent().getValue()); if (Boolean.FALSE.equals(executionSet.getIndependent().getValue())) { p.setAbortParent(executionSet.getAbortParent().getValue()); } p.setWaitForCompletion(executionSet.getWaitForCompletion().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo()); if (Boolean.TRUE.equals(executionSet.getIsMultipleInstance().getValue())) { p.setIsSequential(executionSet.getMultipleInstanceExecutionMode().isSequential()); p.setCollectionInput(executionSet.getMultipleInstanceCollectionInput().getValue()); p.setInput(executionSet.getMultipleInstanceDataInput().getValue()); p.setCollectionOutput(executionSet.getMultipleInstanceCollectionOutput().getValue()); p.setOutput(executionSet.getMultipleInstanceDataOutput().getValue()); p.setCompletionCondition(executionSet.getMultipleInstanceCompletionCondition().getValue()); } p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); p.setCase(executionSet.getIsCase().getValue()); p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); return p; } | ReusableSubprocessConverter { public PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n) { CallActivity activity = bpmn2.createCallActivity(); activity.setId(n.getUUID()); CallActivityPropertyWriter p = propertyWriterFactory.of(activity); BaseReusableSubprocess definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); BaseReusableSubprocessTaskExecutionSet executionSet = definition.getExecutionSet(); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setCalledElement(replaceIllegalCharsAttribute(executionSet.getCalledElement().getValue())); p.setAsync(executionSet.getIsAsync().getValue()); p.setIndependent(executionSet.getIndependent().getValue()); if (Boolean.FALSE.equals(executionSet.getIndependent().getValue())) { p.setAbortParent(executionSet.getAbortParent().getValue()); } p.setWaitForCompletion(executionSet.getWaitForCompletion().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo()); if (Boolean.TRUE.equals(executionSet.getIsMultipleInstance().getValue())) { p.setIsSequential(executionSet.getMultipleInstanceExecutionMode().isSequential()); p.setCollectionInput(executionSet.getMultipleInstanceCollectionInput().getValue()); p.setInput(executionSet.getMultipleInstanceDataInput().getValue()); p.setCollectionOutput(executionSet.getMultipleInstanceCollectionOutput().getValue()); p.setOutput(executionSet.getMultipleInstanceDataOutput().getValue()); p.setCompletionCondition(executionSet.getMultipleInstanceCompletionCondition().getValue()); } p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); p.setCase(executionSet.getIsCase().getValue()); p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); return p; } } | ReusableSubprocessConverter { public PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n) { CallActivity activity = bpmn2.createCallActivity(); activity.setId(n.getUUID()); CallActivityPropertyWriter p = propertyWriterFactory.of(activity); BaseReusableSubprocess definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); BaseReusableSubprocessTaskExecutionSet executionSet = definition.getExecutionSet(); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setCalledElement(replaceIllegalCharsAttribute(executionSet.getCalledElement().getValue())); p.setAsync(executionSet.getIsAsync().getValue()); p.setIndependent(executionSet.getIndependent().getValue()); if (Boolean.FALSE.equals(executionSet.getIndependent().getValue())) { p.setAbortParent(executionSet.getAbortParent().getValue()); } p.setWaitForCompletion(executionSet.getWaitForCompletion().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo()); if (Boolean.TRUE.equals(executionSet.getIsMultipleInstance().getValue())) { p.setIsSequential(executionSet.getMultipleInstanceExecutionMode().isSequential()); p.setCollectionInput(executionSet.getMultipleInstanceCollectionInput().getValue()); p.setInput(executionSet.getMultipleInstanceDataInput().getValue()); p.setCollectionOutput(executionSet.getMultipleInstanceCollectionOutput().getValue()); p.setOutput(executionSet.getMultipleInstanceDataOutput().getValue()); p.setCompletionCondition(executionSet.getMultipleInstanceCompletionCondition().getValue()); } p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); p.setCase(executionSet.getIsCase().getValue()); p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); return p; } ReusableSubprocessConverter(PropertyWriterFactory propertyWriterFactory); } | ReusableSubprocessConverter { public PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n) { CallActivity activity = bpmn2.createCallActivity(); activity.setId(n.getUUID()); CallActivityPropertyWriter p = propertyWriterFactory.of(activity); BaseReusableSubprocess definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); BaseReusableSubprocessTaskExecutionSet executionSet = definition.getExecutionSet(); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setCalledElement(replaceIllegalCharsAttribute(executionSet.getCalledElement().getValue())); p.setAsync(executionSet.getIsAsync().getValue()); p.setIndependent(executionSet.getIndependent().getValue()); if (Boolean.FALSE.equals(executionSet.getIndependent().getValue())) { p.setAbortParent(executionSet.getAbortParent().getValue()); } p.setWaitForCompletion(executionSet.getWaitForCompletion().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo()); if (Boolean.TRUE.equals(executionSet.getIsMultipleInstance().getValue())) { p.setIsSequential(executionSet.getMultipleInstanceExecutionMode().isSequential()); p.setCollectionInput(executionSet.getMultipleInstanceCollectionInput().getValue()); p.setInput(executionSet.getMultipleInstanceDataInput().getValue()); p.setCollectionOutput(executionSet.getMultipleInstanceCollectionOutput().getValue()); p.setOutput(executionSet.getMultipleInstanceDataOutput().getValue()); p.setCompletionCondition(executionSet.getMultipleInstanceCompletionCondition().getValue()); } p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); p.setCase(executionSet.getIsCase().getValue()); p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); return p; } ReusableSubprocessConverter(PropertyWriterFactory propertyWriterFactory); PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n); } | ReusableSubprocessConverter { public PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n) { CallActivity activity = bpmn2.createCallActivity(); activity.setId(n.getUUID()); CallActivityPropertyWriter p = propertyWriterFactory.of(activity); BaseReusableSubprocess definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); BaseReusableSubprocessTaskExecutionSet executionSet = definition.getExecutionSet(); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setCalledElement(replaceIllegalCharsAttribute(executionSet.getCalledElement().getValue())); p.setAsync(executionSet.getIsAsync().getValue()); p.setIndependent(executionSet.getIndependent().getValue()); if (Boolean.FALSE.equals(executionSet.getIndependent().getValue())) { p.setAbortParent(executionSet.getAbortParent().getValue()); } p.setWaitForCompletion(executionSet.getWaitForCompletion().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo()); if (Boolean.TRUE.equals(executionSet.getIsMultipleInstance().getValue())) { p.setIsSequential(executionSet.getMultipleInstanceExecutionMode().isSequential()); p.setCollectionInput(executionSet.getMultipleInstanceCollectionInput().getValue()); p.setInput(executionSet.getMultipleInstanceDataInput().getValue()); p.setCollectionOutput(executionSet.getMultipleInstanceCollectionOutput().getValue()); p.setOutput(executionSet.getMultipleInstanceDataOutput().getValue()); p.setCompletionCondition(executionSet.getMultipleInstanceCompletionCondition().getValue()); } p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); p.setCase(executionSet.getIsCase().getValue()); p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); return p; } ReusableSubprocessConverter(PropertyWriterFactory propertyWriterFactory); PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n); } |
@Test public void testToFlowElement_autostart() { final ReusableSubprocess definition = new ReusableSubprocess(); definition.getExecutionSet().setAdHocAutostart(new AdHocAutostart(true)); final View<BaseReusableSubprocess> view = new ViewImpl<>(definition, Bounds.create()); final Node<View<BaseReusableSubprocess>, ?> node = new NodeImpl<>(java.util.UUID.randomUUID().toString()); node.setContent(view); final PropertyWriter propertyWriter = tested.toFlowElement(node); assertTrue(CallActivityPropertyWriter.class.isInstance(propertyWriter)); assertTrue(CustomElement.autoStart.of(propertyWriter.getFlowElement()).get()); } | public PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n) { CallActivity activity = bpmn2.createCallActivity(); activity.setId(n.getUUID()); CallActivityPropertyWriter p = propertyWriterFactory.of(activity); BaseReusableSubprocess definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); BaseReusableSubprocessTaskExecutionSet executionSet = definition.getExecutionSet(); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setCalledElement(replaceIllegalCharsAttribute(executionSet.getCalledElement().getValue())); p.setAsync(executionSet.getIsAsync().getValue()); p.setIndependent(executionSet.getIndependent().getValue()); if (Boolean.FALSE.equals(executionSet.getIndependent().getValue())) { p.setAbortParent(executionSet.getAbortParent().getValue()); } p.setWaitForCompletion(executionSet.getWaitForCompletion().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo()); if (Boolean.TRUE.equals(executionSet.getIsMultipleInstance().getValue())) { p.setIsSequential(executionSet.getMultipleInstanceExecutionMode().isSequential()); p.setCollectionInput(executionSet.getMultipleInstanceCollectionInput().getValue()); p.setInput(executionSet.getMultipleInstanceDataInput().getValue()); p.setCollectionOutput(executionSet.getMultipleInstanceCollectionOutput().getValue()); p.setOutput(executionSet.getMultipleInstanceDataOutput().getValue()); p.setCompletionCondition(executionSet.getMultipleInstanceCompletionCondition().getValue()); } p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); p.setCase(executionSet.getIsCase().getValue()); p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); return p; } | ReusableSubprocessConverter { public PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n) { CallActivity activity = bpmn2.createCallActivity(); activity.setId(n.getUUID()); CallActivityPropertyWriter p = propertyWriterFactory.of(activity); BaseReusableSubprocess definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); BaseReusableSubprocessTaskExecutionSet executionSet = definition.getExecutionSet(); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setCalledElement(replaceIllegalCharsAttribute(executionSet.getCalledElement().getValue())); p.setAsync(executionSet.getIsAsync().getValue()); p.setIndependent(executionSet.getIndependent().getValue()); if (Boolean.FALSE.equals(executionSet.getIndependent().getValue())) { p.setAbortParent(executionSet.getAbortParent().getValue()); } p.setWaitForCompletion(executionSet.getWaitForCompletion().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo()); if (Boolean.TRUE.equals(executionSet.getIsMultipleInstance().getValue())) { p.setIsSequential(executionSet.getMultipleInstanceExecutionMode().isSequential()); p.setCollectionInput(executionSet.getMultipleInstanceCollectionInput().getValue()); p.setInput(executionSet.getMultipleInstanceDataInput().getValue()); p.setCollectionOutput(executionSet.getMultipleInstanceCollectionOutput().getValue()); p.setOutput(executionSet.getMultipleInstanceDataOutput().getValue()); p.setCompletionCondition(executionSet.getMultipleInstanceCompletionCondition().getValue()); } p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); p.setCase(executionSet.getIsCase().getValue()); p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); return p; } } | ReusableSubprocessConverter { public PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n) { CallActivity activity = bpmn2.createCallActivity(); activity.setId(n.getUUID()); CallActivityPropertyWriter p = propertyWriterFactory.of(activity); BaseReusableSubprocess definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); BaseReusableSubprocessTaskExecutionSet executionSet = definition.getExecutionSet(); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setCalledElement(replaceIllegalCharsAttribute(executionSet.getCalledElement().getValue())); p.setAsync(executionSet.getIsAsync().getValue()); p.setIndependent(executionSet.getIndependent().getValue()); if (Boolean.FALSE.equals(executionSet.getIndependent().getValue())) { p.setAbortParent(executionSet.getAbortParent().getValue()); } p.setWaitForCompletion(executionSet.getWaitForCompletion().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo()); if (Boolean.TRUE.equals(executionSet.getIsMultipleInstance().getValue())) { p.setIsSequential(executionSet.getMultipleInstanceExecutionMode().isSequential()); p.setCollectionInput(executionSet.getMultipleInstanceCollectionInput().getValue()); p.setInput(executionSet.getMultipleInstanceDataInput().getValue()); p.setCollectionOutput(executionSet.getMultipleInstanceCollectionOutput().getValue()); p.setOutput(executionSet.getMultipleInstanceDataOutput().getValue()); p.setCompletionCondition(executionSet.getMultipleInstanceCompletionCondition().getValue()); } p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); p.setCase(executionSet.getIsCase().getValue()); p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); return p; } ReusableSubprocessConverter(PropertyWriterFactory propertyWriterFactory); } | ReusableSubprocessConverter { public PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n) { CallActivity activity = bpmn2.createCallActivity(); activity.setId(n.getUUID()); CallActivityPropertyWriter p = propertyWriterFactory.of(activity); BaseReusableSubprocess definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); BaseReusableSubprocessTaskExecutionSet executionSet = definition.getExecutionSet(); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setCalledElement(replaceIllegalCharsAttribute(executionSet.getCalledElement().getValue())); p.setAsync(executionSet.getIsAsync().getValue()); p.setIndependent(executionSet.getIndependent().getValue()); if (Boolean.FALSE.equals(executionSet.getIndependent().getValue())) { p.setAbortParent(executionSet.getAbortParent().getValue()); } p.setWaitForCompletion(executionSet.getWaitForCompletion().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo()); if (Boolean.TRUE.equals(executionSet.getIsMultipleInstance().getValue())) { p.setIsSequential(executionSet.getMultipleInstanceExecutionMode().isSequential()); p.setCollectionInput(executionSet.getMultipleInstanceCollectionInput().getValue()); p.setInput(executionSet.getMultipleInstanceDataInput().getValue()); p.setCollectionOutput(executionSet.getMultipleInstanceCollectionOutput().getValue()); p.setOutput(executionSet.getMultipleInstanceDataOutput().getValue()); p.setCompletionCondition(executionSet.getMultipleInstanceCompletionCondition().getValue()); } p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); p.setCase(executionSet.getIsCase().getValue()); p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); return p; } ReusableSubprocessConverter(PropertyWriterFactory propertyWriterFactory); PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n); } | ReusableSubprocessConverter { public PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n) { CallActivity activity = bpmn2.createCallActivity(); activity.setId(n.getUUID()); CallActivityPropertyWriter p = propertyWriterFactory.of(activity); BaseReusableSubprocess definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); BaseReusableSubprocessTaskExecutionSet executionSet = definition.getExecutionSet(); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setCalledElement(replaceIllegalCharsAttribute(executionSet.getCalledElement().getValue())); p.setAsync(executionSet.getIsAsync().getValue()); p.setIndependent(executionSet.getIndependent().getValue()); if (Boolean.FALSE.equals(executionSet.getIndependent().getValue())) { p.setAbortParent(executionSet.getAbortParent().getValue()); } p.setWaitForCompletion(executionSet.getWaitForCompletion().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo()); if (Boolean.TRUE.equals(executionSet.getIsMultipleInstance().getValue())) { p.setIsSequential(executionSet.getMultipleInstanceExecutionMode().isSequential()); p.setCollectionInput(executionSet.getMultipleInstanceCollectionInput().getValue()); p.setInput(executionSet.getMultipleInstanceDataInput().getValue()); p.setCollectionOutput(executionSet.getMultipleInstanceCollectionOutput().getValue()); p.setOutput(executionSet.getMultipleInstanceDataOutput().getValue()); p.setCompletionCondition(executionSet.getMultipleInstanceCompletionCondition().getValue()); } p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); p.setCase(executionSet.getIsCase().getValue()); p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); return p; } ReusableSubprocessConverter(PropertyWriterFactory propertyWriterFactory); PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n); } |
@Test public void testToFlowElement_notautostart() { final ReusableSubprocess definition = new ReusableSubprocess(); definition.getExecutionSet().setAdHocAutostart(new AdHocAutostart(false)); final View<BaseReusableSubprocess> view = new ViewImpl<>(definition, Bounds.create()); final Node<View<BaseReusableSubprocess>, ?> node = new NodeImpl<>(java.util.UUID.randomUUID().toString()); node.setContent(view); final PropertyWriter propertyWriter = tested.toFlowElement(node); assertTrue(CallActivityPropertyWriter.class.isInstance(propertyWriter)); assertFalse(CustomElement.autoStart.of(propertyWriter.getFlowElement()).get()); } | public PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n) { CallActivity activity = bpmn2.createCallActivity(); activity.setId(n.getUUID()); CallActivityPropertyWriter p = propertyWriterFactory.of(activity); BaseReusableSubprocess definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); BaseReusableSubprocessTaskExecutionSet executionSet = definition.getExecutionSet(); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setCalledElement(replaceIllegalCharsAttribute(executionSet.getCalledElement().getValue())); p.setAsync(executionSet.getIsAsync().getValue()); p.setIndependent(executionSet.getIndependent().getValue()); if (Boolean.FALSE.equals(executionSet.getIndependent().getValue())) { p.setAbortParent(executionSet.getAbortParent().getValue()); } p.setWaitForCompletion(executionSet.getWaitForCompletion().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo()); if (Boolean.TRUE.equals(executionSet.getIsMultipleInstance().getValue())) { p.setIsSequential(executionSet.getMultipleInstanceExecutionMode().isSequential()); p.setCollectionInput(executionSet.getMultipleInstanceCollectionInput().getValue()); p.setInput(executionSet.getMultipleInstanceDataInput().getValue()); p.setCollectionOutput(executionSet.getMultipleInstanceCollectionOutput().getValue()); p.setOutput(executionSet.getMultipleInstanceDataOutput().getValue()); p.setCompletionCondition(executionSet.getMultipleInstanceCompletionCondition().getValue()); } p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); p.setCase(executionSet.getIsCase().getValue()); p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); return p; } | ReusableSubprocessConverter { public PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n) { CallActivity activity = bpmn2.createCallActivity(); activity.setId(n.getUUID()); CallActivityPropertyWriter p = propertyWriterFactory.of(activity); BaseReusableSubprocess definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); BaseReusableSubprocessTaskExecutionSet executionSet = definition.getExecutionSet(); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setCalledElement(replaceIllegalCharsAttribute(executionSet.getCalledElement().getValue())); p.setAsync(executionSet.getIsAsync().getValue()); p.setIndependent(executionSet.getIndependent().getValue()); if (Boolean.FALSE.equals(executionSet.getIndependent().getValue())) { p.setAbortParent(executionSet.getAbortParent().getValue()); } p.setWaitForCompletion(executionSet.getWaitForCompletion().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo()); if (Boolean.TRUE.equals(executionSet.getIsMultipleInstance().getValue())) { p.setIsSequential(executionSet.getMultipleInstanceExecutionMode().isSequential()); p.setCollectionInput(executionSet.getMultipleInstanceCollectionInput().getValue()); p.setInput(executionSet.getMultipleInstanceDataInput().getValue()); p.setCollectionOutput(executionSet.getMultipleInstanceCollectionOutput().getValue()); p.setOutput(executionSet.getMultipleInstanceDataOutput().getValue()); p.setCompletionCondition(executionSet.getMultipleInstanceCompletionCondition().getValue()); } p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); p.setCase(executionSet.getIsCase().getValue()); p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); return p; } } | ReusableSubprocessConverter { public PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n) { CallActivity activity = bpmn2.createCallActivity(); activity.setId(n.getUUID()); CallActivityPropertyWriter p = propertyWriterFactory.of(activity); BaseReusableSubprocess definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); BaseReusableSubprocessTaskExecutionSet executionSet = definition.getExecutionSet(); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setCalledElement(replaceIllegalCharsAttribute(executionSet.getCalledElement().getValue())); p.setAsync(executionSet.getIsAsync().getValue()); p.setIndependent(executionSet.getIndependent().getValue()); if (Boolean.FALSE.equals(executionSet.getIndependent().getValue())) { p.setAbortParent(executionSet.getAbortParent().getValue()); } p.setWaitForCompletion(executionSet.getWaitForCompletion().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo()); if (Boolean.TRUE.equals(executionSet.getIsMultipleInstance().getValue())) { p.setIsSequential(executionSet.getMultipleInstanceExecutionMode().isSequential()); p.setCollectionInput(executionSet.getMultipleInstanceCollectionInput().getValue()); p.setInput(executionSet.getMultipleInstanceDataInput().getValue()); p.setCollectionOutput(executionSet.getMultipleInstanceCollectionOutput().getValue()); p.setOutput(executionSet.getMultipleInstanceDataOutput().getValue()); p.setCompletionCondition(executionSet.getMultipleInstanceCompletionCondition().getValue()); } p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); p.setCase(executionSet.getIsCase().getValue()); p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); return p; } ReusableSubprocessConverter(PropertyWriterFactory propertyWriterFactory); } | ReusableSubprocessConverter { public PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n) { CallActivity activity = bpmn2.createCallActivity(); activity.setId(n.getUUID()); CallActivityPropertyWriter p = propertyWriterFactory.of(activity); BaseReusableSubprocess definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); BaseReusableSubprocessTaskExecutionSet executionSet = definition.getExecutionSet(); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setCalledElement(replaceIllegalCharsAttribute(executionSet.getCalledElement().getValue())); p.setAsync(executionSet.getIsAsync().getValue()); p.setIndependent(executionSet.getIndependent().getValue()); if (Boolean.FALSE.equals(executionSet.getIndependent().getValue())) { p.setAbortParent(executionSet.getAbortParent().getValue()); } p.setWaitForCompletion(executionSet.getWaitForCompletion().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo()); if (Boolean.TRUE.equals(executionSet.getIsMultipleInstance().getValue())) { p.setIsSequential(executionSet.getMultipleInstanceExecutionMode().isSequential()); p.setCollectionInput(executionSet.getMultipleInstanceCollectionInput().getValue()); p.setInput(executionSet.getMultipleInstanceDataInput().getValue()); p.setCollectionOutput(executionSet.getMultipleInstanceCollectionOutput().getValue()); p.setOutput(executionSet.getMultipleInstanceDataOutput().getValue()); p.setCompletionCondition(executionSet.getMultipleInstanceCompletionCondition().getValue()); } p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); p.setCase(executionSet.getIsCase().getValue()); p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); return p; } ReusableSubprocessConverter(PropertyWriterFactory propertyWriterFactory); PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n); } | ReusableSubprocessConverter { public PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n) { CallActivity activity = bpmn2.createCallActivity(); activity.setId(n.getUUID()); CallActivityPropertyWriter p = propertyWriterFactory.of(activity); BaseReusableSubprocess definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); BaseReusableSubprocessTaskExecutionSet executionSet = definition.getExecutionSet(); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setCalledElement(replaceIllegalCharsAttribute(executionSet.getCalledElement().getValue())); p.setAsync(executionSet.getIsAsync().getValue()); p.setIndependent(executionSet.getIndependent().getValue()); if (Boolean.FALSE.equals(executionSet.getIndependent().getValue())) { p.setAbortParent(executionSet.getAbortParent().getValue()); } p.setWaitForCompletion(executionSet.getWaitForCompletion().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo()); if (Boolean.TRUE.equals(executionSet.getIsMultipleInstance().getValue())) { p.setIsSequential(executionSet.getMultipleInstanceExecutionMode().isSequential()); p.setCollectionInput(executionSet.getMultipleInstanceCollectionInput().getValue()); p.setInput(executionSet.getMultipleInstanceDataInput().getValue()); p.setCollectionOutput(executionSet.getMultipleInstanceCollectionOutput().getValue()); p.setOutput(executionSet.getMultipleInstanceDataOutput().getValue()); p.setCompletionCondition(executionSet.getMultipleInstanceCompletionCondition().getValue()); } p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); p.setCase(executionSet.getIsCase().getValue()); p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); return p; } ReusableSubprocessConverter(PropertyWriterFactory propertyWriterFactory); PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n); } |
@Test public void testToFlowElement() { final ReusableSubprocess definition = new ReusableSubprocess(); definition.getExecutionSet().setSlaDueDate(new SLADueDate(SLA_DUE_DATE)); definition.getExecutionSet().setIsAsync(new IsAsync(Boolean.TRUE)); final View<BaseReusableSubprocess> view = new ViewImpl<>(definition, Bounds.create()); final Node<View<BaseReusableSubprocess>, ?> node = new NodeImpl<>(java.util.UUID.randomUUID().toString()); node.setContent(view); final PropertyWriter propertyWriter = tested.toFlowElement(node); assertTrue(CallActivityPropertyWriter.class.isInstance(propertyWriter)); assertTrue(CustomElement.async.of(propertyWriter.getFlowElement()).get()); assertTrue(CallActivityPropertyWriter.class.isInstance(propertyWriter)); assertTrue(CustomElement.slaDueDate.of(propertyWriter.getFlowElement()).get().contains(SLA_DUE_DATE)); } | public PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n) { CallActivity activity = bpmn2.createCallActivity(); activity.setId(n.getUUID()); CallActivityPropertyWriter p = propertyWriterFactory.of(activity); BaseReusableSubprocess definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); BaseReusableSubprocessTaskExecutionSet executionSet = definition.getExecutionSet(); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setCalledElement(replaceIllegalCharsAttribute(executionSet.getCalledElement().getValue())); p.setAsync(executionSet.getIsAsync().getValue()); p.setIndependent(executionSet.getIndependent().getValue()); if (Boolean.FALSE.equals(executionSet.getIndependent().getValue())) { p.setAbortParent(executionSet.getAbortParent().getValue()); } p.setWaitForCompletion(executionSet.getWaitForCompletion().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo()); if (Boolean.TRUE.equals(executionSet.getIsMultipleInstance().getValue())) { p.setIsSequential(executionSet.getMultipleInstanceExecutionMode().isSequential()); p.setCollectionInput(executionSet.getMultipleInstanceCollectionInput().getValue()); p.setInput(executionSet.getMultipleInstanceDataInput().getValue()); p.setCollectionOutput(executionSet.getMultipleInstanceCollectionOutput().getValue()); p.setOutput(executionSet.getMultipleInstanceDataOutput().getValue()); p.setCompletionCondition(executionSet.getMultipleInstanceCompletionCondition().getValue()); } p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); p.setCase(executionSet.getIsCase().getValue()); p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); return p; } | ReusableSubprocessConverter { public PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n) { CallActivity activity = bpmn2.createCallActivity(); activity.setId(n.getUUID()); CallActivityPropertyWriter p = propertyWriterFactory.of(activity); BaseReusableSubprocess definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); BaseReusableSubprocessTaskExecutionSet executionSet = definition.getExecutionSet(); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setCalledElement(replaceIllegalCharsAttribute(executionSet.getCalledElement().getValue())); p.setAsync(executionSet.getIsAsync().getValue()); p.setIndependent(executionSet.getIndependent().getValue()); if (Boolean.FALSE.equals(executionSet.getIndependent().getValue())) { p.setAbortParent(executionSet.getAbortParent().getValue()); } p.setWaitForCompletion(executionSet.getWaitForCompletion().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo()); if (Boolean.TRUE.equals(executionSet.getIsMultipleInstance().getValue())) { p.setIsSequential(executionSet.getMultipleInstanceExecutionMode().isSequential()); p.setCollectionInput(executionSet.getMultipleInstanceCollectionInput().getValue()); p.setInput(executionSet.getMultipleInstanceDataInput().getValue()); p.setCollectionOutput(executionSet.getMultipleInstanceCollectionOutput().getValue()); p.setOutput(executionSet.getMultipleInstanceDataOutput().getValue()); p.setCompletionCondition(executionSet.getMultipleInstanceCompletionCondition().getValue()); } p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); p.setCase(executionSet.getIsCase().getValue()); p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); return p; } } | ReusableSubprocessConverter { public PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n) { CallActivity activity = bpmn2.createCallActivity(); activity.setId(n.getUUID()); CallActivityPropertyWriter p = propertyWriterFactory.of(activity); BaseReusableSubprocess definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); BaseReusableSubprocessTaskExecutionSet executionSet = definition.getExecutionSet(); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setCalledElement(replaceIllegalCharsAttribute(executionSet.getCalledElement().getValue())); p.setAsync(executionSet.getIsAsync().getValue()); p.setIndependent(executionSet.getIndependent().getValue()); if (Boolean.FALSE.equals(executionSet.getIndependent().getValue())) { p.setAbortParent(executionSet.getAbortParent().getValue()); } p.setWaitForCompletion(executionSet.getWaitForCompletion().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo()); if (Boolean.TRUE.equals(executionSet.getIsMultipleInstance().getValue())) { p.setIsSequential(executionSet.getMultipleInstanceExecutionMode().isSequential()); p.setCollectionInput(executionSet.getMultipleInstanceCollectionInput().getValue()); p.setInput(executionSet.getMultipleInstanceDataInput().getValue()); p.setCollectionOutput(executionSet.getMultipleInstanceCollectionOutput().getValue()); p.setOutput(executionSet.getMultipleInstanceDataOutput().getValue()); p.setCompletionCondition(executionSet.getMultipleInstanceCompletionCondition().getValue()); } p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); p.setCase(executionSet.getIsCase().getValue()); p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); return p; } ReusableSubprocessConverter(PropertyWriterFactory propertyWriterFactory); } | ReusableSubprocessConverter { public PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n) { CallActivity activity = bpmn2.createCallActivity(); activity.setId(n.getUUID()); CallActivityPropertyWriter p = propertyWriterFactory.of(activity); BaseReusableSubprocess definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); BaseReusableSubprocessTaskExecutionSet executionSet = definition.getExecutionSet(); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setCalledElement(replaceIllegalCharsAttribute(executionSet.getCalledElement().getValue())); p.setAsync(executionSet.getIsAsync().getValue()); p.setIndependent(executionSet.getIndependent().getValue()); if (Boolean.FALSE.equals(executionSet.getIndependent().getValue())) { p.setAbortParent(executionSet.getAbortParent().getValue()); } p.setWaitForCompletion(executionSet.getWaitForCompletion().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo()); if (Boolean.TRUE.equals(executionSet.getIsMultipleInstance().getValue())) { p.setIsSequential(executionSet.getMultipleInstanceExecutionMode().isSequential()); p.setCollectionInput(executionSet.getMultipleInstanceCollectionInput().getValue()); p.setInput(executionSet.getMultipleInstanceDataInput().getValue()); p.setCollectionOutput(executionSet.getMultipleInstanceCollectionOutput().getValue()); p.setOutput(executionSet.getMultipleInstanceDataOutput().getValue()); p.setCompletionCondition(executionSet.getMultipleInstanceCompletionCondition().getValue()); } p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); p.setCase(executionSet.getIsCase().getValue()); p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); return p; } ReusableSubprocessConverter(PropertyWriterFactory propertyWriterFactory); PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n); } | ReusableSubprocessConverter { public PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n) { CallActivity activity = bpmn2.createCallActivity(); activity.setId(n.getUUID()); CallActivityPropertyWriter p = propertyWriterFactory.of(activity); BaseReusableSubprocess definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); BaseReusableSubprocessTaskExecutionSet executionSet = definition.getExecutionSet(); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setCalledElement(replaceIllegalCharsAttribute(executionSet.getCalledElement().getValue())); p.setAsync(executionSet.getIsAsync().getValue()); p.setIndependent(executionSet.getIndependent().getValue()); if (Boolean.FALSE.equals(executionSet.getIndependent().getValue())) { p.setAbortParent(executionSet.getAbortParent().getValue()); } p.setWaitForCompletion(executionSet.getWaitForCompletion().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo()); if (Boolean.TRUE.equals(executionSet.getIsMultipleInstance().getValue())) { p.setIsSequential(executionSet.getMultipleInstanceExecutionMode().isSequential()); p.setCollectionInput(executionSet.getMultipleInstanceCollectionInput().getValue()); p.setInput(executionSet.getMultipleInstanceDataInput().getValue()); p.setCollectionOutput(executionSet.getMultipleInstanceCollectionOutput().getValue()); p.setOutput(executionSet.getMultipleInstanceDataOutput().getValue()); p.setCompletionCondition(executionSet.getMultipleInstanceCompletionCondition().getValue()); } p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); p.setCase(executionSet.getIsCase().getValue()); p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); return p; } ReusableSubprocessConverter(PropertyWriterFactory propertyWriterFactory); PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n); } |
@Test public void toTextAnnotationElement() { textAnnotation = new TextAnnotation(); textAnnotation.getGeneral().getDocumentation().setValue(DOC); textAnnotation.getGeneral().getName().setValue(NAME); textAnnotationNode = new NodeImpl<>(UUID.uuid()); textAnnotationNode.setContent(textAnnotationView); when(textAnnotationView.getDefinition()).thenReturn(textAnnotation); when(propertyWriterFactory.of(any(org.eclipse.bpmn2.TextAnnotation.class))).thenReturn(textAnnotationWriter); artifactsConverter = new ArtifactsConverter(propertyWriterFactory); PropertyWriter propertyWriter = artifactsConverter.toElement(((NodeImpl) textAnnotationNode)); verify(textAnnotationWriter).setName(NAME); verify(textAnnotationWriter).setDocumentation(DOC); verify(textAnnotationWriter).setAbsoluteBounds(textAnnotationNode); assertEquals(textAnnotationWriter, propertyWriter); } | public PropertyWriter toElement(Node<View<BaseArtifacts>, ?> node) { return NodeMatch.fromNode(BaseArtifacts.class, PropertyWriter.class) .when(TextAnnotation.class, this::toTextAnnotation) .when(DataObject.class, this::toDataObjectAnnotation) .ignore(Object.class) .apply(node) .value(); } | ArtifactsConverter { public PropertyWriter toElement(Node<View<BaseArtifacts>, ?> node) { return NodeMatch.fromNode(BaseArtifacts.class, PropertyWriter.class) .when(TextAnnotation.class, this::toTextAnnotation) .when(DataObject.class, this::toDataObjectAnnotation) .ignore(Object.class) .apply(node) .value(); } } | ArtifactsConverter { public PropertyWriter toElement(Node<View<BaseArtifacts>, ?> node) { return NodeMatch.fromNode(BaseArtifacts.class, PropertyWriter.class) .when(TextAnnotation.class, this::toTextAnnotation) .when(DataObject.class, this::toDataObjectAnnotation) .ignore(Object.class) .apply(node) .value(); } ArtifactsConverter(PropertyWriterFactory propertyWriterFactory); } | ArtifactsConverter { public PropertyWriter toElement(Node<View<BaseArtifacts>, ?> node) { return NodeMatch.fromNode(BaseArtifacts.class, PropertyWriter.class) .when(TextAnnotation.class, this::toTextAnnotation) .when(DataObject.class, this::toDataObjectAnnotation) .ignore(Object.class) .apply(node) .value(); } ArtifactsConverter(PropertyWriterFactory propertyWriterFactory); PropertyWriter toElement(Node<View<BaseArtifacts>, ?> node); } | ArtifactsConverter { public PropertyWriter toElement(Node<View<BaseArtifacts>, ?> node) { return NodeMatch.fromNode(BaseArtifacts.class, PropertyWriter.class) .when(TextAnnotation.class, this::toTextAnnotation) .when(DataObject.class, this::toDataObjectAnnotation) .ignore(Object.class) .apply(node) .value(); } ArtifactsConverter(PropertyWriterFactory propertyWriterFactory); PropertyWriter toElement(Node<View<BaseArtifacts>, ?> node); } |
@Test public void toDataObjectElement() { dataObject = new DataObject(); dataObject.getGeneral().getDocumentation().setValue(DOC); dataObject.setName(new Name(NAME)); dataObject.setType(new DataObjectType(new DataObjectTypeValue(NAME))); dataObjectNode = new NodeImpl<>(UUID.uuid()); dataObjectNode.setContent(dataObjectView); when(dataObjectView.getDefinition()).thenReturn(dataObject); when(propertyWriterFactory.of(any(org.eclipse.bpmn2.DataObjectReference.class))).thenReturn(dataObjectWriter); artifactsConverter = new ArtifactsConverter(propertyWriterFactory); PropertyWriter propertyWriter = artifactsConverter.toElement(((NodeImpl) dataObjectNode)); verify(dataObjectWriter).setName(NAME); verify(dataObjectWriter).setType(NAME); verify(dataObjectWriter).setAbsoluteBounds(dataObjectNode); assertEquals(dataObjectWriter, propertyWriter); } | public PropertyWriter toElement(Node<View<BaseArtifacts>, ?> node) { return NodeMatch.fromNode(BaseArtifacts.class, PropertyWriter.class) .when(TextAnnotation.class, this::toTextAnnotation) .when(DataObject.class, this::toDataObjectAnnotation) .ignore(Object.class) .apply(node) .value(); } | ArtifactsConverter { public PropertyWriter toElement(Node<View<BaseArtifacts>, ?> node) { return NodeMatch.fromNode(BaseArtifacts.class, PropertyWriter.class) .when(TextAnnotation.class, this::toTextAnnotation) .when(DataObject.class, this::toDataObjectAnnotation) .ignore(Object.class) .apply(node) .value(); } } | ArtifactsConverter { public PropertyWriter toElement(Node<View<BaseArtifacts>, ?> node) { return NodeMatch.fromNode(BaseArtifacts.class, PropertyWriter.class) .when(TextAnnotation.class, this::toTextAnnotation) .when(DataObject.class, this::toDataObjectAnnotation) .ignore(Object.class) .apply(node) .value(); } ArtifactsConverter(PropertyWriterFactory propertyWriterFactory); } | ArtifactsConverter { public PropertyWriter toElement(Node<View<BaseArtifacts>, ?> node) { return NodeMatch.fromNode(BaseArtifacts.class, PropertyWriter.class) .when(TextAnnotation.class, this::toTextAnnotation) .when(DataObject.class, this::toDataObjectAnnotation) .ignore(Object.class) .apply(node) .value(); } ArtifactsConverter(PropertyWriterFactory propertyWriterFactory); PropertyWriter toElement(Node<View<BaseArtifacts>, ?> node); } | ArtifactsConverter { public PropertyWriter toElement(Node<View<BaseArtifacts>, ?> node) { return NodeMatch.fromNode(BaseArtifacts.class, PropertyWriter.class) .when(TextAnnotation.class, this::toTextAnnotation) .when(DataObject.class, this::toDataObjectAnnotation) .ignore(Object.class) .apply(node) .value(); } ArtifactsConverter(PropertyWriterFactory propertyWriterFactory); PropertyWriter toElement(Node<View<BaseArtifacts>, ?> node); } |
@Test public void testToFlowElementSuccess() { org.kie.workbench.common.stunner.bpmn.definition.Association association = new org.kie.workbench.common.stunner.bpmn.definition.DirectionalAssociation(); association.setGeneral(new BPMNGeneralSet("nameValue", "documentationValue")); when(connector.getDefinition()).thenReturn(association); Result<BasePropertyWriter> result = converter.toFlowElement(edge, process); assertTrue(result.isSuccess()); verify(propertyWriterFactory).of(argumentCaptor.capture()); assertEquals(EDGE_ID, argumentCaptor.getValue().getId()); verify(associationPropertyWriter).setSource(pSrc); verify(associationPropertyWriter).setTarget(pTgt); verify(associationPropertyWriter).setConnection(connector); verify(associationPropertyWriter).setDocumentation("documentationValue"); verify(associationPropertyWriter).setDirectionAssociation(association); } | public Result<BasePropertyWriter> toFlowElement(Edge<?, ?> edge, ElementContainer process) { ViewConnector<Association> connector = (ViewConnector<Association>) edge.getContent(); Association definition = connector.getDefinition(); org.eclipse.bpmn2.Association association = bpmn2.createAssociation(); AssociationPropertyWriter p = propertyWriterFactory.of(association); association.setId(edge.getUUID()); BasePropertyWriter pSrc = process.getChildElement(edge.getSourceNode().getUUID()); BasePropertyWriter pTgt = process.getChildElement(edge.getTargetNode().getUUID()); if (pSrc == null || pTgt == null) { String msg = String.format("BasePropertyWriter was not found for source node or target node at edge: %s, pSrc = %s, pTgt = %s", edge.getUUID(), pSrc, pTgt); LOG.debug(msg); return Result.failure(msg); } p.setSource(pSrc); p.setTarget(pTgt); p.setConnection(connector); BPMNGeneralSet general = definition.getGeneral(); p.setDocumentation(general.getDocumentation().getValue()); p.setDirectionAssociation(definition); return Result.of(p); } | AssociationConverter { public Result<BasePropertyWriter> toFlowElement(Edge<?, ?> edge, ElementContainer process) { ViewConnector<Association> connector = (ViewConnector<Association>) edge.getContent(); Association definition = connector.getDefinition(); org.eclipse.bpmn2.Association association = bpmn2.createAssociation(); AssociationPropertyWriter p = propertyWriterFactory.of(association); association.setId(edge.getUUID()); BasePropertyWriter pSrc = process.getChildElement(edge.getSourceNode().getUUID()); BasePropertyWriter pTgt = process.getChildElement(edge.getTargetNode().getUUID()); if (pSrc == null || pTgt == null) { String msg = String.format("BasePropertyWriter was not found for source node or target node at edge: %s, pSrc = %s, pTgt = %s", edge.getUUID(), pSrc, pTgt); LOG.debug(msg); return Result.failure(msg); } p.setSource(pSrc); p.setTarget(pTgt); p.setConnection(connector); BPMNGeneralSet general = definition.getGeneral(); p.setDocumentation(general.getDocumentation().getValue()); p.setDirectionAssociation(definition); return Result.of(p); } } | AssociationConverter { public Result<BasePropertyWriter> toFlowElement(Edge<?, ?> edge, ElementContainer process) { ViewConnector<Association> connector = (ViewConnector<Association>) edge.getContent(); Association definition = connector.getDefinition(); org.eclipse.bpmn2.Association association = bpmn2.createAssociation(); AssociationPropertyWriter p = propertyWriterFactory.of(association); association.setId(edge.getUUID()); BasePropertyWriter pSrc = process.getChildElement(edge.getSourceNode().getUUID()); BasePropertyWriter pTgt = process.getChildElement(edge.getTargetNode().getUUID()); if (pSrc == null || pTgt == null) { String msg = String.format("BasePropertyWriter was not found for source node or target node at edge: %s, pSrc = %s, pTgt = %s", edge.getUUID(), pSrc, pTgt); LOG.debug(msg); return Result.failure(msg); } p.setSource(pSrc); p.setTarget(pTgt); p.setConnection(connector); BPMNGeneralSet general = definition.getGeneral(); p.setDocumentation(general.getDocumentation().getValue()); p.setDirectionAssociation(definition); return Result.of(p); } AssociationConverter(PropertyWriterFactory propertyWriterFactory); } | AssociationConverter { public Result<BasePropertyWriter> toFlowElement(Edge<?, ?> edge, ElementContainer process) { ViewConnector<Association> connector = (ViewConnector<Association>) edge.getContent(); Association definition = connector.getDefinition(); org.eclipse.bpmn2.Association association = bpmn2.createAssociation(); AssociationPropertyWriter p = propertyWriterFactory.of(association); association.setId(edge.getUUID()); BasePropertyWriter pSrc = process.getChildElement(edge.getSourceNode().getUUID()); BasePropertyWriter pTgt = process.getChildElement(edge.getTargetNode().getUUID()); if (pSrc == null || pTgt == null) { String msg = String.format("BasePropertyWriter was not found for source node or target node at edge: %s, pSrc = %s, pTgt = %s", edge.getUUID(), pSrc, pTgt); LOG.debug(msg); return Result.failure(msg); } p.setSource(pSrc); p.setTarget(pTgt); p.setConnection(connector); BPMNGeneralSet general = definition.getGeneral(); p.setDocumentation(general.getDocumentation().getValue()); p.setDirectionAssociation(definition); return Result.of(p); } AssociationConverter(PropertyWriterFactory propertyWriterFactory); Result<BasePropertyWriter> toFlowElement(Edge<?, ?> edge, ElementContainer process); } | AssociationConverter { public Result<BasePropertyWriter> toFlowElement(Edge<?, ?> edge, ElementContainer process) { ViewConnector<Association> connector = (ViewConnector<Association>) edge.getContent(); Association definition = connector.getDefinition(); org.eclipse.bpmn2.Association association = bpmn2.createAssociation(); AssociationPropertyWriter p = propertyWriterFactory.of(association); association.setId(edge.getUUID()); BasePropertyWriter pSrc = process.getChildElement(edge.getSourceNode().getUUID()); BasePropertyWriter pTgt = process.getChildElement(edge.getTargetNode().getUUID()); if (pSrc == null || pTgt == null) { String msg = String.format("BasePropertyWriter was not found for source node or target node at edge: %s, pSrc = %s, pTgt = %s", edge.getUUID(), pSrc, pTgt); LOG.debug(msg); return Result.failure(msg); } p.setSource(pSrc); p.setTarget(pTgt); p.setConnection(connector); BPMNGeneralSet general = definition.getGeneral(); p.setDocumentation(general.getDocumentation().getValue()); p.setDirectionAssociation(definition); return Result.of(p); } AssociationConverter(PropertyWriterFactory propertyWriterFactory); Result<BasePropertyWriter> toFlowElement(Edge<?, ?> edge, ElementContainer process); } |
@Test public void testToFlowElementWithSourceMissingFailure() { when(process.getChildElement(SOURCE_NODE_ID)).thenReturn(null); Result<BasePropertyWriter> result = converter.toFlowElement(edge, process); verifyFailure(String.format(ERROR_PATTERN, EDGE_ID, null, pTgt), result); } | public Result<BasePropertyWriter> toFlowElement(Edge<?, ?> edge, ElementContainer process) { ViewConnector<Association> connector = (ViewConnector<Association>) edge.getContent(); Association definition = connector.getDefinition(); org.eclipse.bpmn2.Association association = bpmn2.createAssociation(); AssociationPropertyWriter p = propertyWriterFactory.of(association); association.setId(edge.getUUID()); BasePropertyWriter pSrc = process.getChildElement(edge.getSourceNode().getUUID()); BasePropertyWriter pTgt = process.getChildElement(edge.getTargetNode().getUUID()); if (pSrc == null || pTgt == null) { String msg = String.format("BasePropertyWriter was not found for source node or target node at edge: %s, pSrc = %s, pTgt = %s", edge.getUUID(), pSrc, pTgt); LOG.debug(msg); return Result.failure(msg); } p.setSource(pSrc); p.setTarget(pTgt); p.setConnection(connector); BPMNGeneralSet general = definition.getGeneral(); p.setDocumentation(general.getDocumentation().getValue()); p.setDirectionAssociation(definition); return Result.of(p); } | AssociationConverter { public Result<BasePropertyWriter> toFlowElement(Edge<?, ?> edge, ElementContainer process) { ViewConnector<Association> connector = (ViewConnector<Association>) edge.getContent(); Association definition = connector.getDefinition(); org.eclipse.bpmn2.Association association = bpmn2.createAssociation(); AssociationPropertyWriter p = propertyWriterFactory.of(association); association.setId(edge.getUUID()); BasePropertyWriter pSrc = process.getChildElement(edge.getSourceNode().getUUID()); BasePropertyWriter pTgt = process.getChildElement(edge.getTargetNode().getUUID()); if (pSrc == null || pTgt == null) { String msg = String.format("BasePropertyWriter was not found for source node or target node at edge: %s, pSrc = %s, pTgt = %s", edge.getUUID(), pSrc, pTgt); LOG.debug(msg); return Result.failure(msg); } p.setSource(pSrc); p.setTarget(pTgt); p.setConnection(connector); BPMNGeneralSet general = definition.getGeneral(); p.setDocumentation(general.getDocumentation().getValue()); p.setDirectionAssociation(definition); return Result.of(p); } } | AssociationConverter { public Result<BasePropertyWriter> toFlowElement(Edge<?, ?> edge, ElementContainer process) { ViewConnector<Association> connector = (ViewConnector<Association>) edge.getContent(); Association definition = connector.getDefinition(); org.eclipse.bpmn2.Association association = bpmn2.createAssociation(); AssociationPropertyWriter p = propertyWriterFactory.of(association); association.setId(edge.getUUID()); BasePropertyWriter pSrc = process.getChildElement(edge.getSourceNode().getUUID()); BasePropertyWriter pTgt = process.getChildElement(edge.getTargetNode().getUUID()); if (pSrc == null || pTgt == null) { String msg = String.format("BasePropertyWriter was not found for source node or target node at edge: %s, pSrc = %s, pTgt = %s", edge.getUUID(), pSrc, pTgt); LOG.debug(msg); return Result.failure(msg); } p.setSource(pSrc); p.setTarget(pTgt); p.setConnection(connector); BPMNGeneralSet general = definition.getGeneral(); p.setDocumentation(general.getDocumentation().getValue()); p.setDirectionAssociation(definition); return Result.of(p); } AssociationConverter(PropertyWriterFactory propertyWriterFactory); } | AssociationConverter { public Result<BasePropertyWriter> toFlowElement(Edge<?, ?> edge, ElementContainer process) { ViewConnector<Association> connector = (ViewConnector<Association>) edge.getContent(); Association definition = connector.getDefinition(); org.eclipse.bpmn2.Association association = bpmn2.createAssociation(); AssociationPropertyWriter p = propertyWriterFactory.of(association); association.setId(edge.getUUID()); BasePropertyWriter pSrc = process.getChildElement(edge.getSourceNode().getUUID()); BasePropertyWriter pTgt = process.getChildElement(edge.getTargetNode().getUUID()); if (pSrc == null || pTgt == null) { String msg = String.format("BasePropertyWriter was not found for source node or target node at edge: %s, pSrc = %s, pTgt = %s", edge.getUUID(), pSrc, pTgt); LOG.debug(msg); return Result.failure(msg); } p.setSource(pSrc); p.setTarget(pTgt); p.setConnection(connector); BPMNGeneralSet general = definition.getGeneral(); p.setDocumentation(general.getDocumentation().getValue()); p.setDirectionAssociation(definition); return Result.of(p); } AssociationConverter(PropertyWriterFactory propertyWriterFactory); Result<BasePropertyWriter> toFlowElement(Edge<?, ?> edge, ElementContainer process); } | AssociationConverter { public Result<BasePropertyWriter> toFlowElement(Edge<?, ?> edge, ElementContainer process) { ViewConnector<Association> connector = (ViewConnector<Association>) edge.getContent(); Association definition = connector.getDefinition(); org.eclipse.bpmn2.Association association = bpmn2.createAssociation(); AssociationPropertyWriter p = propertyWriterFactory.of(association); association.setId(edge.getUUID()); BasePropertyWriter pSrc = process.getChildElement(edge.getSourceNode().getUUID()); BasePropertyWriter pTgt = process.getChildElement(edge.getTargetNode().getUUID()); if (pSrc == null || pTgt == null) { String msg = String.format("BasePropertyWriter was not found for source node or target node at edge: %s, pSrc = %s, pTgt = %s", edge.getUUID(), pSrc, pTgt); LOG.debug(msg); return Result.failure(msg); } p.setSource(pSrc); p.setTarget(pTgt); p.setConnection(connector); BPMNGeneralSet general = definition.getGeneral(); p.setDocumentation(general.getDocumentation().getValue()); p.setDirectionAssociation(definition); return Result.of(p); } AssociationConverter(PropertyWriterFactory propertyWriterFactory); Result<BasePropertyWriter> toFlowElement(Edge<?, ?> edge, ElementContainer process); } |
@Test public void testToFlowElementWithTargetMissingFailure() { when(process.getChildElement(TARGET_NODE_ID)).thenReturn(null); Result<BasePropertyWriter> result = converter.toFlowElement(edge, process); verifyFailure(String.format(ERROR_PATTERN, EDGE_ID, pSrc, null), result); } | public Result<BasePropertyWriter> toFlowElement(Edge<?, ?> edge, ElementContainer process) { ViewConnector<Association> connector = (ViewConnector<Association>) edge.getContent(); Association definition = connector.getDefinition(); org.eclipse.bpmn2.Association association = bpmn2.createAssociation(); AssociationPropertyWriter p = propertyWriterFactory.of(association); association.setId(edge.getUUID()); BasePropertyWriter pSrc = process.getChildElement(edge.getSourceNode().getUUID()); BasePropertyWriter pTgt = process.getChildElement(edge.getTargetNode().getUUID()); if (pSrc == null || pTgt == null) { String msg = String.format("BasePropertyWriter was not found for source node or target node at edge: %s, pSrc = %s, pTgt = %s", edge.getUUID(), pSrc, pTgt); LOG.debug(msg); return Result.failure(msg); } p.setSource(pSrc); p.setTarget(pTgt); p.setConnection(connector); BPMNGeneralSet general = definition.getGeneral(); p.setDocumentation(general.getDocumentation().getValue()); p.setDirectionAssociation(definition); return Result.of(p); } | AssociationConverter { public Result<BasePropertyWriter> toFlowElement(Edge<?, ?> edge, ElementContainer process) { ViewConnector<Association> connector = (ViewConnector<Association>) edge.getContent(); Association definition = connector.getDefinition(); org.eclipse.bpmn2.Association association = bpmn2.createAssociation(); AssociationPropertyWriter p = propertyWriterFactory.of(association); association.setId(edge.getUUID()); BasePropertyWriter pSrc = process.getChildElement(edge.getSourceNode().getUUID()); BasePropertyWriter pTgt = process.getChildElement(edge.getTargetNode().getUUID()); if (pSrc == null || pTgt == null) { String msg = String.format("BasePropertyWriter was not found for source node or target node at edge: %s, pSrc = %s, pTgt = %s", edge.getUUID(), pSrc, pTgt); LOG.debug(msg); return Result.failure(msg); } p.setSource(pSrc); p.setTarget(pTgt); p.setConnection(connector); BPMNGeneralSet general = definition.getGeneral(); p.setDocumentation(general.getDocumentation().getValue()); p.setDirectionAssociation(definition); return Result.of(p); } } | AssociationConverter { public Result<BasePropertyWriter> toFlowElement(Edge<?, ?> edge, ElementContainer process) { ViewConnector<Association> connector = (ViewConnector<Association>) edge.getContent(); Association definition = connector.getDefinition(); org.eclipse.bpmn2.Association association = bpmn2.createAssociation(); AssociationPropertyWriter p = propertyWriterFactory.of(association); association.setId(edge.getUUID()); BasePropertyWriter pSrc = process.getChildElement(edge.getSourceNode().getUUID()); BasePropertyWriter pTgt = process.getChildElement(edge.getTargetNode().getUUID()); if (pSrc == null || pTgt == null) { String msg = String.format("BasePropertyWriter was not found for source node or target node at edge: %s, pSrc = %s, pTgt = %s", edge.getUUID(), pSrc, pTgt); LOG.debug(msg); return Result.failure(msg); } p.setSource(pSrc); p.setTarget(pTgt); p.setConnection(connector); BPMNGeneralSet general = definition.getGeneral(); p.setDocumentation(general.getDocumentation().getValue()); p.setDirectionAssociation(definition); return Result.of(p); } AssociationConverter(PropertyWriterFactory propertyWriterFactory); } | AssociationConverter { public Result<BasePropertyWriter> toFlowElement(Edge<?, ?> edge, ElementContainer process) { ViewConnector<Association> connector = (ViewConnector<Association>) edge.getContent(); Association definition = connector.getDefinition(); org.eclipse.bpmn2.Association association = bpmn2.createAssociation(); AssociationPropertyWriter p = propertyWriterFactory.of(association); association.setId(edge.getUUID()); BasePropertyWriter pSrc = process.getChildElement(edge.getSourceNode().getUUID()); BasePropertyWriter pTgt = process.getChildElement(edge.getTargetNode().getUUID()); if (pSrc == null || pTgt == null) { String msg = String.format("BasePropertyWriter was not found for source node or target node at edge: %s, pSrc = %s, pTgt = %s", edge.getUUID(), pSrc, pTgt); LOG.debug(msg); return Result.failure(msg); } p.setSource(pSrc); p.setTarget(pTgt); p.setConnection(connector); BPMNGeneralSet general = definition.getGeneral(); p.setDocumentation(general.getDocumentation().getValue()); p.setDirectionAssociation(definition); return Result.of(p); } AssociationConverter(PropertyWriterFactory propertyWriterFactory); Result<BasePropertyWriter> toFlowElement(Edge<?, ?> edge, ElementContainer process); } | AssociationConverter { public Result<BasePropertyWriter> toFlowElement(Edge<?, ?> edge, ElementContainer process) { ViewConnector<Association> connector = (ViewConnector<Association>) edge.getContent(); Association definition = connector.getDefinition(); org.eclipse.bpmn2.Association association = bpmn2.createAssociation(); AssociationPropertyWriter p = propertyWriterFactory.of(association); association.setId(edge.getUUID()); BasePropertyWriter pSrc = process.getChildElement(edge.getSourceNode().getUUID()); BasePropertyWriter pTgt = process.getChildElement(edge.getTargetNode().getUUID()); if (pSrc == null || pTgt == null) { String msg = String.format("BasePropertyWriter was not found for source node or target node at edge: %s, pSrc = %s, pTgt = %s", edge.getUUID(), pSrc, pTgt); LOG.debug(msg); return Result.failure(msg); } p.setSource(pSrc); p.setTarget(pTgt); p.setConnection(connector); BPMNGeneralSet general = definition.getGeneral(); p.setDocumentation(general.getDocumentation().getValue()); p.setDirectionAssociation(definition); return Result.of(p); } AssociationConverter(PropertyWriterFactory propertyWriterFactory); Result<BasePropertyWriter> toFlowElement(Edge<?, ?> edge, ElementContainer process); } |
@Test public void testDisableFilterInputs() { final JQuerySelectPicker selectPicker = mock(JQuerySelectPicker.class); doReturn(selectPicker).when(view).getDrgElementFilter(); termFilter.value = "something"; view.disableFilterInputs(); assertEquals("", termFilter.value); assertTrue(termFilter.disabled); assertTrue(drgElementFilter.disabled); verify(selectPicker).selectpicker("val", ""); verify(selectPicker).selectpicker("refresh"); } | @Override public void disableFilterInputs() { termFilter.value = ""; getDrgElementFilter().selectpicker("val", ""); disableFilterInputs(true); } | DecisionComponentsView implements DecisionComponents.View { @Override public void disableFilterInputs() { termFilter.value = ""; getDrgElementFilter().selectpicker("val", ""); disableFilterInputs(true); } } | DecisionComponentsView implements DecisionComponents.View { @Override public void disableFilterInputs() { termFilter.value = ""; getDrgElementFilter().selectpicker("val", ""); disableFilterInputs(true); } @Inject DecisionComponentsView(final HTMLSelectElement drgElementFilter,
final HTMLInputElement termFilter,
final HTMLDivElement list,
final HTMLDivElement emptyState,
final HTMLDivElement loading,
final HTMLDivElement componentsCounter,
final TranslationService translationService); } | DecisionComponentsView implements DecisionComponents.View { @Override public void disableFilterInputs() { termFilter.value = ""; getDrgElementFilter().selectpicker("val", ""); disableFilterInputs(true); } @Inject DecisionComponentsView(final HTMLSelectElement drgElementFilter,
final HTMLInputElement termFilter,
final HTMLDivElement list,
final HTMLDivElement emptyState,
final HTMLDivElement loading,
final HTMLDivElement componentsCounter,
final TranslationService translationService); @PostConstruct void init(); @Override void init(final DecisionComponents presenter); @EventHandler("term-filter") void onTermFilterChange(final KeyUpEvent e); @Override void clear(); @Override void addListItem(final HTMLElement htmlElement); @Override void showEmptyState(); @Override void showLoading(); @Override void hideLoading(); @Override void disableFilterInputs(); @Override void enableFilterInputs(); @Override void setComponentsCounter(final Integer count); } | DecisionComponentsView implements DecisionComponents.View { @Override public void disableFilterInputs() { termFilter.value = ""; getDrgElementFilter().selectpicker("val", ""); disableFilterInputs(true); } @Inject DecisionComponentsView(final HTMLSelectElement drgElementFilter,
final HTMLInputElement termFilter,
final HTMLDivElement list,
final HTMLDivElement emptyState,
final HTMLDivElement loading,
final HTMLDivElement componentsCounter,
final TranslationService translationService); @PostConstruct void init(); @Override void init(final DecisionComponents presenter); @EventHandler("term-filter") void onTermFilterChange(final KeyUpEvent e); @Override void clear(); @Override void addListItem(final HTMLElement htmlElement); @Override void showEmptyState(); @Override void showLoading(); @Override void hideLoading(); @Override void disableFilterInputs(); @Override void enableFilterInputs(); @Override void setComponentsCounter(final Integer count); } |
@Test public void testToFlowElementWithSourceAndTargetMissingFailure() { when(process.getChildElement(SOURCE_NODE_ID)).thenReturn(null); when(process.getChildElement(TARGET_NODE_ID)).thenReturn(null); Result<BasePropertyWriter> result = converter.toFlowElement(edge, process); verifyFailure(String.format(ERROR_PATTERN, EDGE_ID, null, null), result); } | public Result<BasePropertyWriter> toFlowElement(Edge<?, ?> edge, ElementContainer process) { ViewConnector<Association> connector = (ViewConnector<Association>) edge.getContent(); Association definition = connector.getDefinition(); org.eclipse.bpmn2.Association association = bpmn2.createAssociation(); AssociationPropertyWriter p = propertyWriterFactory.of(association); association.setId(edge.getUUID()); BasePropertyWriter pSrc = process.getChildElement(edge.getSourceNode().getUUID()); BasePropertyWriter pTgt = process.getChildElement(edge.getTargetNode().getUUID()); if (pSrc == null || pTgt == null) { String msg = String.format("BasePropertyWriter was not found for source node or target node at edge: %s, pSrc = %s, pTgt = %s", edge.getUUID(), pSrc, pTgt); LOG.debug(msg); return Result.failure(msg); } p.setSource(pSrc); p.setTarget(pTgt); p.setConnection(connector); BPMNGeneralSet general = definition.getGeneral(); p.setDocumentation(general.getDocumentation().getValue()); p.setDirectionAssociation(definition); return Result.of(p); } | AssociationConverter { public Result<BasePropertyWriter> toFlowElement(Edge<?, ?> edge, ElementContainer process) { ViewConnector<Association> connector = (ViewConnector<Association>) edge.getContent(); Association definition = connector.getDefinition(); org.eclipse.bpmn2.Association association = bpmn2.createAssociation(); AssociationPropertyWriter p = propertyWriterFactory.of(association); association.setId(edge.getUUID()); BasePropertyWriter pSrc = process.getChildElement(edge.getSourceNode().getUUID()); BasePropertyWriter pTgt = process.getChildElement(edge.getTargetNode().getUUID()); if (pSrc == null || pTgt == null) { String msg = String.format("BasePropertyWriter was not found for source node or target node at edge: %s, pSrc = %s, pTgt = %s", edge.getUUID(), pSrc, pTgt); LOG.debug(msg); return Result.failure(msg); } p.setSource(pSrc); p.setTarget(pTgt); p.setConnection(connector); BPMNGeneralSet general = definition.getGeneral(); p.setDocumentation(general.getDocumentation().getValue()); p.setDirectionAssociation(definition); return Result.of(p); } } | AssociationConverter { public Result<BasePropertyWriter> toFlowElement(Edge<?, ?> edge, ElementContainer process) { ViewConnector<Association> connector = (ViewConnector<Association>) edge.getContent(); Association definition = connector.getDefinition(); org.eclipse.bpmn2.Association association = bpmn2.createAssociation(); AssociationPropertyWriter p = propertyWriterFactory.of(association); association.setId(edge.getUUID()); BasePropertyWriter pSrc = process.getChildElement(edge.getSourceNode().getUUID()); BasePropertyWriter pTgt = process.getChildElement(edge.getTargetNode().getUUID()); if (pSrc == null || pTgt == null) { String msg = String.format("BasePropertyWriter was not found for source node or target node at edge: %s, pSrc = %s, pTgt = %s", edge.getUUID(), pSrc, pTgt); LOG.debug(msg); return Result.failure(msg); } p.setSource(pSrc); p.setTarget(pTgt); p.setConnection(connector); BPMNGeneralSet general = definition.getGeneral(); p.setDocumentation(general.getDocumentation().getValue()); p.setDirectionAssociation(definition); return Result.of(p); } AssociationConverter(PropertyWriterFactory propertyWriterFactory); } | AssociationConverter { public Result<BasePropertyWriter> toFlowElement(Edge<?, ?> edge, ElementContainer process) { ViewConnector<Association> connector = (ViewConnector<Association>) edge.getContent(); Association definition = connector.getDefinition(); org.eclipse.bpmn2.Association association = bpmn2.createAssociation(); AssociationPropertyWriter p = propertyWriterFactory.of(association); association.setId(edge.getUUID()); BasePropertyWriter pSrc = process.getChildElement(edge.getSourceNode().getUUID()); BasePropertyWriter pTgt = process.getChildElement(edge.getTargetNode().getUUID()); if (pSrc == null || pTgt == null) { String msg = String.format("BasePropertyWriter was not found for source node or target node at edge: %s, pSrc = %s, pTgt = %s", edge.getUUID(), pSrc, pTgt); LOG.debug(msg); return Result.failure(msg); } p.setSource(pSrc); p.setTarget(pTgt); p.setConnection(connector); BPMNGeneralSet general = definition.getGeneral(); p.setDocumentation(general.getDocumentation().getValue()); p.setDirectionAssociation(definition); return Result.of(p); } AssociationConverter(PropertyWriterFactory propertyWriterFactory); Result<BasePropertyWriter> toFlowElement(Edge<?, ?> edge, ElementContainer process); } | AssociationConverter { public Result<BasePropertyWriter> toFlowElement(Edge<?, ?> edge, ElementContainer process) { ViewConnector<Association> connector = (ViewConnector<Association>) edge.getContent(); Association definition = connector.getDefinition(); org.eclipse.bpmn2.Association association = bpmn2.createAssociation(); AssociationPropertyWriter p = propertyWriterFactory.of(association); association.setId(edge.getUUID()); BasePropertyWriter pSrc = process.getChildElement(edge.getSourceNode().getUUID()); BasePropertyWriter pTgt = process.getChildElement(edge.getTargetNode().getUUID()); if (pSrc == null || pTgt == null) { String msg = String.format("BasePropertyWriter was not found for source node or target node at edge: %s, pSrc = %s, pTgt = %s", edge.getUUID(), pSrc, pTgt); LOG.debug(msg); return Result.failure(msg); } p.setSource(pSrc); p.setTarget(pTgt); p.setConnection(connector); BPMNGeneralSet general = definition.getGeneral(); p.setDocumentation(general.getDocumentation().getValue()); p.setDirectionAssociation(definition); return Result.of(p); } AssociationConverter(PropertyWriterFactory propertyWriterFactory); Result<BasePropertyWriter> toFlowElement(Edge<?, ?> edge, ElementContainer process); } |
@Test public void convertProcessWithCaseProperties() { final ProcessPropertyWriter propertyWriter = converter.convertProcess(); verify(propertyWriter).setCaseIdPrefix(caseIdPrefix); verify(propertyWriter).setCaseRoles(caseRoles); verify(propertyWriter).setCaseFileVariables(caseFileVariables); } | public ProcessPropertyWriter convertProcess() { ProcessPropertyWriter processRoot = convertProcessNode(context.firstNode()); delegate.convertChildNodes(processRoot, context); delegate.convertEdges(processRoot, context); delegate.postConvertChildNodes(processRoot, context); return processRoot; } | RootProcessConverter { public ProcessPropertyWriter convertProcess() { ProcessPropertyWriter processRoot = convertProcessNode(context.firstNode()); delegate.convertChildNodes(processRoot, context); delegate.convertEdges(processRoot, context); delegate.postConvertChildNodes(processRoot, context); return processRoot; } } | RootProcessConverter { public ProcessPropertyWriter convertProcess() { ProcessPropertyWriter processRoot = convertProcessNode(context.firstNode()); delegate.convertChildNodes(processRoot, context); delegate.convertEdges(processRoot, context); delegate.postConvertChildNodes(processRoot, context); return processRoot; } RootProcessConverter(DefinitionsBuildingContext context,
PropertyWriterFactory propertyWriterFactory,
ConverterFactory converterFactory); } | RootProcessConverter { public ProcessPropertyWriter convertProcess() { ProcessPropertyWriter processRoot = convertProcessNode(context.firstNode()); delegate.convertChildNodes(processRoot, context); delegate.convertEdges(processRoot, context); delegate.postConvertChildNodes(processRoot, context); return processRoot; } RootProcessConverter(DefinitionsBuildingContext context,
PropertyWriterFactory propertyWriterFactory,
ConverterFactory converterFactory); ProcessPropertyWriter convertProcess(); } | RootProcessConverter { public ProcessPropertyWriter convertProcess() { ProcessPropertyWriter processRoot = convertProcessNode(context.firstNode()); delegate.convertChildNodes(processRoot, context); delegate.convertEdges(processRoot, context); delegate.postConvertChildNodes(processRoot, context); return processRoot; } RootProcessConverter(DefinitionsBuildingContext context,
PropertyWriterFactory propertyWriterFactory,
ConverterFactory converterFactory); ProcessPropertyWriter convertProcess(); } |
@Test public void convertProcessWithExecutable() { final ProcessPropertyWriter propertyWriter = converter.convertProcess(); verify(propertyWriter).setExecutable(anyBoolean()); } | public ProcessPropertyWriter convertProcess() { ProcessPropertyWriter processRoot = convertProcessNode(context.firstNode()); delegate.convertChildNodes(processRoot, context); delegate.convertEdges(processRoot, context); delegate.postConvertChildNodes(processRoot, context); return processRoot; } | RootProcessConverter { public ProcessPropertyWriter convertProcess() { ProcessPropertyWriter processRoot = convertProcessNode(context.firstNode()); delegate.convertChildNodes(processRoot, context); delegate.convertEdges(processRoot, context); delegate.postConvertChildNodes(processRoot, context); return processRoot; } } | RootProcessConverter { public ProcessPropertyWriter convertProcess() { ProcessPropertyWriter processRoot = convertProcessNode(context.firstNode()); delegate.convertChildNodes(processRoot, context); delegate.convertEdges(processRoot, context); delegate.postConvertChildNodes(processRoot, context); return processRoot; } RootProcessConverter(DefinitionsBuildingContext context,
PropertyWriterFactory propertyWriterFactory,
ConverterFactory converterFactory); } | RootProcessConverter { public ProcessPropertyWriter convertProcess() { ProcessPropertyWriter processRoot = convertProcessNode(context.firstNode()); delegate.convertChildNodes(processRoot, context); delegate.convertEdges(processRoot, context); delegate.postConvertChildNodes(processRoot, context); return processRoot; } RootProcessConverter(DefinitionsBuildingContext context,
PropertyWriterFactory propertyWriterFactory,
ConverterFactory converterFactory); ProcessPropertyWriter convertProcess(); } | RootProcessConverter { public ProcessPropertyWriter convertProcess() { ProcessPropertyWriter processRoot = convertProcessNode(context.firstNode()); delegate.convertChildNodes(processRoot, context); delegate.convertEdges(processRoot, context); delegate.postConvertChildNodes(processRoot, context); return processRoot; } RootProcessConverter(DefinitionsBuildingContext context,
PropertyWriterFactory propertyWriterFactory,
ConverterFactory converterFactory); ProcessPropertyWriter convertProcess(); } |
@Test public void convertProcessWithGlobalVariables() { final ProcessPropertyWriter propertyWriter = converter.convertProcess(); verify(propertyWriter).setGlobalVariables(any(GlobalVariables.class)); } | public ProcessPropertyWriter convertProcess() { ProcessPropertyWriter processRoot = convertProcessNode(context.firstNode()); delegate.convertChildNodes(processRoot, context); delegate.convertEdges(processRoot, context); delegate.postConvertChildNodes(processRoot, context); return processRoot; } | RootProcessConverter { public ProcessPropertyWriter convertProcess() { ProcessPropertyWriter processRoot = convertProcessNode(context.firstNode()); delegate.convertChildNodes(processRoot, context); delegate.convertEdges(processRoot, context); delegate.postConvertChildNodes(processRoot, context); return processRoot; } } | RootProcessConverter { public ProcessPropertyWriter convertProcess() { ProcessPropertyWriter processRoot = convertProcessNode(context.firstNode()); delegate.convertChildNodes(processRoot, context); delegate.convertEdges(processRoot, context); delegate.postConvertChildNodes(processRoot, context); return processRoot; } RootProcessConverter(DefinitionsBuildingContext context,
PropertyWriterFactory propertyWriterFactory,
ConverterFactory converterFactory); } | RootProcessConverter { public ProcessPropertyWriter convertProcess() { ProcessPropertyWriter processRoot = convertProcessNode(context.firstNode()); delegate.convertChildNodes(processRoot, context); delegate.convertEdges(processRoot, context); delegate.postConvertChildNodes(processRoot, context); return processRoot; } RootProcessConverter(DefinitionsBuildingContext context,
PropertyWriterFactory propertyWriterFactory,
ConverterFactory converterFactory); ProcessPropertyWriter convertProcess(); } | RootProcessConverter { public ProcessPropertyWriter convertProcess() { ProcessPropertyWriter processRoot = convertProcessNode(context.firstNode()); delegate.convertChildNodes(processRoot, context); delegate.convertEdges(processRoot, context); delegate.postConvertChildNodes(processRoot, context); return processRoot; } RootProcessConverter(DefinitionsBuildingContext context,
PropertyWriterFactory propertyWriterFactory,
ConverterFactory converterFactory); ProcessPropertyWriter convertProcess(); } |
@Test public void convertProcessWithImports() { final ProcessPropertyWriter propertyWriter = converter.convertProcess(); verify(propertyWriter).setDefaultImports(anyListOf(DefaultImport.class)); } | public ProcessPropertyWriter convertProcess() { ProcessPropertyWriter processRoot = convertProcessNode(context.firstNode()); delegate.convertChildNodes(processRoot, context); delegate.convertEdges(processRoot, context); delegate.postConvertChildNodes(processRoot, context); return processRoot; } | RootProcessConverter { public ProcessPropertyWriter convertProcess() { ProcessPropertyWriter processRoot = convertProcessNode(context.firstNode()); delegate.convertChildNodes(processRoot, context); delegate.convertEdges(processRoot, context); delegate.postConvertChildNodes(processRoot, context); return processRoot; } } | RootProcessConverter { public ProcessPropertyWriter convertProcess() { ProcessPropertyWriter processRoot = convertProcessNode(context.firstNode()); delegate.convertChildNodes(processRoot, context); delegate.convertEdges(processRoot, context); delegate.postConvertChildNodes(processRoot, context); return processRoot; } RootProcessConverter(DefinitionsBuildingContext context,
PropertyWriterFactory propertyWriterFactory,
ConverterFactory converterFactory); } | RootProcessConverter { public ProcessPropertyWriter convertProcess() { ProcessPropertyWriter processRoot = convertProcessNode(context.firstNode()); delegate.convertChildNodes(processRoot, context); delegate.convertEdges(processRoot, context); delegate.postConvertChildNodes(processRoot, context); return processRoot; } RootProcessConverter(DefinitionsBuildingContext context,
PropertyWriterFactory propertyWriterFactory,
ConverterFactory converterFactory); ProcessPropertyWriter convertProcess(); } | RootProcessConverter { public ProcessPropertyWriter convertProcess() { ProcessPropertyWriter processRoot = convertProcessNode(context.firstNode()); delegate.convertChildNodes(processRoot, context); delegate.convertEdges(processRoot, context); delegate.postConvertChildNodes(processRoot, context); return processRoot; } RootProcessConverter(DefinitionsBuildingContext context,
PropertyWriterFactory propertyWriterFactory,
ConverterFactory converterFactory); ProcessPropertyWriter convertProcess(); } |
@Test public void convertProcessWithSlaDueDate() { final ProcessPropertyWriter propertyWriter = converter.convertProcess(); verify(propertyWriter).setSlaDueDate(any(SLADueDate.class)); } | public ProcessPropertyWriter convertProcess() { ProcessPropertyWriter processRoot = convertProcessNode(context.firstNode()); delegate.convertChildNodes(processRoot, context); delegate.convertEdges(processRoot, context); delegate.postConvertChildNodes(processRoot, context); return processRoot; } | RootProcessConverter { public ProcessPropertyWriter convertProcess() { ProcessPropertyWriter processRoot = convertProcessNode(context.firstNode()); delegate.convertChildNodes(processRoot, context); delegate.convertEdges(processRoot, context); delegate.postConvertChildNodes(processRoot, context); return processRoot; } } | RootProcessConverter { public ProcessPropertyWriter convertProcess() { ProcessPropertyWriter processRoot = convertProcessNode(context.firstNode()); delegate.convertChildNodes(processRoot, context); delegate.convertEdges(processRoot, context); delegate.postConvertChildNodes(processRoot, context); return processRoot; } RootProcessConverter(DefinitionsBuildingContext context,
PropertyWriterFactory propertyWriterFactory,
ConverterFactory converterFactory); } | RootProcessConverter { public ProcessPropertyWriter convertProcess() { ProcessPropertyWriter processRoot = convertProcessNode(context.firstNode()); delegate.convertChildNodes(processRoot, context); delegate.convertEdges(processRoot, context); delegate.postConvertChildNodes(processRoot, context); return processRoot; } RootProcessConverter(DefinitionsBuildingContext context,
PropertyWriterFactory propertyWriterFactory,
ConverterFactory converterFactory); ProcessPropertyWriter convertProcess(); } | RootProcessConverter { public ProcessPropertyWriter convertProcess() { ProcessPropertyWriter processRoot = convertProcessNode(context.firstNode()); delegate.convertChildNodes(processRoot, context); delegate.convertEdges(processRoot, context); delegate.postConvertChildNodes(processRoot, context); return processRoot; } RootProcessConverter(DefinitionsBuildingContext context,
PropertyWriterFactory propertyWriterFactory,
ConverterFactory converterFactory); ProcessPropertyWriter convertProcess(); } |
@Test @SuppressWarnings("unchecked") public void testPostConvertNodes() { TestingGraphMockHandler graphTestHandler = new TestingGraphMockHandler(); BPMNDiagramImpl bpmnDiagram = new BPMNDiagramImpl(); StartNoneEvent level0StartNode = new StartNoneEvent(); EndNoneEvent level0EndNode = new EndNoneEvent(); UserTask level0Node1 = new UserTask(); UserTask level0Node2 = new UserTask(); EmbeddedSubprocess level1SubProcess1 = new EmbeddedSubprocess(); ScriptTask level1Node1 = new ScriptTask(); IntermediateSignalEventThrowing level1Node2 = new IntermediateSignalEventThrowing(); AdHocSubprocess level2SubProcess1 = new AdHocSubprocess(); BusinessRuleTask level2Node1 = new BusinessRuleTask(); EndCompensationEvent level2Node2 = new EndCompensationEvent(); TestingGraphInstanceBuilder2.Level2Graph level2Graph = TestingGraphInstanceBuilder2.buildLevel2Graph(graphTestHandler, bpmnDiagram, level0StartNode, level0Node1, level0Node2, level0EndNode, level1SubProcess1, level1Node1, level1Node2, level2SubProcess1, level2Node1, level2Node2); DefinitionsBuildingContext ctx = new DefinitionsBuildingContext(level2Graph.graph); PropertyWriterFactory writerFactory = new PropertyWriterFactory(); ConverterFactory factory = spy(new ConverterFactory(ctx, writerFactory)); FlowElementPostConverter flowElementPostConverter = mock(FlowElementPostConverter.class); when(factory.flowElementPostConverter()).thenReturn(flowElementPostConverter); MyProcessConverter abstractProcessConverter = new MyProcessConverter(factory); ProcessPropertyWriter processWriter = writerFactory.of(bpmn2.createProcess()); abstractProcessConverter.postConvertChildNodes(processWriter, ctx); verify(flowElementPostConverter, times(10)).postConvert(anyObject(), anyObject(), nodeCaptor.capture()); Map<String, BPMNViewDefinition> nodes = new HashMap<>(); nodes.put(LEVEL0_START_NODE.uuid(), level0StartNode); nodes.put(LEVEL0_NODE1.uuid(), level0Node1); nodes.put(LEVEL0_NODE2.uuid(), level0Node2); nodes.put(LEVEL0_END_NODE.uuid(), level0EndNode); nodes.put(LEVEL1_SUB_PROCESS1.uuid(), level1SubProcess1); nodes.put(LEVEL1_NODE1.uuid(), level1Node1); nodes.put(LEVEL1_NODE2.uuid(), level1Node2); nodes.put(LEVEL2_SUB_PROCESS1.uuid(), level2SubProcess1); nodes.put(LEVEL2_NODE1.uuid(), level2Node1); nodes.put(LEVEL2_NODE2.uuid(), level2Node2); assertEquals(nodes.size(), nodeCaptor.getAllValues().size()); nodes.entrySet().forEach(entry -> { Optional<Node<View<? extends BPMNViewDefinition>, ?>> processed = nodeCaptor.getAllValues() .stream() .filter(captured -> entry.getKey().equals(captured.getUUID())) .findFirst(); assertTrue("Node: " + entry.getKey() + " was not present in result", processed.isPresent()); assertEquals(entry.getValue(), processed.get().getContent().getDefinition()); }); } | void postConvertChildNodes(ProcessPropertyWriter processWriter, DefinitionsBuildingContext context) { final Map<String, BasePropertyWriter> propertyWriters = collectPropertyWriters(processWriter); context.nodes().forEach(node -> converterFactory.flowElementPostConverter().postConvert(processWriter, propertyWriters.get(node.getUUID()), node)); } | ProcessConverterDelegate { void postConvertChildNodes(ProcessPropertyWriter processWriter, DefinitionsBuildingContext context) { final Map<String, BasePropertyWriter> propertyWriters = collectPropertyWriters(processWriter); context.nodes().forEach(node -> converterFactory.flowElementPostConverter().postConvert(processWriter, propertyWriters.get(node.getUUID()), node)); } } | ProcessConverterDelegate { void postConvertChildNodes(ProcessPropertyWriter processWriter, DefinitionsBuildingContext context) { final Map<String, BasePropertyWriter> propertyWriters = collectPropertyWriters(processWriter); context.nodes().forEach(node -> converterFactory.flowElementPostConverter().postConvert(processWriter, propertyWriters.get(node.getUUID()), node)); } ProcessConverterDelegate(ConverterFactory converterFactory); } | ProcessConverterDelegate { void postConvertChildNodes(ProcessPropertyWriter processWriter, DefinitionsBuildingContext context) { final Map<String, BasePropertyWriter> propertyWriters = collectPropertyWriters(processWriter); context.nodes().forEach(node -> converterFactory.flowElementPostConverter().postConvert(processWriter, propertyWriters.get(node.getUUID()), node)); } ProcessConverterDelegate(ConverterFactory converterFactory); } | ProcessConverterDelegate { void postConvertChildNodes(ProcessPropertyWriter processWriter, DefinitionsBuildingContext context) { final Map<String, BasePropertyWriter> propertyWriters = collectPropertyWriters(processWriter); context.nodes().forEach(node -> converterFactory.flowElementPostConverter().postConvert(processWriter, propertyWriters.get(node.getUUID()), node)); } ProcessConverterDelegate(ConverterFactory converterFactory); } |
@Test @SuppressWarnings("unchecked") public void testProcessWhenIsForCompensation() { outEdges.add(mockEdge(mock(Node.class), newNode(new StartCompensationEvent()))); converter.process(processWriter, nodeWriter, eventSubprocessNode); verify(subProcess).setIsForCompensation(true); } | @Override public void process(ProcessPropertyWriter processWriter, BasePropertyWriter nodeWriter, Node<View<? extends BPMNViewDefinition>, ?> node) { boolean isForCompensation = GraphUtils.getChildNodes(node).stream() .filter(currentNode -> currentNode.getContent() instanceof View && ((View) currentNode.getContent()).getDefinition() instanceof StartCompensationEvent) .findFirst() .isPresent(); if (isForCompensation) { ((SubProcess) nodeWriter.getElement()).setIsForCompensation(true); } } | EventSubProcessPostConverter implements PostConverterProcessor { @Override public void process(ProcessPropertyWriter processWriter, BasePropertyWriter nodeWriter, Node<View<? extends BPMNViewDefinition>, ?> node) { boolean isForCompensation = GraphUtils.getChildNodes(node).stream() .filter(currentNode -> currentNode.getContent() instanceof View && ((View) currentNode.getContent()).getDefinition() instanceof StartCompensationEvent) .findFirst() .isPresent(); if (isForCompensation) { ((SubProcess) nodeWriter.getElement()).setIsForCompensation(true); } } } | EventSubProcessPostConverter implements PostConverterProcessor { @Override public void process(ProcessPropertyWriter processWriter, BasePropertyWriter nodeWriter, Node<View<? extends BPMNViewDefinition>, ?> node) { boolean isForCompensation = GraphUtils.getChildNodes(node).stream() .filter(currentNode -> currentNode.getContent() instanceof View && ((View) currentNode.getContent()).getDefinition() instanceof StartCompensationEvent) .findFirst() .isPresent(); if (isForCompensation) { ((SubProcess) nodeWriter.getElement()).setIsForCompensation(true); } } } | EventSubProcessPostConverter implements PostConverterProcessor { @Override public void process(ProcessPropertyWriter processWriter, BasePropertyWriter nodeWriter, Node<View<? extends BPMNViewDefinition>, ?> node) { boolean isForCompensation = GraphUtils.getChildNodes(node).stream() .filter(currentNode -> currentNode.getContent() instanceof View && ((View) currentNode.getContent()).getDefinition() instanceof StartCompensationEvent) .findFirst() .isPresent(); if (isForCompensation) { ((SubProcess) nodeWriter.getElement()).setIsForCompensation(true); } } @Override void process(ProcessPropertyWriter processWriter,
BasePropertyWriter nodeWriter,
Node<View<? extends BPMNViewDefinition>, ?> node); } | EventSubProcessPostConverter implements PostConverterProcessor { @Override public void process(ProcessPropertyWriter processWriter, BasePropertyWriter nodeWriter, Node<View<? extends BPMNViewDefinition>, ?> node) { boolean isForCompensation = GraphUtils.getChildNodes(node).stream() .filter(currentNode -> currentNode.getContent() instanceof View && ((View) currentNode.getContent()).getDefinition() instanceof StartCompensationEvent) .findFirst() .isPresent(); if (isForCompensation) { ((SubProcess) nodeWriter.getElement()).setIsForCompensation(true); } } @Override void process(ProcessPropertyWriter processWriter,
BasePropertyWriter nodeWriter,
Node<View<? extends BPMNViewDefinition>, ?> node); } |
@Test @SuppressWarnings("unchecked") public void testProcessWhenIsNotForCompensation() { converter.process(processWriter, nodeWriter, eventSubprocessNode); verify(subProcess, never()).setIsForCompensation(true); } | @Override public void process(ProcessPropertyWriter processWriter, BasePropertyWriter nodeWriter, Node<View<? extends BPMNViewDefinition>, ?> node) { boolean isForCompensation = GraphUtils.getChildNodes(node).stream() .filter(currentNode -> currentNode.getContent() instanceof View && ((View) currentNode.getContent()).getDefinition() instanceof StartCompensationEvent) .findFirst() .isPresent(); if (isForCompensation) { ((SubProcess) nodeWriter.getElement()).setIsForCompensation(true); } } | EventSubProcessPostConverter implements PostConverterProcessor { @Override public void process(ProcessPropertyWriter processWriter, BasePropertyWriter nodeWriter, Node<View<? extends BPMNViewDefinition>, ?> node) { boolean isForCompensation = GraphUtils.getChildNodes(node).stream() .filter(currentNode -> currentNode.getContent() instanceof View && ((View) currentNode.getContent()).getDefinition() instanceof StartCompensationEvent) .findFirst() .isPresent(); if (isForCompensation) { ((SubProcess) nodeWriter.getElement()).setIsForCompensation(true); } } } | EventSubProcessPostConverter implements PostConverterProcessor { @Override public void process(ProcessPropertyWriter processWriter, BasePropertyWriter nodeWriter, Node<View<? extends BPMNViewDefinition>, ?> node) { boolean isForCompensation = GraphUtils.getChildNodes(node).stream() .filter(currentNode -> currentNode.getContent() instanceof View && ((View) currentNode.getContent()).getDefinition() instanceof StartCompensationEvent) .findFirst() .isPresent(); if (isForCompensation) { ((SubProcess) nodeWriter.getElement()).setIsForCompensation(true); } } } | EventSubProcessPostConverter implements PostConverterProcessor { @Override public void process(ProcessPropertyWriter processWriter, BasePropertyWriter nodeWriter, Node<View<? extends BPMNViewDefinition>, ?> node) { boolean isForCompensation = GraphUtils.getChildNodes(node).stream() .filter(currentNode -> currentNode.getContent() instanceof View && ((View) currentNode.getContent()).getDefinition() instanceof StartCompensationEvent) .findFirst() .isPresent(); if (isForCompensation) { ((SubProcess) nodeWriter.getElement()).setIsForCompensation(true); } } @Override void process(ProcessPropertyWriter processWriter,
BasePropertyWriter nodeWriter,
Node<View<? extends BPMNViewDefinition>, ?> node); } | EventSubProcessPostConverter implements PostConverterProcessor { @Override public void process(ProcessPropertyWriter processWriter, BasePropertyWriter nodeWriter, Node<View<? extends BPMNViewDefinition>, ?> node) { boolean isForCompensation = GraphUtils.getChildNodes(node).stream() .filter(currentNode -> currentNode.getContent() instanceof View && ((View) currentNode.getContent()).getDefinition() instanceof StartCompensationEvent) .findFirst() .isPresent(); if (isForCompensation) { ((SubProcess) nodeWriter.getElement()).setIsForCompensation(true); } } @Override void process(ProcessPropertyWriter processWriter,
BasePropertyWriter nodeWriter,
Node<View<? extends BPMNViewDefinition>, ?> node); } |
@Test public void testConvertAdHocSubprocessNode_autostart() { final AdHocSubprocess definition = new AdHocSubprocess(); definition.getExecutionSet().setAdHocAutostart(new AdHocAutostart(true)); final View<BaseAdHocSubprocess> view = new ViewImpl<>(definition, Bounds.create()); final Node<View<BaseAdHocSubprocess>, ?> node = new NodeImpl<>(UUID.randomUUID().toString()); node.setContent(view); SubProcessPropertyWriter writer = tested.convertAdHocSubprocessNode(node); assertTrue(AdHocSubProcessPropertyWriter.class.isInstance(writer)); assertTrue(CustomElement.autoStart.of(writer.getFlowElement()).get()); } | protected SubProcessPropertyWriter convertAdHocSubprocessNode(Node<View<BaseAdHocSubprocess>, ?> n) { org.eclipse.bpmn2.AdHocSubProcess process = bpmn2.createAdHocSubProcess(); process.setId(n.getUUID()); AdHocSubProcessPropertyWriter p = propertyWriterFactory.of(process); BaseAdHocSubprocess definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); BaseProcessData processData = definition.getProcessData(); p.setProcessVariables(processData.getProcessVariables()); BaseAdHocSubprocessTaskExecutionSet executionSet = definition.getExecutionSet(); p.setAdHocActivationCondition(executionSet.getAdHocActivationCondition()); p.setAdHocCompletionCondition(executionSet.getAdHocCompletionCondition()); p.setAdHocOrdering(executionSet.getAdHocOrdering()); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setAsync(executionSet.getIsAsync().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); return p; } | SubProcessConverter extends ProcessConverterDelegate { protected SubProcessPropertyWriter convertAdHocSubprocessNode(Node<View<BaseAdHocSubprocess>, ?> n) { org.eclipse.bpmn2.AdHocSubProcess process = bpmn2.createAdHocSubProcess(); process.setId(n.getUUID()); AdHocSubProcessPropertyWriter p = propertyWriterFactory.of(process); BaseAdHocSubprocess definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); BaseProcessData processData = definition.getProcessData(); p.setProcessVariables(processData.getProcessVariables()); BaseAdHocSubprocessTaskExecutionSet executionSet = definition.getExecutionSet(); p.setAdHocActivationCondition(executionSet.getAdHocActivationCondition()); p.setAdHocCompletionCondition(executionSet.getAdHocCompletionCondition()); p.setAdHocOrdering(executionSet.getAdHocOrdering()); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setAsync(executionSet.getIsAsync().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); return p; } } | SubProcessConverter extends ProcessConverterDelegate { protected SubProcessPropertyWriter convertAdHocSubprocessNode(Node<View<BaseAdHocSubprocess>, ?> n) { org.eclipse.bpmn2.AdHocSubProcess process = bpmn2.createAdHocSubProcess(); process.setId(n.getUUID()); AdHocSubProcessPropertyWriter p = propertyWriterFactory.of(process); BaseAdHocSubprocess definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); BaseProcessData processData = definition.getProcessData(); p.setProcessVariables(processData.getProcessVariables()); BaseAdHocSubprocessTaskExecutionSet executionSet = definition.getExecutionSet(); p.setAdHocActivationCondition(executionSet.getAdHocActivationCondition()); p.setAdHocCompletionCondition(executionSet.getAdHocCompletionCondition()); p.setAdHocOrdering(executionSet.getAdHocOrdering()); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setAsync(executionSet.getIsAsync().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); return p; } SubProcessConverter(DefinitionsBuildingContext context,
PropertyWriterFactory propertyWriterFactory,
ConverterFactory converterFactory); } | SubProcessConverter extends ProcessConverterDelegate { protected SubProcessPropertyWriter convertAdHocSubprocessNode(Node<View<BaseAdHocSubprocess>, ?> n) { org.eclipse.bpmn2.AdHocSubProcess process = bpmn2.createAdHocSubProcess(); process.setId(n.getUUID()); AdHocSubProcessPropertyWriter p = propertyWriterFactory.of(process); BaseAdHocSubprocess definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); BaseProcessData processData = definition.getProcessData(); p.setProcessVariables(processData.getProcessVariables()); BaseAdHocSubprocessTaskExecutionSet executionSet = definition.getExecutionSet(); p.setAdHocActivationCondition(executionSet.getAdHocActivationCondition()); p.setAdHocCompletionCondition(executionSet.getAdHocCompletionCondition()); p.setAdHocOrdering(executionSet.getAdHocOrdering()); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setAsync(executionSet.getIsAsync().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); return p; } SubProcessConverter(DefinitionsBuildingContext context,
PropertyWriterFactory propertyWriterFactory,
ConverterFactory converterFactory); Result<SubProcessPropertyWriter> convertSubProcess(Node<View<? extends BPMNViewDefinition>, ?> node); } | SubProcessConverter extends ProcessConverterDelegate { protected SubProcessPropertyWriter convertAdHocSubprocessNode(Node<View<BaseAdHocSubprocess>, ?> n) { org.eclipse.bpmn2.AdHocSubProcess process = bpmn2.createAdHocSubProcess(); process.setId(n.getUUID()); AdHocSubProcessPropertyWriter p = propertyWriterFactory.of(process); BaseAdHocSubprocess definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); BaseProcessData processData = definition.getProcessData(); p.setProcessVariables(processData.getProcessVariables()); BaseAdHocSubprocessTaskExecutionSet executionSet = definition.getExecutionSet(); p.setAdHocActivationCondition(executionSet.getAdHocActivationCondition()); p.setAdHocCompletionCondition(executionSet.getAdHocCompletionCondition()); p.setAdHocOrdering(executionSet.getAdHocOrdering()); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setAsync(executionSet.getIsAsync().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); return p; } SubProcessConverter(DefinitionsBuildingContext context,
PropertyWriterFactory propertyWriterFactory,
ConverterFactory converterFactory); Result<SubProcessPropertyWriter> convertSubProcess(Node<View<? extends BPMNViewDefinition>, ?> node); } |
@Test public void testEnableFilterInputs() { final JQuerySelectPicker selectPicker = mock(JQuerySelectPicker.class); doReturn(selectPicker).when(view).getDrgElementFilter(); view.enableFilterInputs(); assertFalse(termFilter.disabled); assertFalse(drgElementFilter.disabled); verify(selectPicker).selectpicker("refresh"); } | @Override public void enableFilterInputs() { disableFilterInputs(false); } | DecisionComponentsView implements DecisionComponents.View { @Override public void enableFilterInputs() { disableFilterInputs(false); } } | DecisionComponentsView implements DecisionComponents.View { @Override public void enableFilterInputs() { disableFilterInputs(false); } @Inject DecisionComponentsView(final HTMLSelectElement drgElementFilter,
final HTMLInputElement termFilter,
final HTMLDivElement list,
final HTMLDivElement emptyState,
final HTMLDivElement loading,
final HTMLDivElement componentsCounter,
final TranslationService translationService); } | DecisionComponentsView implements DecisionComponents.View { @Override public void enableFilterInputs() { disableFilterInputs(false); } @Inject DecisionComponentsView(final HTMLSelectElement drgElementFilter,
final HTMLInputElement termFilter,
final HTMLDivElement list,
final HTMLDivElement emptyState,
final HTMLDivElement loading,
final HTMLDivElement componentsCounter,
final TranslationService translationService); @PostConstruct void init(); @Override void init(final DecisionComponents presenter); @EventHandler("term-filter") void onTermFilterChange(final KeyUpEvent e); @Override void clear(); @Override void addListItem(final HTMLElement htmlElement); @Override void showEmptyState(); @Override void showLoading(); @Override void hideLoading(); @Override void disableFilterInputs(); @Override void enableFilterInputs(); @Override void setComponentsCounter(final Integer count); } | DecisionComponentsView implements DecisionComponents.View { @Override public void enableFilterInputs() { disableFilterInputs(false); } @Inject DecisionComponentsView(final HTMLSelectElement drgElementFilter,
final HTMLInputElement termFilter,
final HTMLDivElement list,
final HTMLDivElement emptyState,
final HTMLDivElement loading,
final HTMLDivElement componentsCounter,
final TranslationService translationService); @PostConstruct void init(); @Override void init(final DecisionComponents presenter); @EventHandler("term-filter") void onTermFilterChange(final KeyUpEvent e); @Override void clear(); @Override void addListItem(final HTMLElement htmlElement); @Override void showEmptyState(); @Override void showLoading(); @Override void hideLoading(); @Override void disableFilterInputs(); @Override void enableFilterInputs(); @Override void setComponentsCounter(final Integer count); } |
@Test public void testConvertAdHocSubprocessNode_notautostart() { final AdHocSubprocess definition = new AdHocSubprocess(); definition.getExecutionSet().setAdHocAutostart(new AdHocAutostart(false)); final View<BaseAdHocSubprocess> view = new ViewImpl<>(definition, Bounds.create()); final Node<View<BaseAdHocSubprocess>, ?> node = new NodeImpl<>(UUID.randomUUID().toString()); node.setContent(view); SubProcessPropertyWriter writer = tested.convertAdHocSubprocessNode(node); assertTrue(AdHocSubProcessPropertyWriter.class.isInstance(writer)); assertFalse(CustomElement.autoStart.of(writer.getFlowElement()).get()); } | protected SubProcessPropertyWriter convertAdHocSubprocessNode(Node<View<BaseAdHocSubprocess>, ?> n) { org.eclipse.bpmn2.AdHocSubProcess process = bpmn2.createAdHocSubProcess(); process.setId(n.getUUID()); AdHocSubProcessPropertyWriter p = propertyWriterFactory.of(process); BaseAdHocSubprocess definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); BaseProcessData processData = definition.getProcessData(); p.setProcessVariables(processData.getProcessVariables()); BaseAdHocSubprocessTaskExecutionSet executionSet = definition.getExecutionSet(); p.setAdHocActivationCondition(executionSet.getAdHocActivationCondition()); p.setAdHocCompletionCondition(executionSet.getAdHocCompletionCondition()); p.setAdHocOrdering(executionSet.getAdHocOrdering()); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setAsync(executionSet.getIsAsync().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); return p; } | SubProcessConverter extends ProcessConverterDelegate { protected SubProcessPropertyWriter convertAdHocSubprocessNode(Node<View<BaseAdHocSubprocess>, ?> n) { org.eclipse.bpmn2.AdHocSubProcess process = bpmn2.createAdHocSubProcess(); process.setId(n.getUUID()); AdHocSubProcessPropertyWriter p = propertyWriterFactory.of(process); BaseAdHocSubprocess definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); BaseProcessData processData = definition.getProcessData(); p.setProcessVariables(processData.getProcessVariables()); BaseAdHocSubprocessTaskExecutionSet executionSet = definition.getExecutionSet(); p.setAdHocActivationCondition(executionSet.getAdHocActivationCondition()); p.setAdHocCompletionCondition(executionSet.getAdHocCompletionCondition()); p.setAdHocOrdering(executionSet.getAdHocOrdering()); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setAsync(executionSet.getIsAsync().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); return p; } } | SubProcessConverter extends ProcessConverterDelegate { protected SubProcessPropertyWriter convertAdHocSubprocessNode(Node<View<BaseAdHocSubprocess>, ?> n) { org.eclipse.bpmn2.AdHocSubProcess process = bpmn2.createAdHocSubProcess(); process.setId(n.getUUID()); AdHocSubProcessPropertyWriter p = propertyWriterFactory.of(process); BaseAdHocSubprocess definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); BaseProcessData processData = definition.getProcessData(); p.setProcessVariables(processData.getProcessVariables()); BaseAdHocSubprocessTaskExecutionSet executionSet = definition.getExecutionSet(); p.setAdHocActivationCondition(executionSet.getAdHocActivationCondition()); p.setAdHocCompletionCondition(executionSet.getAdHocCompletionCondition()); p.setAdHocOrdering(executionSet.getAdHocOrdering()); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setAsync(executionSet.getIsAsync().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); return p; } SubProcessConverter(DefinitionsBuildingContext context,
PropertyWriterFactory propertyWriterFactory,
ConverterFactory converterFactory); } | SubProcessConverter extends ProcessConverterDelegate { protected SubProcessPropertyWriter convertAdHocSubprocessNode(Node<View<BaseAdHocSubprocess>, ?> n) { org.eclipse.bpmn2.AdHocSubProcess process = bpmn2.createAdHocSubProcess(); process.setId(n.getUUID()); AdHocSubProcessPropertyWriter p = propertyWriterFactory.of(process); BaseAdHocSubprocess definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); BaseProcessData processData = definition.getProcessData(); p.setProcessVariables(processData.getProcessVariables()); BaseAdHocSubprocessTaskExecutionSet executionSet = definition.getExecutionSet(); p.setAdHocActivationCondition(executionSet.getAdHocActivationCondition()); p.setAdHocCompletionCondition(executionSet.getAdHocCompletionCondition()); p.setAdHocOrdering(executionSet.getAdHocOrdering()); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setAsync(executionSet.getIsAsync().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); return p; } SubProcessConverter(DefinitionsBuildingContext context,
PropertyWriterFactory propertyWriterFactory,
ConverterFactory converterFactory); Result<SubProcessPropertyWriter> convertSubProcess(Node<View<? extends BPMNViewDefinition>, ?> node); } | SubProcessConverter extends ProcessConverterDelegate { protected SubProcessPropertyWriter convertAdHocSubprocessNode(Node<View<BaseAdHocSubprocess>, ?> n) { org.eclipse.bpmn2.AdHocSubProcess process = bpmn2.createAdHocSubProcess(); process.setId(n.getUUID()); AdHocSubProcessPropertyWriter p = propertyWriterFactory.of(process); BaseAdHocSubprocess definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); BaseProcessData processData = definition.getProcessData(); p.setProcessVariables(processData.getProcessVariables()); BaseAdHocSubprocessTaskExecutionSet executionSet = definition.getExecutionSet(); p.setAdHocActivationCondition(executionSet.getAdHocActivationCondition()); p.setAdHocCompletionCondition(executionSet.getAdHocCompletionCondition()); p.setAdHocOrdering(executionSet.getAdHocOrdering()); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setAsync(executionSet.getIsAsync().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); return p; } SubProcessConverter(DefinitionsBuildingContext context,
PropertyWriterFactory propertyWriterFactory,
ConverterFactory converterFactory); Result<SubProcessPropertyWriter> convertSubProcess(Node<View<? extends BPMNViewDefinition>, ?> node); } |
@Test public void testConvertAdhocSubprocess() { AdHocSubprocess definition = new AdHocSubprocess(); String adHocOrdering = "Parallel"; boolean adHocAutostart = true; String processVariables = "processVar1:Object,processVar2:Integer"; definition.getGeneral().getName().setValue(NAME); definition.getGeneral().getDocumentation().setValue(DOCUMENTATION); definition.getProcessData().getProcessVariables().setValue(processVariables); definition.getExecutionSet().getAdHocOrdering().setValue(adHocOrdering); definition.getExecutionSet().getAdHocAutostart().setValue(adHocAutostart); definition.getExecutionSet().getAdHocActivationCondition().setValue(ACTIVATION_CONDITION); definition.getExecutionSet().getAdHocCompletionCondition().setValue(COMPLETION_CONDITION); definition.getExecutionSet().getOnEntryAction().getValue().addValue(ON_ENTRY_ACTION); definition.getExecutionSet().getOnExitAction().getValue().addValue(ON_EXIT_ACTION); setBaseSubprocessExecutionSetValues(definition.getExecutionSet()); double nodeX1 = 10; double nodeY1 = 20; double nodeX2 = 40; double nodeY2 = 60; View<BaseAdHocSubprocess> view = new ViewImpl<>(definition, Bounds.create(nodeX1, nodeY1, nodeX2, nodeY2)); Node<View<? extends BPMNViewDefinition>, Edge> node = new NodeImpl<>(ELEMENT_ID); node.setContent(view); double parentX1 = 30; double parentY1 = 40; double parentX2 = 60; double parentY2 = 100; Node<View<? extends BPMNViewDefinition>, ?> parent = new NodeImpl<>("parentId"); View<? extends BPMNViewDefinition> parentView = new ViewImpl<>(null, Bounds.create(parentX1, parentY1, parentX2, parentY2)); parent.setContent(parentView); Edge<Child, Node> edge = new EdgeImpl("edgeId"); edge.setContent(mock(Child.class)); node.getInEdges().add(edge); edge.setSourceNode(parent); edge.setTargetNode(node); Result<SubProcessPropertyWriter> result = tested.convertSubProcess(node); assertTrue(result.isSuccess()); AdHocSubProcess adHocSubProcess = (AdHocSubProcess) result.value().getElement(); assertEquals(ELEMENT_ID, adHocSubProcess.getId()); assertEquals(NAME, adHocSubProcess.getName()); assertEquals(asCData(NAME), CustomElement.name.of(adHocSubProcess).get()); assertEquals(asCData(DOCUMENTATION), adHocSubProcess.getDocumentation().get(0).getText()); assertEquals(adHocOrdering, adHocSubProcess.getOrdering().getName()); assertEquals(adHocAutostart, CustomElement.autoStart.of(adHocSubProcess).get()); assertEquals(asCData(ACTIVATION_CONDITION), CustomElement.customActivationCondition.of(adHocSubProcess).get()); assertEquals(Scripts.LANGUAGE.valueOf(COMPLETION_CONDITION.getLanguage().toUpperCase()).format(), ((FormalExpression) adHocSubProcess.getCompletionCondition()).getLanguage()); assertEquals(asCData(COMPLETION_CONDITION.getScript()), ((FormalExpression) adHocSubProcess.getCompletionCondition()).getBody()); assertEquals(ON_ENTRY_ACTION.getLanguage(), Scripts.onEntry(adHocSubProcess.getExtensionValues()).getValues().get(0).getLanguage()); assertEquals(asCData(ON_ENTRY_ACTION.getScript()), Scripts.onEntry(adHocSubProcess.getExtensionValues()).getValues().get(0).getScript()); assertEquals(ON_EXIT_ACTION.getLanguage(), Scripts.onExit(adHocSubProcess.getExtensionValues()).getValues().get(0).getLanguage()); assertEquals(asCData(ON_EXIT_ACTION.getScript()), Scripts.onExit(adHocSubProcess.getExtensionValues()).getValues().get(0).getScript()); assertVariables(Arrays.asList(new Pair<>("processVar1", "Object"), new Pair<>("processVar2", "Integer")), adHocSubProcess.getProperties()); BPMNShape shape = result.value().getShape(); assertEquals(parentX1 + nodeX1, shape.getBounds().getX(), 0); assertEquals(parentY1 + nodeY1, shape.getBounds().getY(), 0); assertEquals(nodeX2 - nodeX1, shape.getBounds().getWidth(), 0); assertEquals(nodeY2 - nodeY1, shape.getBounds().getHeight(), 0); assertBaseSubprocessExecutionSet(result.value()); } | public Result<SubProcessPropertyWriter> convertSubProcess(Node<View<? extends BPMNViewDefinition>, ?> node) { Result<SubProcessPropertyWriter> processRootResult = NodeMatch.fromNode(BaseSubprocess.class, SubProcessPropertyWriter.class) .when(EmbeddedSubprocess.class, this::convertEmbeddedSubprocessNode) .when(EventSubprocess.class, this::convertEventSubprocessNode) .when(BaseAdHocSubprocess.class, this::convertAdHocSubprocessNode) .when(MultipleInstanceSubprocess.class, this::convertMultipleInstanceSubprocessNode) .ignore(BPMNViewDefinition.class) .apply(node); if (processRootResult.isIgnored()) { return processRootResult; } DefinitionsBuildingContext subContext = context.withRootNode(node); SubProcessPropertyWriter processRoot = processRootResult.value(); super.convertChildNodes(processRoot, subContext); super.convertEdges(processRoot, subContext); return processRootResult; } | SubProcessConverter extends ProcessConverterDelegate { public Result<SubProcessPropertyWriter> convertSubProcess(Node<View<? extends BPMNViewDefinition>, ?> node) { Result<SubProcessPropertyWriter> processRootResult = NodeMatch.fromNode(BaseSubprocess.class, SubProcessPropertyWriter.class) .when(EmbeddedSubprocess.class, this::convertEmbeddedSubprocessNode) .when(EventSubprocess.class, this::convertEventSubprocessNode) .when(BaseAdHocSubprocess.class, this::convertAdHocSubprocessNode) .when(MultipleInstanceSubprocess.class, this::convertMultipleInstanceSubprocessNode) .ignore(BPMNViewDefinition.class) .apply(node); if (processRootResult.isIgnored()) { return processRootResult; } DefinitionsBuildingContext subContext = context.withRootNode(node); SubProcessPropertyWriter processRoot = processRootResult.value(); super.convertChildNodes(processRoot, subContext); super.convertEdges(processRoot, subContext); return processRootResult; } } | SubProcessConverter extends ProcessConverterDelegate { public Result<SubProcessPropertyWriter> convertSubProcess(Node<View<? extends BPMNViewDefinition>, ?> node) { Result<SubProcessPropertyWriter> processRootResult = NodeMatch.fromNode(BaseSubprocess.class, SubProcessPropertyWriter.class) .when(EmbeddedSubprocess.class, this::convertEmbeddedSubprocessNode) .when(EventSubprocess.class, this::convertEventSubprocessNode) .when(BaseAdHocSubprocess.class, this::convertAdHocSubprocessNode) .when(MultipleInstanceSubprocess.class, this::convertMultipleInstanceSubprocessNode) .ignore(BPMNViewDefinition.class) .apply(node); if (processRootResult.isIgnored()) { return processRootResult; } DefinitionsBuildingContext subContext = context.withRootNode(node); SubProcessPropertyWriter processRoot = processRootResult.value(); super.convertChildNodes(processRoot, subContext); super.convertEdges(processRoot, subContext); return processRootResult; } SubProcessConverter(DefinitionsBuildingContext context,
PropertyWriterFactory propertyWriterFactory,
ConverterFactory converterFactory); } | SubProcessConverter extends ProcessConverterDelegate { public Result<SubProcessPropertyWriter> convertSubProcess(Node<View<? extends BPMNViewDefinition>, ?> node) { Result<SubProcessPropertyWriter> processRootResult = NodeMatch.fromNode(BaseSubprocess.class, SubProcessPropertyWriter.class) .when(EmbeddedSubprocess.class, this::convertEmbeddedSubprocessNode) .when(EventSubprocess.class, this::convertEventSubprocessNode) .when(BaseAdHocSubprocess.class, this::convertAdHocSubprocessNode) .when(MultipleInstanceSubprocess.class, this::convertMultipleInstanceSubprocessNode) .ignore(BPMNViewDefinition.class) .apply(node); if (processRootResult.isIgnored()) { return processRootResult; } DefinitionsBuildingContext subContext = context.withRootNode(node); SubProcessPropertyWriter processRoot = processRootResult.value(); super.convertChildNodes(processRoot, subContext); super.convertEdges(processRoot, subContext); return processRootResult; } SubProcessConverter(DefinitionsBuildingContext context,
PropertyWriterFactory propertyWriterFactory,
ConverterFactory converterFactory); Result<SubProcessPropertyWriter> convertSubProcess(Node<View<? extends BPMNViewDefinition>, ?> node); } | SubProcessConverter extends ProcessConverterDelegate { public Result<SubProcessPropertyWriter> convertSubProcess(Node<View<? extends BPMNViewDefinition>, ?> node) { Result<SubProcessPropertyWriter> processRootResult = NodeMatch.fromNode(BaseSubprocess.class, SubProcessPropertyWriter.class) .when(EmbeddedSubprocess.class, this::convertEmbeddedSubprocessNode) .when(EventSubprocess.class, this::convertEventSubprocessNode) .when(BaseAdHocSubprocess.class, this::convertAdHocSubprocessNode) .when(MultipleInstanceSubprocess.class, this::convertMultipleInstanceSubprocessNode) .ignore(BPMNViewDefinition.class) .apply(node); if (processRootResult.isIgnored()) { return processRootResult; } DefinitionsBuildingContext subContext = context.withRootNode(node); SubProcessPropertyWriter processRoot = processRootResult.value(); super.convertChildNodes(processRoot, subContext); super.convertEdges(processRoot, subContext); return processRootResult; } SubProcessConverter(DefinitionsBuildingContext context,
PropertyWriterFactory propertyWriterFactory,
ConverterFactory converterFactory); Result<SubProcessPropertyWriter> convertSubProcess(Node<View<? extends BPMNViewDefinition>, ?> node); } |
@Test public void testConvertMultipleIntanceSubprocess() { final MultipleInstanceSubprocess definition = new MultipleInstanceSubprocess(); setBaseSubprocessExecutionSetValues(definition.getExecutionSet()); final View<MultipleInstanceSubprocess> view = new ViewImpl<>(definition, Bounds.create()); final Node<View<MultipleInstanceSubprocess>, ?> node = new NodeImpl<>(UUID.randomUUID().toString()); node.setContent(view); SubProcessPropertyWriter writer = tested.convertMultipleInstanceSubprocessNode(node); assertBaseSubprocessExecutionSet(writer); } | protected SubProcessPropertyWriter convertMultipleInstanceSubprocessNode(Node<View<MultipleInstanceSubprocess>, ?> n) { SubProcess process = bpmn2.createSubProcess(); process.setId(n.getUUID()); MultipleInstanceSubProcessPropertyWriter p = propertyWriterFactory.ofMultipleInstanceSubProcess(process); MultipleInstanceSubprocess definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); ProcessData processData = definition.getProcessData(); p.setProcessVariables(processData.getProcessVariables()); MultipleInstanceSubprocessTaskExecutionSet executionSet = definition.getExecutionSet(); p.setIsSequential(executionSet.getMultipleInstanceExecutionMode().isSequential()); p.setCollectionInput(executionSet.getMultipleInstanceCollectionInput().getValue()); p.setInput(executionSet.getMultipleInstanceDataInput().getValue()); p.setCollectionOutput(executionSet.getMultipleInstanceCollectionOutput().getValue()); p.setOutput(executionSet.getMultipleInstanceDataOutput().getValue()); p.setCompletionCondition(executionSet.getMultipleInstanceCompletionCondition().getValue()); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setAsync(executionSet.getIsAsync().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); return p; } | SubProcessConverter extends ProcessConverterDelegate { protected SubProcessPropertyWriter convertMultipleInstanceSubprocessNode(Node<View<MultipleInstanceSubprocess>, ?> n) { SubProcess process = bpmn2.createSubProcess(); process.setId(n.getUUID()); MultipleInstanceSubProcessPropertyWriter p = propertyWriterFactory.ofMultipleInstanceSubProcess(process); MultipleInstanceSubprocess definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); ProcessData processData = definition.getProcessData(); p.setProcessVariables(processData.getProcessVariables()); MultipleInstanceSubprocessTaskExecutionSet executionSet = definition.getExecutionSet(); p.setIsSequential(executionSet.getMultipleInstanceExecutionMode().isSequential()); p.setCollectionInput(executionSet.getMultipleInstanceCollectionInput().getValue()); p.setInput(executionSet.getMultipleInstanceDataInput().getValue()); p.setCollectionOutput(executionSet.getMultipleInstanceCollectionOutput().getValue()); p.setOutput(executionSet.getMultipleInstanceDataOutput().getValue()); p.setCompletionCondition(executionSet.getMultipleInstanceCompletionCondition().getValue()); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setAsync(executionSet.getIsAsync().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); return p; } } | SubProcessConverter extends ProcessConverterDelegate { protected SubProcessPropertyWriter convertMultipleInstanceSubprocessNode(Node<View<MultipleInstanceSubprocess>, ?> n) { SubProcess process = bpmn2.createSubProcess(); process.setId(n.getUUID()); MultipleInstanceSubProcessPropertyWriter p = propertyWriterFactory.ofMultipleInstanceSubProcess(process); MultipleInstanceSubprocess definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); ProcessData processData = definition.getProcessData(); p.setProcessVariables(processData.getProcessVariables()); MultipleInstanceSubprocessTaskExecutionSet executionSet = definition.getExecutionSet(); p.setIsSequential(executionSet.getMultipleInstanceExecutionMode().isSequential()); p.setCollectionInput(executionSet.getMultipleInstanceCollectionInput().getValue()); p.setInput(executionSet.getMultipleInstanceDataInput().getValue()); p.setCollectionOutput(executionSet.getMultipleInstanceCollectionOutput().getValue()); p.setOutput(executionSet.getMultipleInstanceDataOutput().getValue()); p.setCompletionCondition(executionSet.getMultipleInstanceCompletionCondition().getValue()); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setAsync(executionSet.getIsAsync().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); return p; } SubProcessConverter(DefinitionsBuildingContext context,
PropertyWriterFactory propertyWriterFactory,
ConverterFactory converterFactory); } | SubProcessConverter extends ProcessConverterDelegate { protected SubProcessPropertyWriter convertMultipleInstanceSubprocessNode(Node<View<MultipleInstanceSubprocess>, ?> n) { SubProcess process = bpmn2.createSubProcess(); process.setId(n.getUUID()); MultipleInstanceSubProcessPropertyWriter p = propertyWriterFactory.ofMultipleInstanceSubProcess(process); MultipleInstanceSubprocess definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); ProcessData processData = definition.getProcessData(); p.setProcessVariables(processData.getProcessVariables()); MultipleInstanceSubprocessTaskExecutionSet executionSet = definition.getExecutionSet(); p.setIsSequential(executionSet.getMultipleInstanceExecutionMode().isSequential()); p.setCollectionInput(executionSet.getMultipleInstanceCollectionInput().getValue()); p.setInput(executionSet.getMultipleInstanceDataInput().getValue()); p.setCollectionOutput(executionSet.getMultipleInstanceCollectionOutput().getValue()); p.setOutput(executionSet.getMultipleInstanceDataOutput().getValue()); p.setCompletionCondition(executionSet.getMultipleInstanceCompletionCondition().getValue()); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setAsync(executionSet.getIsAsync().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); return p; } SubProcessConverter(DefinitionsBuildingContext context,
PropertyWriterFactory propertyWriterFactory,
ConverterFactory converterFactory); Result<SubProcessPropertyWriter> convertSubProcess(Node<View<? extends BPMNViewDefinition>, ?> node); } | SubProcessConverter extends ProcessConverterDelegate { protected SubProcessPropertyWriter convertMultipleInstanceSubprocessNode(Node<View<MultipleInstanceSubprocess>, ?> n) { SubProcess process = bpmn2.createSubProcess(); process.setId(n.getUUID()); MultipleInstanceSubProcessPropertyWriter p = propertyWriterFactory.ofMultipleInstanceSubProcess(process); MultipleInstanceSubprocess definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); ProcessData processData = definition.getProcessData(); p.setProcessVariables(processData.getProcessVariables()); MultipleInstanceSubprocessTaskExecutionSet executionSet = definition.getExecutionSet(); p.setIsSequential(executionSet.getMultipleInstanceExecutionMode().isSequential()); p.setCollectionInput(executionSet.getMultipleInstanceCollectionInput().getValue()); p.setInput(executionSet.getMultipleInstanceDataInput().getValue()); p.setCollectionOutput(executionSet.getMultipleInstanceCollectionOutput().getValue()); p.setOutput(executionSet.getMultipleInstanceDataOutput().getValue()); p.setCompletionCondition(executionSet.getMultipleInstanceCompletionCondition().getValue()); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setAsync(executionSet.getIsAsync().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); return p; } SubProcessConverter(DefinitionsBuildingContext context,
PropertyWriterFactory propertyWriterFactory,
ConverterFactory converterFactory); Result<SubProcessPropertyWriter> convertSubProcess(Node<View<? extends BPMNViewDefinition>, ?> node); } |
@Test public void testConvertEmbeddedSubprocess() { final EmbeddedSubprocess definition = new EmbeddedSubprocess(); setBaseSubprocessExecutionSetValues(definition.getExecutionSet()); final View<EmbeddedSubprocess> view = new ViewImpl<>(definition, Bounds.create()); final Node<View<EmbeddedSubprocess>, ?> node = new NodeImpl<>(UUID.randomUUID().toString()); node.setContent(view); SubProcessPropertyWriter writer = tested.convertEmbeddedSubprocessNode(node); assertBaseSubprocessExecutionSet(writer); } | protected SubProcessPropertyWriter convertEmbeddedSubprocessNode(Node<View<EmbeddedSubprocess>, ?> n) { SubProcess process = bpmn2.createSubProcess(); process.setId(n.getUUID()); SubProcessPropertyWriter p = propertyWriterFactory.of(process); EmbeddedSubprocess definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); EmbeddedSubprocessExecutionSet executionSet = definition.getExecutionSet(); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setAsync(executionSet.getIsAsync().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); ProcessData processData = definition.getProcessData(); p.setProcessVariables(processData.getProcessVariables()); p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); return p; } | SubProcessConverter extends ProcessConverterDelegate { protected SubProcessPropertyWriter convertEmbeddedSubprocessNode(Node<View<EmbeddedSubprocess>, ?> n) { SubProcess process = bpmn2.createSubProcess(); process.setId(n.getUUID()); SubProcessPropertyWriter p = propertyWriterFactory.of(process); EmbeddedSubprocess definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); EmbeddedSubprocessExecutionSet executionSet = definition.getExecutionSet(); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setAsync(executionSet.getIsAsync().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); ProcessData processData = definition.getProcessData(); p.setProcessVariables(processData.getProcessVariables()); p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); return p; } } | SubProcessConverter extends ProcessConverterDelegate { protected SubProcessPropertyWriter convertEmbeddedSubprocessNode(Node<View<EmbeddedSubprocess>, ?> n) { SubProcess process = bpmn2.createSubProcess(); process.setId(n.getUUID()); SubProcessPropertyWriter p = propertyWriterFactory.of(process); EmbeddedSubprocess definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); EmbeddedSubprocessExecutionSet executionSet = definition.getExecutionSet(); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setAsync(executionSet.getIsAsync().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); ProcessData processData = definition.getProcessData(); p.setProcessVariables(processData.getProcessVariables()); p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); return p; } SubProcessConverter(DefinitionsBuildingContext context,
PropertyWriterFactory propertyWriterFactory,
ConverterFactory converterFactory); } | SubProcessConverter extends ProcessConverterDelegate { protected SubProcessPropertyWriter convertEmbeddedSubprocessNode(Node<View<EmbeddedSubprocess>, ?> n) { SubProcess process = bpmn2.createSubProcess(); process.setId(n.getUUID()); SubProcessPropertyWriter p = propertyWriterFactory.of(process); EmbeddedSubprocess definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); EmbeddedSubprocessExecutionSet executionSet = definition.getExecutionSet(); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setAsync(executionSet.getIsAsync().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); ProcessData processData = definition.getProcessData(); p.setProcessVariables(processData.getProcessVariables()); p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); return p; } SubProcessConverter(DefinitionsBuildingContext context,
PropertyWriterFactory propertyWriterFactory,
ConverterFactory converterFactory); Result<SubProcessPropertyWriter> convertSubProcess(Node<View<? extends BPMNViewDefinition>, ?> node); } | SubProcessConverter extends ProcessConverterDelegate { protected SubProcessPropertyWriter convertEmbeddedSubprocessNode(Node<View<EmbeddedSubprocess>, ?> n) { SubProcess process = bpmn2.createSubProcess(); process.setId(n.getUUID()); SubProcessPropertyWriter p = propertyWriterFactory.of(process); EmbeddedSubprocess definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); EmbeddedSubprocessExecutionSet executionSet = definition.getExecutionSet(); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setAsync(executionSet.getIsAsync().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); ProcessData processData = definition.getProcessData(); p.setProcessVariables(processData.getProcessVariables()); p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); return p; } SubProcessConverter(DefinitionsBuildingContext context,
PropertyWriterFactory propertyWriterFactory,
ConverterFactory converterFactory); Result<SubProcessPropertyWriter> convertSubProcess(Node<View<? extends BPMNViewDefinition>, ?> node); } |
@Test public void testConvertEventSubprocess() { final EventSubprocess definition = new EventSubprocess(); setBaseSubprocessExecutionSetValues(definition.getExecutionSet()); final View<EventSubprocess> view = new ViewImpl<>(definition, Bounds.create()); final Node<View<EventSubprocess>, ?> node = new NodeImpl<>(UUID.randomUUID().toString()); node.setContent(view); SubProcessPropertyWriter writer = tested.convertEventSubprocessNode(node); assertBaseSubprocessExecutionSet(writer); } | protected SubProcessPropertyWriter convertEventSubprocessNode(Node<View<EventSubprocess>, ?> n) { SubProcess process = bpmn2.createSubProcess(); process.setId(n.getUUID()); SubProcessPropertyWriter p = propertyWriterFactory.of(process); EventSubprocess definition = n.getContent().getDefinition(); process.setTriggeredByEvent(true); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); ProcessData processData = definition.getProcessData(); p.setProcessVariables(processData.getProcessVariables()); EventSubprocessExecutionSet executionSet = definition.getExecutionSet(); p.setAsync(executionSet.getIsAsync().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); return p; } | SubProcessConverter extends ProcessConverterDelegate { protected SubProcessPropertyWriter convertEventSubprocessNode(Node<View<EventSubprocess>, ?> n) { SubProcess process = bpmn2.createSubProcess(); process.setId(n.getUUID()); SubProcessPropertyWriter p = propertyWriterFactory.of(process); EventSubprocess definition = n.getContent().getDefinition(); process.setTriggeredByEvent(true); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); ProcessData processData = definition.getProcessData(); p.setProcessVariables(processData.getProcessVariables()); EventSubprocessExecutionSet executionSet = definition.getExecutionSet(); p.setAsync(executionSet.getIsAsync().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); return p; } } | SubProcessConverter extends ProcessConverterDelegate { protected SubProcessPropertyWriter convertEventSubprocessNode(Node<View<EventSubprocess>, ?> n) { SubProcess process = bpmn2.createSubProcess(); process.setId(n.getUUID()); SubProcessPropertyWriter p = propertyWriterFactory.of(process); EventSubprocess definition = n.getContent().getDefinition(); process.setTriggeredByEvent(true); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); ProcessData processData = definition.getProcessData(); p.setProcessVariables(processData.getProcessVariables()); EventSubprocessExecutionSet executionSet = definition.getExecutionSet(); p.setAsync(executionSet.getIsAsync().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); return p; } SubProcessConverter(DefinitionsBuildingContext context,
PropertyWriterFactory propertyWriterFactory,
ConverterFactory converterFactory); } | SubProcessConverter extends ProcessConverterDelegate { protected SubProcessPropertyWriter convertEventSubprocessNode(Node<View<EventSubprocess>, ?> n) { SubProcess process = bpmn2.createSubProcess(); process.setId(n.getUUID()); SubProcessPropertyWriter p = propertyWriterFactory.of(process); EventSubprocess definition = n.getContent().getDefinition(); process.setTriggeredByEvent(true); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); ProcessData processData = definition.getProcessData(); p.setProcessVariables(processData.getProcessVariables()); EventSubprocessExecutionSet executionSet = definition.getExecutionSet(); p.setAsync(executionSet.getIsAsync().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); return p; } SubProcessConverter(DefinitionsBuildingContext context,
PropertyWriterFactory propertyWriterFactory,
ConverterFactory converterFactory); Result<SubProcessPropertyWriter> convertSubProcess(Node<View<? extends BPMNViewDefinition>, ?> node); } | SubProcessConverter extends ProcessConverterDelegate { protected SubProcessPropertyWriter convertEventSubprocessNode(Node<View<EventSubprocess>, ?> n) { SubProcess process = bpmn2.createSubProcess(); process.setId(n.getUUID()); SubProcessPropertyWriter p = propertyWriterFactory.of(process); EventSubprocess definition = n.getContent().getDefinition(); process.setTriggeredByEvent(true); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); ProcessData processData = definition.getProcessData(); p.setProcessVariables(processData.getProcessVariables()); EventSubprocessExecutionSet executionSet = definition.getExecutionSet(); p.setAsync(executionSet.getIsAsync().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); return p; } SubProcessConverter(DefinitionsBuildingContext context,
PropertyWriterFactory propertyWriterFactory,
ConverterFactory converterFactory); Result<SubProcessPropertyWriter> convertSubProcess(Node<View<? extends BPMNViewDefinition>, ?> node); } |
@Test public void JBPM_7526_shouldSetExporter() { GraphNodeStoreImpl nodeStore = new GraphNodeStoreImpl(); NodeImpl x = new NodeImpl("x"); BPMNDiagramImpl diag = new BPMNDiagramImpl(); diag.setDiagramSet(new DiagramSet( new Name("x"), new Documentation("doc"), new Id("x"), new Package("org.jbpm"), new ProcessType(), new Version("1.0"), new AdHoc(false), new ProcessInstanceDescription("descr"), new Imports(), new Executable(true), new SLADueDate("") )); x.setContent(new ViewImpl<>(diag, Bounds.create())); nodeStore.add(x); ConverterFactory f = new ConverterFactory(new DefinitionsBuildingContext( new GraphImpl("x", nodeStore)), new PropertyWriterFactory()); DefinitionsConverter definitionsConverter = new DefinitionsConverter(f, new PropertyWriterFactory()); Definitions definitions = definitionsConverter.toDefinitions(); assertThat(definitions.getExporter()).isNotBlank(); assertThat(definitions.getExporterVersion()).isNotBlank(); } | public Definitions toDefinitions() { Definitions definitions = bpmn2.createDefinitions(); DefinitionsPropertyWriter p = propertyWriterFactory.of(definitions); ProcessPropertyWriter pp = processConverter.convertProcess(); Node<Definition<BPMNDiagram>, ?> node = converterFactory.context.firstNode(); BPMNDiagram definition = node.getContent().getDefinition(); BaseDiagramSet diagramSet = definition.getDiagramSet(); p.setExporter("jBPM Process Modeler"); p.setExporterVersion("2.0"); p.setProcess(pp.getProcess()); p.setDiagram(pp.getBpmnDiagram()); p.setRelationship(pp.getRelationship()); p.setWSDLImports(diagramSet.getImports().getValue().getWSDLImports()); p.addAllRootElements(pp.getItemDefinitions()); p.addAllRootElements(pp.getRootElements()); p.addAllRootElements(pp.getInterfaces()); return definitions; } | DefinitionsConverter { public Definitions toDefinitions() { Definitions definitions = bpmn2.createDefinitions(); DefinitionsPropertyWriter p = propertyWriterFactory.of(definitions); ProcessPropertyWriter pp = processConverter.convertProcess(); Node<Definition<BPMNDiagram>, ?> node = converterFactory.context.firstNode(); BPMNDiagram definition = node.getContent().getDefinition(); BaseDiagramSet diagramSet = definition.getDiagramSet(); p.setExporter("jBPM Process Modeler"); p.setExporterVersion("2.0"); p.setProcess(pp.getProcess()); p.setDiagram(pp.getBpmnDiagram()); p.setRelationship(pp.getRelationship()); p.setWSDLImports(diagramSet.getImports().getValue().getWSDLImports()); p.addAllRootElements(pp.getItemDefinitions()); p.addAllRootElements(pp.getRootElements()); p.addAllRootElements(pp.getInterfaces()); return definitions; } } | DefinitionsConverter { public Definitions toDefinitions() { Definitions definitions = bpmn2.createDefinitions(); DefinitionsPropertyWriter p = propertyWriterFactory.of(definitions); ProcessPropertyWriter pp = processConverter.convertProcess(); Node<Definition<BPMNDiagram>, ?> node = converterFactory.context.firstNode(); BPMNDiagram definition = node.getContent().getDefinition(); BaseDiagramSet diagramSet = definition.getDiagramSet(); p.setExporter("jBPM Process Modeler"); p.setExporterVersion("2.0"); p.setProcess(pp.getProcess()); p.setDiagram(pp.getBpmnDiagram()); p.setRelationship(pp.getRelationship()); p.setWSDLImports(diagramSet.getImports().getValue().getWSDLImports()); p.addAllRootElements(pp.getItemDefinitions()); p.addAllRootElements(pp.getRootElements()); p.addAllRootElements(pp.getInterfaces()); return definitions; } DefinitionsConverter(ConverterFactory converterFactory, PropertyWriterFactory propertyWriterFactory); DefinitionsConverter(Graph graph); } | DefinitionsConverter { public Definitions toDefinitions() { Definitions definitions = bpmn2.createDefinitions(); DefinitionsPropertyWriter p = propertyWriterFactory.of(definitions); ProcessPropertyWriter pp = processConverter.convertProcess(); Node<Definition<BPMNDiagram>, ?> node = converterFactory.context.firstNode(); BPMNDiagram definition = node.getContent().getDefinition(); BaseDiagramSet diagramSet = definition.getDiagramSet(); p.setExporter("jBPM Process Modeler"); p.setExporterVersion("2.0"); p.setProcess(pp.getProcess()); p.setDiagram(pp.getBpmnDiagram()); p.setRelationship(pp.getRelationship()); p.setWSDLImports(diagramSet.getImports().getValue().getWSDLImports()); p.addAllRootElements(pp.getItemDefinitions()); p.addAllRootElements(pp.getRootElements()); p.addAllRootElements(pp.getInterfaces()); return definitions; } DefinitionsConverter(ConverterFactory converterFactory, PropertyWriterFactory propertyWriterFactory); DefinitionsConverter(Graph graph); Definitions toDefinitions(); } | DefinitionsConverter { public Definitions toDefinitions() { Definitions definitions = bpmn2.createDefinitions(); DefinitionsPropertyWriter p = propertyWriterFactory.of(definitions); ProcessPropertyWriter pp = processConverter.convertProcess(); Node<Definition<BPMNDiagram>, ?> node = converterFactory.context.firstNode(); BPMNDiagram definition = node.getContent().getDefinition(); BaseDiagramSet diagramSet = definition.getDiagramSet(); p.setExporter("jBPM Process Modeler"); p.setExporterVersion("2.0"); p.setProcess(pp.getProcess()); p.setDiagram(pp.getBpmnDiagram()); p.setRelationship(pp.getRelationship()); p.setWSDLImports(diagramSet.getImports().getValue().getWSDLImports()); p.addAllRootElements(pp.getItemDefinitions()); p.addAllRootElements(pp.getRootElements()); p.addAllRootElements(pp.getInterfaces()); return definitions; } DefinitionsConverter(ConverterFactory converterFactory, PropertyWriterFactory propertyWriterFactory); DefinitionsConverter(Graph graph); Definitions toDefinitions(); } |
@Test public void toDefinitions() { final String LOCATION = "Location"; final String NAMESPACE = "Namespace"; ImportsValue importsValue = new ImportsValue(); importsValue.addImport(new WSDLImport(LOCATION, NAMESPACE)); BPMNDiagramImpl diag = new BPMNDiagramImpl(); diag.setDiagramSet(new DiagramSet( new Name(), new Documentation(), new Id(), new Package(), new ProcessType(), new Version(), new AdHoc(false), new ProcessInstanceDescription(), new Imports(importsValue), new Executable(true), new SLADueDate() )); GraphNodeStoreImpl nodeStore = new GraphNodeStoreImpl(); NodeImpl x = new NodeImpl("x"); x.setContent(new ViewImpl<>(diag, Bounds.create())); nodeStore.add(x); ConverterFactory f = new ConverterFactory(new DefinitionsBuildingContext(new GraphImpl("x", nodeStore)), new PropertyWriterFactory()); DefinitionsConverter definitionsConverter = new DefinitionsConverter(f, new PropertyWriterFactory()); Definitions definitions = definitionsConverter.toDefinitions(); assertImportsValue(LOCATION, NAMESPACE, definitions); } | public Definitions toDefinitions() { Definitions definitions = bpmn2.createDefinitions(); DefinitionsPropertyWriter p = propertyWriterFactory.of(definitions); ProcessPropertyWriter pp = processConverter.convertProcess(); Node<Definition<BPMNDiagram>, ?> node = converterFactory.context.firstNode(); BPMNDiagram definition = node.getContent().getDefinition(); BaseDiagramSet diagramSet = definition.getDiagramSet(); p.setExporter("jBPM Process Modeler"); p.setExporterVersion("2.0"); p.setProcess(pp.getProcess()); p.setDiagram(pp.getBpmnDiagram()); p.setRelationship(pp.getRelationship()); p.setWSDLImports(diagramSet.getImports().getValue().getWSDLImports()); p.addAllRootElements(pp.getItemDefinitions()); p.addAllRootElements(pp.getRootElements()); p.addAllRootElements(pp.getInterfaces()); return definitions; } | DefinitionsConverter { public Definitions toDefinitions() { Definitions definitions = bpmn2.createDefinitions(); DefinitionsPropertyWriter p = propertyWriterFactory.of(definitions); ProcessPropertyWriter pp = processConverter.convertProcess(); Node<Definition<BPMNDiagram>, ?> node = converterFactory.context.firstNode(); BPMNDiagram definition = node.getContent().getDefinition(); BaseDiagramSet diagramSet = definition.getDiagramSet(); p.setExporter("jBPM Process Modeler"); p.setExporterVersion("2.0"); p.setProcess(pp.getProcess()); p.setDiagram(pp.getBpmnDiagram()); p.setRelationship(pp.getRelationship()); p.setWSDLImports(diagramSet.getImports().getValue().getWSDLImports()); p.addAllRootElements(pp.getItemDefinitions()); p.addAllRootElements(pp.getRootElements()); p.addAllRootElements(pp.getInterfaces()); return definitions; } } | DefinitionsConverter { public Definitions toDefinitions() { Definitions definitions = bpmn2.createDefinitions(); DefinitionsPropertyWriter p = propertyWriterFactory.of(definitions); ProcessPropertyWriter pp = processConverter.convertProcess(); Node<Definition<BPMNDiagram>, ?> node = converterFactory.context.firstNode(); BPMNDiagram definition = node.getContent().getDefinition(); BaseDiagramSet diagramSet = definition.getDiagramSet(); p.setExporter("jBPM Process Modeler"); p.setExporterVersion("2.0"); p.setProcess(pp.getProcess()); p.setDiagram(pp.getBpmnDiagram()); p.setRelationship(pp.getRelationship()); p.setWSDLImports(diagramSet.getImports().getValue().getWSDLImports()); p.addAllRootElements(pp.getItemDefinitions()); p.addAllRootElements(pp.getRootElements()); p.addAllRootElements(pp.getInterfaces()); return definitions; } DefinitionsConverter(ConverterFactory converterFactory, PropertyWriterFactory propertyWriterFactory); DefinitionsConverter(Graph graph); } | DefinitionsConverter { public Definitions toDefinitions() { Definitions definitions = bpmn2.createDefinitions(); DefinitionsPropertyWriter p = propertyWriterFactory.of(definitions); ProcessPropertyWriter pp = processConverter.convertProcess(); Node<Definition<BPMNDiagram>, ?> node = converterFactory.context.firstNode(); BPMNDiagram definition = node.getContent().getDefinition(); BaseDiagramSet diagramSet = definition.getDiagramSet(); p.setExporter("jBPM Process Modeler"); p.setExporterVersion("2.0"); p.setProcess(pp.getProcess()); p.setDiagram(pp.getBpmnDiagram()); p.setRelationship(pp.getRelationship()); p.setWSDLImports(diagramSet.getImports().getValue().getWSDLImports()); p.addAllRootElements(pp.getItemDefinitions()); p.addAllRootElements(pp.getRootElements()); p.addAllRootElements(pp.getInterfaces()); return definitions; } DefinitionsConverter(ConverterFactory converterFactory, PropertyWriterFactory propertyWriterFactory); DefinitionsConverter(Graph graph); Definitions toDefinitions(); } | DefinitionsConverter { public Definitions toDefinitions() { Definitions definitions = bpmn2.createDefinitions(); DefinitionsPropertyWriter p = propertyWriterFactory.of(definitions); ProcessPropertyWriter pp = processConverter.convertProcess(); Node<Definition<BPMNDiagram>, ?> node = converterFactory.context.firstNode(); BPMNDiagram definition = node.getContent().getDefinition(); BaseDiagramSet diagramSet = definition.getDiagramSet(); p.setExporter("jBPM Process Modeler"); p.setExporterVersion("2.0"); p.setProcess(pp.getProcess()); p.setDiagram(pp.getBpmnDiagram()); p.setRelationship(pp.getRelationship()); p.setWSDLImports(diagramSet.getImports().getValue().getWSDLImports()); p.addAllRootElements(pp.getItemDefinitions()); p.addAllRootElements(pp.getRootElements()); p.addAllRootElements(pp.getInterfaces()); return definitions; } DefinitionsConverter(ConverterFactory converterFactory, PropertyWriterFactory propertyWriterFactory); DefinitionsConverter(Graph graph); Definitions toDefinitions(); } |
@Test public void testExecute() { Collection<WorkItemDefinition> result = tested.execute(WorkItemDefinitionRemoteRequest.build(URL, new String[]{WD1_NAME, WD2_NAME})); assertFalse(result.isEmpty()); assertEquals(2, result.size()); assertTrue(result.stream().anyMatch(w -> WD1_NAME.equals(w.getName()))); assertTrue(result.stream().anyMatch(w -> WD2_NAME.equals(w.getName()))); } | @Override public Collection<WorkItemDefinition> execute(final WorkItemDefinitionRemoteRequest request) { return fetch(lookupService, request.getUri(), request.getNames()); } | WorkItemDefinitionRemoteService implements WorkItemDefinitionService<WorkItemDefinitionRemoteRequest> { @Override public Collection<WorkItemDefinition> execute(final WorkItemDefinitionRemoteRequest request) { return fetch(lookupService, request.getUri(), request.getNames()); } } | WorkItemDefinitionRemoteService implements WorkItemDefinitionService<WorkItemDefinitionRemoteRequest> { @Override public Collection<WorkItemDefinition> execute(final WorkItemDefinitionRemoteRequest request) { return fetch(lookupService, request.getUri(), request.getNames()); } WorkItemDefinitionRemoteService(); WorkItemDefinitionRemoteService(Function<String, WorkItemsHolder> lookupService); } | WorkItemDefinitionRemoteService implements WorkItemDefinitionService<WorkItemDefinitionRemoteRequest> { @Override public Collection<WorkItemDefinition> execute(final WorkItemDefinitionRemoteRequest request) { return fetch(lookupService, request.getUri(), request.getNames()); } WorkItemDefinitionRemoteService(); WorkItemDefinitionRemoteService(Function<String, WorkItemsHolder> lookupService); @Override Collection<WorkItemDefinition> execute(final WorkItemDefinitionRemoteRequest request); static Collection<WorkItemDefinition> fetch(final Function<String, WorkItemsHolder> lookupService,
final String serviceRepoUrl,
final String[] names); } | WorkItemDefinitionRemoteService implements WorkItemDefinitionService<WorkItemDefinitionRemoteRequest> { @Override public Collection<WorkItemDefinition> execute(final WorkItemDefinitionRemoteRequest request) { return fetch(lookupService, request.getUri(), request.getNames()); } WorkItemDefinitionRemoteService(); WorkItemDefinitionRemoteService(Function<String, WorkItemsHolder> lookupService); @Override Collection<WorkItemDefinition> execute(final WorkItemDefinitionRemoteRequest request); static Collection<WorkItemDefinition> fetch(final Function<String, WorkItemsHolder> lookupService,
final String serviceRepoUrl,
final String[] names); static Function<String, WorkItemsHolder> DEFAULT_LOOKUP_SERVICE; } |
@Test public void testExecuteFiltered1() { Collection<WorkItemDefinition> result = tested.execute(WorkItemDefinitionRemoteRequest.build(URL, new String[]{WD1_NAME})); assertFalse(result.isEmpty()); assertEquals(1, result.size()); assertTrue(result.stream().anyMatch(w -> WD1_NAME.equals(w.getName()))); } | @Override public Collection<WorkItemDefinition> execute(final WorkItemDefinitionRemoteRequest request) { return fetch(lookupService, request.getUri(), request.getNames()); } | WorkItemDefinitionRemoteService implements WorkItemDefinitionService<WorkItemDefinitionRemoteRequest> { @Override public Collection<WorkItemDefinition> execute(final WorkItemDefinitionRemoteRequest request) { return fetch(lookupService, request.getUri(), request.getNames()); } } | WorkItemDefinitionRemoteService implements WorkItemDefinitionService<WorkItemDefinitionRemoteRequest> { @Override public Collection<WorkItemDefinition> execute(final WorkItemDefinitionRemoteRequest request) { return fetch(lookupService, request.getUri(), request.getNames()); } WorkItemDefinitionRemoteService(); WorkItemDefinitionRemoteService(Function<String, WorkItemsHolder> lookupService); } | WorkItemDefinitionRemoteService implements WorkItemDefinitionService<WorkItemDefinitionRemoteRequest> { @Override public Collection<WorkItemDefinition> execute(final WorkItemDefinitionRemoteRequest request) { return fetch(lookupService, request.getUri(), request.getNames()); } WorkItemDefinitionRemoteService(); WorkItemDefinitionRemoteService(Function<String, WorkItemsHolder> lookupService); @Override Collection<WorkItemDefinition> execute(final WorkItemDefinitionRemoteRequest request); static Collection<WorkItemDefinition> fetch(final Function<String, WorkItemsHolder> lookupService,
final String serviceRepoUrl,
final String[] names); } | WorkItemDefinitionRemoteService implements WorkItemDefinitionService<WorkItemDefinitionRemoteRequest> { @Override public Collection<WorkItemDefinition> execute(final WorkItemDefinitionRemoteRequest request) { return fetch(lookupService, request.getUri(), request.getNames()); } WorkItemDefinitionRemoteService(); WorkItemDefinitionRemoteService(Function<String, WorkItemsHolder> lookupService); @Override Collection<WorkItemDefinition> execute(final WorkItemDefinitionRemoteRequest request); static Collection<WorkItemDefinition> fetch(final Function<String, WorkItemsHolder> lookupService,
final String serviceRepoUrl,
final String[] names); static Function<String, WorkItemsHolder> DEFAULT_LOOKUP_SERVICE; } |
@Test public void testExecuteFiltered2() { Collection<WorkItemDefinition> result = tested.execute(WorkItemDefinitionRemoteRequest.build(URL, new String[]{WD2_NAME})); assertFalse(result.isEmpty()); assertEquals(1, result.size()); assertTrue(result.stream().anyMatch(w -> WD2_NAME.equals(w.getName()))); } | @Override public Collection<WorkItemDefinition> execute(final WorkItemDefinitionRemoteRequest request) { return fetch(lookupService, request.getUri(), request.getNames()); } | WorkItemDefinitionRemoteService implements WorkItemDefinitionService<WorkItemDefinitionRemoteRequest> { @Override public Collection<WorkItemDefinition> execute(final WorkItemDefinitionRemoteRequest request) { return fetch(lookupService, request.getUri(), request.getNames()); } } | WorkItemDefinitionRemoteService implements WorkItemDefinitionService<WorkItemDefinitionRemoteRequest> { @Override public Collection<WorkItemDefinition> execute(final WorkItemDefinitionRemoteRequest request) { return fetch(lookupService, request.getUri(), request.getNames()); } WorkItemDefinitionRemoteService(); WorkItemDefinitionRemoteService(Function<String, WorkItemsHolder> lookupService); } | WorkItemDefinitionRemoteService implements WorkItemDefinitionService<WorkItemDefinitionRemoteRequest> { @Override public Collection<WorkItemDefinition> execute(final WorkItemDefinitionRemoteRequest request) { return fetch(lookupService, request.getUri(), request.getNames()); } WorkItemDefinitionRemoteService(); WorkItemDefinitionRemoteService(Function<String, WorkItemsHolder> lookupService); @Override Collection<WorkItemDefinition> execute(final WorkItemDefinitionRemoteRequest request); static Collection<WorkItemDefinition> fetch(final Function<String, WorkItemsHolder> lookupService,
final String serviceRepoUrl,
final String[] names); } | WorkItemDefinitionRemoteService implements WorkItemDefinitionService<WorkItemDefinitionRemoteRequest> { @Override public Collection<WorkItemDefinition> execute(final WorkItemDefinitionRemoteRequest request) { return fetch(lookupService, request.getUri(), request.getNames()); } WorkItemDefinitionRemoteService(); WorkItemDefinitionRemoteService(Function<String, WorkItemsHolder> lookupService); @Override Collection<WorkItemDefinition> execute(final WorkItemDefinitionRemoteRequest request); static Collection<WorkItemDefinition> fetch(final Function<String, WorkItemsHolder> lookupService,
final String serviceRepoUrl,
final String[] names); static Function<String, WorkItemsHolder> DEFAULT_LOOKUP_SERVICE; } |
@Test public void testSetComponentsCounter() { view.setComponentsCounter(123); assertEquals("123", componentsCounter.textContent); } | @Override public void setComponentsCounter(final Integer count) { componentsCounter.textContent = count.toString(); } | DecisionComponentsView implements DecisionComponents.View { @Override public void setComponentsCounter(final Integer count) { componentsCounter.textContent = count.toString(); } } | DecisionComponentsView implements DecisionComponents.View { @Override public void setComponentsCounter(final Integer count) { componentsCounter.textContent = count.toString(); } @Inject DecisionComponentsView(final HTMLSelectElement drgElementFilter,
final HTMLInputElement termFilter,
final HTMLDivElement list,
final HTMLDivElement emptyState,
final HTMLDivElement loading,
final HTMLDivElement componentsCounter,
final TranslationService translationService); } | DecisionComponentsView implements DecisionComponents.View { @Override public void setComponentsCounter(final Integer count) { componentsCounter.textContent = count.toString(); } @Inject DecisionComponentsView(final HTMLSelectElement drgElementFilter,
final HTMLInputElement termFilter,
final HTMLDivElement list,
final HTMLDivElement emptyState,
final HTMLDivElement loading,
final HTMLDivElement componentsCounter,
final TranslationService translationService); @PostConstruct void init(); @Override void init(final DecisionComponents presenter); @EventHandler("term-filter") void onTermFilterChange(final KeyUpEvent e); @Override void clear(); @Override void addListItem(final HTMLElement htmlElement); @Override void showEmptyState(); @Override void showLoading(); @Override void hideLoading(); @Override void disableFilterInputs(); @Override void enableFilterInputs(); @Override void setComponentsCounter(final Integer count); } | DecisionComponentsView implements DecisionComponents.View { @Override public void setComponentsCounter(final Integer count) { componentsCounter.textContent = count.toString(); } @Inject DecisionComponentsView(final HTMLSelectElement drgElementFilter,
final HTMLInputElement termFilter,
final HTMLDivElement list,
final HTMLDivElement emptyState,
final HTMLDivElement loading,
final HTMLDivElement componentsCounter,
final TranslationService translationService); @PostConstruct void init(); @Override void init(final DecisionComponents presenter); @EventHandler("term-filter") void onTermFilterChange(final KeyUpEvent e); @Override void clear(); @Override void addListItem(final HTMLElement htmlElement); @Override void showEmptyState(); @Override void showLoading(); @Override void hideLoading(); @Override void disableFilterInputs(); @Override void enableFilterInputs(); @Override void setComponentsCounter(final Integer count); } |
@Test @SuppressWarnings("unchecked") public void testFilter() { Collection<WorkItemDefinition> result = tested.execute(metadata); ArgumentCaptor<DirectoryStream.Filter> filterCaptor = ArgumentCaptor.forClass(DirectoryStream.Filter.class); verify(vfsService, times(1)) .newDirectoryStream(eq(path), filterCaptor.capture()); DirectoryStream.Filter<Path> filter = filterCaptor.getValue(); Path path1 = mock(Path.class); when(path1.getFileName()).thenReturn("someFile.wid"); assertTrue(filter.accept(path1)); when(path1.getFileName()).thenReturn("someFile.bpmn"); assertFalse(filter.accept(path1)); when(path1.getFileName()).thenReturn("someFile.WID"); assertTrue(filter.accept(path1)); when(path1.getFileName()).thenReturn("someFile.WiD"); assertTrue(filter.accept(path1)); } | @Override public Collection<WorkItemDefinition> execute(final Metadata metadata) { return search(metadata); } | WorkItemDefinitionVFSLookupService implements WorkItemDefinitionService<Metadata> { @Override public Collection<WorkItemDefinition> execute(final Metadata metadata) { return search(metadata); } } | WorkItemDefinitionVFSLookupService implements WorkItemDefinitionService<Metadata> { @Override public Collection<WorkItemDefinition> execute(final Metadata metadata) { return search(metadata); } protected WorkItemDefinitionVFSLookupService(); @Inject WorkItemDefinitionVFSLookupService(final VFSService vfsService,
final WorkItemDefinitionResources resources); } | WorkItemDefinitionVFSLookupService implements WorkItemDefinitionService<Metadata> { @Override public Collection<WorkItemDefinition> execute(final Metadata metadata) { return search(metadata); } protected WorkItemDefinitionVFSLookupService(); @Inject WorkItemDefinitionVFSLookupService(final VFSService vfsService,
final WorkItemDefinitionResources resources); @Override Collection<WorkItemDefinition> execute(final Metadata metadata); Collection<WorkItemDefinition> search(final Metadata metadata); Collection<WorkItemDefinition> search(final Metadata metadata,
final Path root); Collection<WorkItemDefinition> get(final Metadata metadata,
final Path resource); } | WorkItemDefinitionVFSLookupService implements WorkItemDefinitionService<Metadata> { @Override public Collection<WorkItemDefinition> execute(final Metadata metadata) { return search(metadata); } protected WorkItemDefinitionVFSLookupService(); @Inject WorkItemDefinitionVFSLookupService(final VFSService vfsService,
final WorkItemDefinitionResources resources); @Override Collection<WorkItemDefinition> execute(final Metadata metadata); Collection<WorkItemDefinition> search(final Metadata metadata); Collection<WorkItemDefinition> search(final Metadata metadata,
final Path root); Collection<WorkItemDefinition> get(final Metadata metadata,
final Path resource); } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.