public GatewayPropertyReader of(Gateway el) { return new GatewayPropertyReader(el, diagram, definitionResolver.getShape(el.getId()), definitionResolver.getResolutionFactor()); }
@Before public void setup() { when(definitionResolver.getResolutionFactor()).thenReturn(RESOLUTION_FACTOR); when(catchEvent.getId()).thenReturn(CATCH_EVENT_ID); when(boundaryEvent.getId()).thenReturn(BOUNDARY_EVENT_ID); when(throwEvent.getId()).thenReturn(THROW_EVENT_ID); when(gateway.getId()).thenReturn(GATEWAY_EVENT_ID); when(definitionResolver.getShape(eq(CATCH_EVENT_ID))).thenReturn(catchEventShape); when(definitionResolver.getShape(eq(BOUNDARY_EVENT_ID))).thenReturn(boundaryEventShape); when(definitionResolver.getShape(eq(THROW_EVENT_ID))).thenReturn(throwEventShape); when(definitionResolver.getShape(eq(GATEWAY_EVENT_ID))).thenReturn(gatewayEventShape); this.catchEventPropertyReader = new CatchEventPropertyReader(catchEvent, diagram, definitionResolver); this.boundaryEventPropertyReader = spy(new BoundaryEventPropertyReader(boundaryEvent, diagram, definitionResolver)); this.throwEventPropertyReader = new ThrowEventPropertyReader(throwEvent, diagram, definitionResolver); this.gatewayPropertyReader = new GatewayPropertyReader(gateway, diagram, gatewayEventShape, RESOLUTION_FACTOR); }
private BpmnNode parallelGateway(Gateway gateway) { Node<View<ParallelGateway>, Edge> node = factoryManager.newNode(gateway.getId(), ParallelGateway.class); GatewayPropertyReader p = propertyReaderFactory.of(gateway); node.getContent().setBounds(p.getBounds()); ParallelGateway definition = node.getContent().getDefinition(); definition.setGeneral(new BPMNGeneralSet( new Name(p.getName()), new Documentation(p.getDocumentation()) )); definition.setDimensionsSet(p.getCircleDimensionSet()); definition.setFontSet(p.getFontSet()); definition.setBackgroundSet(p.getBackgroundSet()); return BpmnNode.of(node); } }
private BpmnNode exclusiveGateway(Gateway gateway) { Node<View<ExclusiveGateway>, Edge> node = factoryManager.newNode(gateway.getId(), ExclusiveGateway.class); ExclusiveGateway definition = node.getContent().getDefinition(); GatewayPropertyReader p = propertyReaderFactory.of(gateway); definition.setGeneral(new BPMNGeneralSet( new Name(p.getName()), new Documentation(p.getDocumentation()) )); definition.setExecutionSet(new GatewayExecutionSet( new DefaultRoute(p.getDefaultRoute()) )); node.getContent().setBounds(p.getBounds()); definition.setDimensionsSet(p.getCircleDimensionSet()); definition.setFontSet(p.getFontSet()); definition.setBackgroundSet(p.getBackgroundSet()); return BpmnNode.of(node); }
private BpmnNode inclusiveGateway(Gateway gateway) { Node<View<InclusiveGateway>, Edge> node = factoryManager.newNode(gateway.getId(), InclusiveGateway.class); InclusiveGateway definition = node.getContent().getDefinition(); GatewayPropertyReader p = propertyReaderFactory.of(gateway); definition.setGeneral(new BPMNGeneralSet( new Name(p.getName()), new Documentation(p.getDocumentation()) )); definition.setExecutionSet(new GatewayExecutionSet( new DefaultRoute(p.getDefaultRoute()) )); node.getContent().setBounds(p.getBounds()); definition.setDimensionsSet(p.getCircleDimensionSet()); definition.setFontSet(p.getFontSet()); definition.setBackgroundSet(p.getBackgroundSet()); return BpmnNode.of(node); }