public void createBPMNEdge(String key, List<GraphicInfo> graphicList) { FlowElement flowElement = bpmnModel.getFlowElement(key); if (flowElement instanceof SequenceFlow) { SequenceFlow sequenceFlow = (SequenceFlow) flowElement; List<Integer> waypoints = new ArrayList<Integer>(); for (GraphicInfo waypointInfo : graphicList) { waypoints.add((int) waypointInfo.getX()); waypoints.add((int) waypointInfo.getY()); } sequenceFlow.setWaypoints(waypoints); } else if (bpmnModel.getArtifact(key) != null) { // it's an association, so nothing to do } else { LOGGER.warn("Invalid reference in 'bpmnElement' attribute, sequenceFlow " + key + " not found"); } }
if (bpmnModel.getFlowElement(bpmnReference) == null) { addWarning(errors, Problems.DI_INVALID_REFERENCE, null, bpmnModel.getFlowElement(bpmnReference), "Invalid reference in diagram interchange definition: could not find " + bpmnReference); } else if (!(bpmnModel.getFlowElement(bpmnReference) instanceof FlowNode)) { addWarning(errors, Problems.DI_DOES_NOT_REFERENCE_FLOWNODE, null, bpmnModel.getFlowElement(bpmnReference), "Invalid reference in diagram interchange definition: " + bpmnReference + " does not reference a flow node"); if (bpmnModel.getFlowElement(bpmnReference) == null) { addWarning(errors, Problems.DI_INVALID_REFERENCE, null, bpmnModel.getFlowElement(bpmnReference), "Invalid reference in diagram interchange definition: could not find " + bpmnReference); } else if (!(bpmnModel.getFlowElement(bpmnReference) instanceof SequenceFlow)) { addWarning(errors, Problems.DI_DOES_NOT_REFERENCE_SEQ_FLOW, null, bpmnModel.getFlowElement(bpmnReference), "Invalid reference in diagram interchange definition: " + bpmnReference + " does not reference a sequence flow");
protected String getPrecedingEventBasedGateway(BpmnParse bpmnParse, IntermediateCatchEvent event) { String eventBasedGatewayId = null; for (SequenceFlow sequenceFlow : event.getIncomingFlows()) { FlowElement sourceElement = bpmnParse.getBpmnModel().getFlowElement(sequenceFlow.getSourceRef()); if (sourceElement instanceof EventGateway) { eventBasedGatewayId = sourceElement.getId(); break; } } return eventBasedGatewayId; }
if (bpmnModel.getFlowElement(bpmnReference) == null) { } else if (!(bpmnModel.getFlowElement(bpmnReference) instanceof FlowNode)) { LOGGER.warn("Invalid reference in diagram interchange definition: " + bpmnReference + " does not reference a flow node"); if (bpmnModel.getFlowElement(bpmnReference) == null) { } else if (!(bpmnModel.getFlowElement(bpmnReference) instanceof SequenceFlow)) { LOGGER.warn("Invalid reference in diagram interchange definition: " + bpmnReference + " does not reference a sequence flow"); if (bpmnModel.getFlowElement(edgeId) != null) { createBPMNEdge(edgeId, bpmnModel.getFlowLocationGraphicInfo(edgeId));
/** * Returns the current {@link FlowElement} where the {@link DelegateExecution} is currently at. */ public static FlowElement getFlowElement(DelegateExecution execution) { BpmnModel bpmnModel = getBpmnModel(execution); FlowElement flowElement = bpmnModel.getFlowElement(execution.getCurrentActivityId()); if (flowElement == null) { throw new ActivitiException("Could not find a FlowElement for activityId " + execution.getCurrentActivityId()); } return flowElement; }
if (model.getFlowElement(elementId) != null || model.getArtifact(elementId) != null || model.getPool(elementId) != null || model.getLane(elementId) != null) { FlowElement flowElement = model.getFlowElement(elementId); if (flowElement instanceof SubProcess && graphicInfo.getExpanded() != null) { xtw.writeAttribute(ATTRIBUTE_DI_IS_EXPANDED, String.valueOf(graphicInfo.getExpanded())); if (model.getFlowElement(elementId) != null || model.getArtifact(elementId) != null || model.getMessageFlow(elementId) != null) { FlowElement flowElement = model.getFlowElement(elementId); MessageFlow messageFlow = null; if (flowElement == null) {
FlowElement attachedToFlowElement = bpmnModel.getFlowElement(boundaryEvent.getAttachedToRefId()); if (!(attachedToFlowElement instanceof Transaction)) { addError(errors, Problems.BOUNDARY_EVENT_CANCEL_ONLY_ON_TRANSACTION, process, boundaryEvent, "boundary event with cancelEventDefinition only supported on transaction subprocesses"); addError(errors, Problems.BOUNDARY_EVENT_MULTIPLE_CANCEL_ON_TRANSACTION, process, bpmnModel.getFlowElement(elementId), "multiple boundary events with cancelEventDefinition not supported on same transaction subprocess."); addError(errors, Problems.COMPENSATE_EVENT_MULTIPLE_ON_BOUNDARY, process, bpmnModel.getFlowElement(elementId), "Multiple boundary events of type 'compensate' is invalid");
BaseElement sourceElement = bpmnModel.getFlowElement(sourceRef); BaseElement targetElement = bpmnModel.getFlowElement(targetRef); if (sourceElement == null) { sourceElement = bpmnModel.getArtifact(sourceRef);
FlowElement defaultFlowElement = model.getFlowElement(activity.getDefaultFlow()); if (defaultFlowElement instanceof SequenceFlow) { writeDefaultAttribute(ATTRIBUTE_DEFAULT, activity.getDefaultFlow(), xtw); final Gateway gateway = (Gateway) baseElement; if (StringUtils.isNotEmpty(gateway.getDefaultFlow())) { FlowElement defaultFlowElement = model.getFlowElement(gateway.getDefaultFlow()); if (defaultFlowElement instanceof SequenceFlow) { writeDefaultAttribute(ATTRIBUTE_DEFAULT, gateway.getDefaultFlow(), xtw);
SubProcess subProcess = (SubProcess) bpmnModel.getFlowElement(execution.getActivityId()); for (ValuedDataObject dataObject : subProcess.getDataObjects()) { if (dataObject.getName().equals(variableEntity.getName())) {
if (model.getFlowElement(dataAssociation.getSourceRef()) != null) { createDataAssociation(dataAssociation, true, if (model.getFlowElement(dataAssociation.getTargetRef()) != null) { createDataAssociation(dataAssociation, false,
SubProcess subProcess = (SubProcess) bpmnModel.getFlowElement(executionEntity.getActivityId()); for (ValuedDataObject dataObject : subProcess.getDataObjects()) { if (dataObject.getName().equals(variableEntity.getName())) {
FlowElement sourceElement = bpmnModel.getFlowElement(sourceRef); FlowElement targetElement = bpmnModel.getFlowElement(targetRef); List<GraphicInfo> graphicInfoList = bpmnModel.getFlowLocationGraphicInfo(sequenceFlow.getId()); if (graphicInfoList != null && graphicInfoList.size() > 0) {
if (flowElement instanceof SequenceFlow) { SequenceFlow sequenceFlow = (SequenceFlow) flowElement; lookForElement = model.getFlowElement(sequenceFlow.getSourceRef()); } else { lookForElement = flowElement;
SubProcess subProcess = (SubProcess) bpmnModel.getFlowElement(executionEntity.getActivityId()); for (ValuedDataObject dataObjectDefinition : subProcess.getDataObjects()) { if (dataObjectDefinition.getName().equals(variableEntity.getName())) {
SubProcess subProcess = (SubProcess) bpmnModel.getFlowElement(execution.getActivityId()); for (ValuedDataObject dataObjectDefinition : subProcess.getDataObjects()) { if (dataObjectDefinition.getName().equals(variableEntity.getName())) {
FlowElement sourceElement = bpmnModel.getFlowElement(sourceRef); FlowElement targetElement = bpmnModel.getFlowElement(targetRef); List<GraphicInfo> graphicInfoList = bpmnModel.getFlowLocationGraphicInfo(sequenceFlow.getId()); if (graphicInfoList != null && graphicInfoList.size() > 0) {
/** * Returns the current {@link FlowElement} where the {@link DelegateExecution} is currently at. */ public static FlowElement getFlowElement(DelegateExecution execution) { BpmnModel bpmnModel = getBpmnModel(execution); FlowElement flowElement = bpmnModel.getFlowElement(execution.getCurrentActivityId()); if (flowElement == null) { throw new ActivitiException("Could not find a FlowElement for activityId " + execution.getCurrentActivityId()); } return flowElement; }
protected String getPrecedingEventBasedGateway(BpmnParse bpmnParse, IntermediateCatchEvent event) { String eventBasedGatewayId = null; for (SequenceFlow sequenceFlow : event.getIncomingFlows()) { FlowElement sourceElement = bpmnParse.getBpmnModel().getFlowElement(sequenceFlow.getSourceRef()); if (sourceElement instanceof EventGateway) { eventBasedGatewayId = sourceElement.getId(); break; } } return eventBasedGatewayId; }
protected String getPrecedingEventBasedGateway(BpmnParse bpmnParse, IntermediateCatchEvent event) { String eventBasedGatewayId = null; for (SequenceFlow sequenceFlow : event.getIncomingFlows()) { FlowElement sourceElement = bpmnParse.getBpmnModel().getFlowElement(sequenceFlow.getSourceRef()); if (sourceElement instanceof EventGateway) { eventBasedGatewayId = sourceElement.getId(); break; } } return eventBasedGatewayId; }