@Override protected void executeValidation(BpmnModel bpmnModel, Process process, List<ValidationError> errors) { List<EventGateway> eventGateways = process.findFlowElementsOfType(EventGateway.class); for (EventGateway eventGateway : eventGateways) { for (SequenceFlow sequenceFlow : eventGateway.getOutgoingFlows()) { FlowElement flowElement = process.getFlowElement(sequenceFlow.getTargetRef(), true); if (flowElement != null && !(flowElement instanceof IntermediateCatchEvent)) { addError(errors, Problems.EVENT_GATEWAY_ONLY_CONNECTED_TO_INTERMEDIATE_EVENTS, process, eventGateway, "Event based gateway can only be connected to elements of type intermediateCatchEvent"); } } } }
List<SequenceFlow> outgoingSequenceFlows = eventGateway.getOutgoingFlows(); Set<String> eventActivityIds = new HashSet<String>(outgoingSequenceFlows.size() - 1); // -1, the event being triggered does not need to be deleted for (SequenceFlow outgoingSequenceFlow : outgoingSequenceFlows) {
@Override protected void executeValidation(BpmnModel bpmnModel, Process process, List<ValidationError> errors) { List<EventGateway> eventGateways = process.findFlowElementsOfType(EventGateway.class); for (EventGateway eventGateway : eventGateways) { for (SequenceFlow sequenceFlow : eventGateway.getOutgoingFlows()) { FlowElement flowElement = process.getFlowElement(sequenceFlow.getTargetRef(), true); if (flowElement != null && flowElement instanceof IntermediateCatchEvent == false) { addError(errors, Problems.EVENT_GATEWAY_ONLY_CONNECTED_TO_INTERMEDIATE_EVENTS, process, eventGateway, "Event based gateway can only be connected to elements of type intermediateCatchEvent"); } } } }
List<SequenceFlow> outgoingSequenceFlows = eventGateway.getOutgoingFlows(); Set<String> eventActivityIds = new HashSet<String>(outgoingSequenceFlows.size() - 1); // -1, the event being triggered does not need to be deleted for (SequenceFlow outgoingSequenceFlow : outgoingSequenceFlows) {
protected void executeParse(BpmnParse bpmnParse, EventGateway gateway) { ActivityImpl activity = createActivityOnCurrentScope(bpmnParse, gateway, BpmnXMLConstants.ELEMENT_GATEWAY_EVENT); activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createEventBasedGatewayActivityBehavior(gateway)); activity.setScope(true); // find all outgoing sequence flows BpmnModel bpmnModel = bpmnParse.getBpmnModel(); for (SequenceFlow sequenceFlow : gateway.getOutgoingFlows()) { FlowElement flowElement = bpmnModel.getFlowElement(sequenceFlow.getTargetRef()); if (flowElement != null && flowElement instanceof IntermediateCatchEvent == false) { bpmnModel.addProblem("Event based gateway can only be connected to elements of type intermediateCatchEvent.", flowElement); } } }