public Query<FlowNode> getPreviousNodes() { Collection<FlowNode> previousNodes = new HashSet<FlowNode>(); for (SequenceFlow sequenceFlow : getIncoming()) { previousNodes.add(sequenceFlow.getSource()); } return new QueryImpl<FlowNode>(previousNodes); }
protected void setWaypoints(BpmnEdge edge) { BaseElement bpmnElement = edge.getBpmnElement(); FlowNode edgeSource; FlowNode edgeTarget; if (bpmnElement instanceof SequenceFlow) { SequenceFlow sequenceFlow = (SequenceFlow) bpmnElement; edgeSource = sequenceFlow.getSource(); edgeTarget = sequenceFlow.getTarget(); } else if (bpmnElement instanceof Association){ Association association = (Association) bpmnElement; edgeSource = (FlowNode) association.getSource(); edgeTarget = (FlowNode) association.getTarget(); } else { throw new RuntimeException("Bpmn element type not supported"); } setWaypointsWithSourceAndTarget(edge, edgeSource, edgeTarget); }
private Set<SequenceFlow> getExecutableSequenceNodes(final Collection<SequenceFlow> sequenceFlows) { final HashSet<SequenceFlow> result = new HashSet<SequenceFlow>(); for (final SequenceFlow sequenceFlow : sequenceFlows) { if (definitionFlowNodes.contains(sequenceFlow.getSource())) { result.add(sequenceFlow); } } return result; }
public Query<FlowNode> getPreviousNodes() { Collection<FlowNode> previousNodes = new HashSet<FlowNode>(); for (SequenceFlow sequenceFlow : getIncoming()) { previousNodes.add(sequenceFlow.getSource()); } return new QueryImpl<FlowNode>(previousNodes); }
public Query<FlowNode> getPreviousNodes() { Collection<FlowNode> previousNodes = new HashSet<FlowNode>(); for (SequenceFlow sequenceFlow : getIncoming()) { previousNodes.add(sequenceFlow.getSource()); } return new QueryImpl<FlowNode>(previousNodes); }
protected void setWaypoints(BpmnEdge edge) { BaseElement bpmnElement = edge.getBpmnElement(); FlowNode edgeSource; FlowNode edgeTarget; if (bpmnElement instanceof SequenceFlow) { SequenceFlow sequenceFlow = (SequenceFlow) bpmnElement; edgeSource = sequenceFlow.getSource(); edgeTarget = sequenceFlow.getTarget(); } else if (bpmnElement instanceof Association){ Association association = (Association) bpmnElement; edgeSource = (FlowNode) association.getSource(); edgeTarget = (FlowNode) association.getTarget(); } else { throw new RuntimeException("Bpmn element type not supported"); } setWaypointsWithSourceAndTarget(edge, edgeSource, edgeTarget); }
protected void setWaypoints(BpmnEdge edge) { BaseElement bpmnElement = edge.getBpmnElement(); FlowNode edgeSource; FlowNode edgeTarget; if (bpmnElement instanceof SequenceFlow) { SequenceFlow sequenceFlow = (SequenceFlow) bpmnElement; edgeSource = sequenceFlow.getSource(); edgeTarget = sequenceFlow.getTarget(); } else if (bpmnElement instanceof Association){ Association association = (Association) bpmnElement; edgeSource = (FlowNode) association.getSource(); edgeTarget = (FlowNode) association.getTarget(); } else { throw new RuntimeException("Bpmn element type not supported"); } setWaypointsWithSourceAndTarget(edge, edgeSource, edgeTarget); }
for (final SequenceFlow flow : flows) { final BpmnElement flowElement = elementMap.get(flow.getId()); final BpmnElement srcElement = elementMap.get(flow.getSource().getId()); final BpmnElement destElement = elementMap.get(flow.getTarget().getId());
/** * Events aren't reported like SequenceFlows and Activities, so we need * special handling. If a sequence flow has an event as the source or the * target, we add it to the coverage. It's pretty straight forward if a * sequence flow is active, then it's source has been covered anyway and it * will most definitely arrive at its target. * * @param transitionId * @param processDefinition * @param repositoryService */ private void handleEvent(String transitionId, ProcessDefinition processDefinition, RepositoryService repositoryService) { final BpmnModelInstance modelInstance = repositoryService.getBpmnModelInstance(processDefinition.getId()); final ModelElementInstance modelElement = modelInstance.getModelElementById(transitionId); if (modelElement.getElementType().getInstanceType() == SequenceFlow.class) { final SequenceFlow sequenceFlow = (SequenceFlow) modelElement; // If there is an event at the sequence flow source add it to the // coverage final FlowNode source = sequenceFlow.getSource(); addEventToCoverage(processDefinition, source); // If there is an event at the sequence flow target add it to the // coverage final FlowNode target = sequenceFlow.getTarget(); addEventToCoverage(processDefinition, target); } }