protected String getCurrentFlowElementId() { FlowElement flowElement = getExecutionEntity().getCurrentFlowElement(); if (flowElement instanceof SequenceFlow) { SequenceFlow sequenceFlow = (SequenceFlow) flowElement; return sequenceFlow.getSourceRef() + " -> " + sequenceFlow.getTargetRef(); } else if (flowElement != null) { return flowElement.getId() + " (" + flowElement.getClass().getSimpleName(); } else { return ""; } }
Object targetVertex = generatedVertices.get(sequenceFlow.getTargetRef());
@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"); } } } }
@Override protected void writeAdditionalAttributes(BaseElement element, BpmnModel model, XMLStreamWriter xtw) throws Exception { SequenceFlow sequenceFlow = (SequenceFlow) element; writeDefaultAttribute(ATTRIBUTE_FLOW_SOURCE_REF, sequenceFlow.getSourceRef(), xtw); writeDefaultAttribute(ATTRIBUTE_FLOW_TARGET_REF, sequenceFlow.getTargetRef(), xtw); if (StringUtils.isNotEmpty(sequenceFlow.getSkipExpression())) { writeDefaultAttribute(ATTRIBUTE_FLOW_SKIP_EXPRESSION, sequenceFlow.getSkipExpression(), xtw); } }
if (sequenceFlows != null && sequenceFlows.size() > 0) { for (SequenceFlow sequenceFlow : sequenceFlows) { String targetRef = sequenceFlow.getTargetRef(); FlowNode sequenceFlowTarget = (FlowNode) process.getFlowElement(targetRef, true); if (sequenceFlowTarget != null && !visitedElements.contains(sequenceFlowTarget.getId())) {
dockNode.put(EDITOR_BOUNDS_X, model.getGraphicInfo(sequenceFlow.getTargetRef()).getWidth() / 2.0); dockNode.put(EDITOR_BOUNDS_Y, model.getGraphicInfo(sequenceFlow.getTargetRef()).getHeight() / 2.0); dockersArrayNode.add(dockNode); flowNode.set("dockers", dockersArrayNode); ArrayNode outgoingArrayNode = objectMapper.createArrayNode(); outgoingArrayNode.add(BpmnJsonConverterUtil.createResourceNode(sequenceFlow.getTargetRef())); flowNode.set("outgoing", outgoingArrayNode); flowNode.set("target", BpmnJsonConverterUtil.createResourceNode(sequenceFlow.getTargetRef()));
protected void executeParse(BpmnParse bpmnParse, SequenceFlow sequenceFlow) { org.activiti.bpmn.model.Process process = bpmnParse.getCurrentProcess(); sequenceFlow.setSourceFlowElement(process.getFlowElement(sequenceFlow.getSourceRef(), true)); sequenceFlow.setTargetFlowElement(process.getFlowElement(sequenceFlow.getTargetRef(), true)); }
FlowNode targetNode = getFlowNodeFromScope(sequenceFlow.getTargetRef(), parentScope); if (targetNode != null) { targetNode.getIncomingFlows().add(sequenceFlow);
FlowElement targetFlowElement = parentContainer.getFlowElement(sequenceFlow.getTargetRef()); if (targetFlowElement != null && targetFlowElement instanceof FlowNode) { ((FlowNode) targetFlowElement).getIncomingFlows().add(sequenceFlow);
String targetRef = sequenceFlow.getTargetRef();
String targetRef = sequenceFlow.getTargetRef(); FlowElement sourceElement = bpmnModel.getFlowElement(sourceRef); FlowElement targetElement = bpmnModel.getFlowElement(targetRef);
String targetRef = sequenceFlow.getTargetRef(); FlowElement sourceElement = bpmnModel.getFlowElement(sourceRef); FlowElement targetElement = bpmnModel.getFlowElement(targetRef);
public static List<FlowElement> findSucessorFlowElementsFor( Process process, FlowElement sourceFlowElement) { List<FlowElement> successors = new ArrayList<FlowElement>(); for (SequenceFlow sequenceFlow : process.findFlowElementsOfType(SequenceFlow.class)) { if (sequenceFlow.getSourceRef().equals(sourceFlowElement.getId())) { successors.add(process.getFlowElement(sequenceFlow.getTargetRef())); } } return successors; }
protected String getCurrentFlowElementId() { FlowElement flowElement = getExecutionEntity().getCurrentFlowElement(); if (flowElement instanceof SequenceFlow) { SequenceFlow sequenceFlow = (SequenceFlow) flowElement; return sequenceFlow.getSourceRef() + " -> " + sequenceFlow.getTargetRef(); } else if (flowElement != null) { return flowElement.getId() + " (" + flowElement.getClass().getSimpleName(); } else { return ""; } }
@Override protected void writeAdditionalAttributes(BaseElement element, XMLStreamWriter xtw) throws Exception { SequenceFlow sequenceFlow = (SequenceFlow) element; writeDefaultAttribute(ATTRIBUTE_FLOW_SOURCE_REF, sequenceFlow.getSourceRef(), xtw); writeDefaultAttribute(ATTRIBUTE_FLOW_TARGET_REF, sequenceFlow.getTargetRef(), xtw); }
@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"); } } } }
protected void processSequenceFlows() { for (SequenceFlow sequenceFlow : sequenceFlows) { Node sourceNode = nodeMap.get(sequenceFlow.getSourceRef()); Node targetNode = nodeMap.get(sequenceFlow.getTargetRef()); Relationship sequenceflowRelationship = sourceNode.createRelationshipTo(targetNode, RelTypes.SEQ_FLOW); sequenceflowRelationship.setProperty("id", sequenceFlow.getId()); if (sequenceFlow.getConditionExpression() != null) { sequenceflowRelationship.setProperty("condition", sequenceFlow.getConditionExpression()); } } }
@Override protected void writeAdditionalAttributes(BaseElement element, BpmnModel model, XMLStreamWriter xtw) throws Exception { SequenceFlow sequenceFlow = (SequenceFlow) element; writeDefaultAttribute(ATTRIBUTE_FLOW_SOURCE_REF, sequenceFlow.getSourceRef(), xtw); writeDefaultAttribute(ATTRIBUTE_FLOW_TARGET_REF, sequenceFlow.getTargetRef(), xtw); if (StringUtils.isNotEmpty(sequenceFlow.getSkipExpression())) { writeDefaultAttribute(ATTRIBUTE_FLOW_SKIP_EXPRESSION, sequenceFlow.getSkipExpression(), xtw); } }
protected void executeParse(BpmnParse bpmnParse, SequenceFlow sequenceFlow) { org.activiti.bpmn.model.Process process = bpmnParse.getCurrentProcess(); sequenceFlow.setSourceFlowElement(process.getFlowElement(sequenceFlow.getSourceRef(), true)); sequenceFlow.setTargetFlowElement(process.getFlowElement(sequenceFlow.getTargetRef(), true)); }
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); } } }