protected void handleConstraints(Process process, Activity activity, List<ValidationError> errors) { if (activity.getId() != null && activity.getId().length() > ID_MAX_LENGTH) { addError(errors, Problems.FLOW_ELEMENT_ID_TOO_LONG, process, activity, "The id of a flow element must not contain more than " + ID_MAX_LENGTH + " characters"); } }
@Override protected void writeAdditionalAttributes(BaseElement element, BpmnModel model, XMLStreamWriter xtw) throws Exception { BoundaryEvent boundaryEvent = (BoundaryEvent) element; if (boundaryEvent.getAttachedToRef() != null) { writeDefaultAttribute(ATTRIBUTE_BOUNDARY_ATTACHEDTOREF, boundaryEvent.getAttachedToRef().getId(), xtw); } if (boundaryEvent.getEventDefinitions().size() == 1) { EventDefinition eventDef = boundaryEvent.getEventDefinitions().get(0); if (eventDef instanceof ErrorEventDefinition == false) { writeDefaultAttribute(ATTRIBUTE_BOUNDARY_CANCELACTIVITY, String.valueOf(boundaryEvent.isCancelActivity()).toLowerCase(), xtw); } } }
protected void convertElementToJson(ObjectNode propertiesNode, BaseElement baseElement) { BoundaryEvent boundaryEvent = (BoundaryEvent) baseElement; ArrayNode dockersArrayNode = objectMapper.createArrayNode(); ObjectNode dockNode = objectMapper.createObjectNode(); GraphicInfo graphicInfo = model.getGraphicInfo(boundaryEvent.getId()); GraphicInfo parentGraphicInfo = model.getGraphicInfo(boundaryEvent.getAttachedToRef().getId()); dockNode.put(EDITOR_BOUNDS_X, graphicInfo.getX() - parentGraphicInfo.getX()); dockNode.put(EDITOR_BOUNDS_Y, graphicInfo.getY() - parentGraphicInfo.getY()); dockersArrayNode.add(dockNode); flowElementNode.set("dockers", dockersArrayNode); propertiesNode.put(PROPERTY_CANCEL_ACTIVITY, boundaryEvent.isCancelActivity()); addEventProperties(boundaryEvent, propertiesNode); }
protected void handleBoundaryEvents() { for (BoundaryEvent boundaryEvent : boundaryEvents) { mxGeometry geometry = new mxGeometry(0.8, 1.0, eventSize, eventSize); geometry.setOffset(new mxPoint(-(eventSize / 2), -(eventSize / 2))); geometry.setRelative(true); mxCell boundaryPort = new mxCell(null, geometry, "shape=ellipse;perimter=ellipsePerimeter"); boundaryPort.setId("boundary-event-" + boundaryEvent.getId()); boundaryPort.setVertex(true); Object portParent = null; if (boundaryEvent.getAttachedToRefId() != null) { portParent = generatedVertices.get(boundaryEvent.getAttachedToRefId()); } else if (boundaryEvent.getAttachedToRef() != null) { portParent = generatedVertices.get(boundaryEvent.getAttachedToRef().getId()); } else { throw new RuntimeException("Could not generate DI: boundaryEvent '" + boundaryEvent.getId() + "' has no attachedToRef"); } graph.addCell(boundaryPort, portParent); generatedVertices.put(boundaryEvent.getId(), boundaryPort); } }
List<ExecutionEntity> miChildExecutions = executionEntityManager.findChildExecutionsByParentExecutionId(miExecution.getId()); for (ExecutionEntity miChildExecution : miChildExecutions) { if (subProcessExecution.getId().equals(miChildExecution.getId()) == false && activity.getId().equals(miChildExecution.getCurrentActivityId())) { executionEntityManager.deleteExecutionAndRelatedData(miChildExecution, deleteReason, false);
if (childExecutions != null) { for (ExecutionEntity childExecution : childExecutions) { if (activity.getId().equals(childExecution.getCurrentActivityId())) { callActivityExecutionIds.add(childExecution.getId()); && callActivityExecutionIds.contains(childExecution.getSuperExecutionId())) { executionEntityManager.deleteProcessInstanceExecutionEntity(childExecution.getId(), activity.getId(), "call activity completion condition met", true, false);
scopeExecution, compensationActivity.getId());
public class Activity { private long id; private String name; private boolean done; private boolean important; //Getters and setters @Override public boolean equals(Object o) { if (o instanceof Activity) { Activity other = (Activity) o; return this.getId() == other.getId(); } return false; } }
protected void handleConstraints(Process process, Activity activity, List<ValidationError> errors) { if (activity.getId() != null && activity.getId().length() > ID_MAX_LENGTH) { addError(errors, Problems.FLOW_ELEMENT_ID_TOO_LONG, process, activity, "The id of a flow element must not contain more than " + ID_MAX_LENGTH + " characters"); } }
@Override protected void writeAdditionalAttributes(BaseElement element, BpmnModel model, XMLStreamWriter xtw) throws Exception { BoundaryEvent boundaryEvent = (BoundaryEvent) element; if (boundaryEvent.getAttachedToRef() != null) { writeDefaultAttribute(ATTRIBUTE_BOUNDARY_ATTACHEDTOREF, boundaryEvent.getAttachedToRef().getId(), xtw); } if (boundaryEvent.getEventDefinitions().size() == 1) { EventDefinition eventDef = boundaryEvent.getEventDefinitions().get(0); if (eventDef instanceof ErrorEventDefinition == false) { writeDefaultAttribute(ATTRIBUTE_BOUNDARY_CANCELACTIVITY, String.valueOf(boundaryEvent.isCancelActivity()).toLowerCase(), xtw); } } }
@Override protected void writeAdditionalAttributes(BaseElement element, XMLStreamWriter xtw) throws Exception { BoundaryEvent boundaryEvent = (BoundaryEvent) element; if (boundaryEvent.getAttachedToRef() != null) { writeDefaultAttribute(ATTRIBUTE_BOUNDARY_ATTACHEDTOREF, boundaryEvent.getAttachedToRef().getId(), xtw); } if (boundaryEvent.getEventDefinitions().size() == 1) { EventDefinition eventDef = boundaryEvent.getEventDefinitions().get(0); if (eventDef instanceof ErrorEventDefinition == false) { writeDefaultAttribute(ATTRIBUTE_BOUNDARY_CANCELACTIVITY, String.valueOf(boundaryEvent.isCancelActivity()).toLowerCase(), xtw); } } }
protected void convertElementToJson(ObjectNode propertiesNode, BaseElement baseElement) { BoundaryEvent boundaryEvent = (BoundaryEvent) baseElement; ArrayNode dockersArrayNode = objectMapper.createArrayNode(); ObjectNode dockNode = objectMapper.createObjectNode(); GraphicInfo graphicInfo = model.getGraphicInfo(boundaryEvent.getId()); GraphicInfo parentGraphicInfo = model.getGraphicInfo(boundaryEvent.getAttachedToRef().getId()); dockNode.put(EDITOR_BOUNDS_X, graphicInfo.getX() - parentGraphicInfo.getX()); dockNode.put(EDITOR_BOUNDS_Y, graphicInfo.getY() - parentGraphicInfo.getY()); dockersArrayNode.add(dockNode); flowElementNode.set("dockers", dockersArrayNode); propertiesNode.put(PROPERTY_CANCEL_ACTIVITY, boundaryEvent.isCancelActivity()); addEventProperties(boundaryEvent, propertiesNode); }
@Override public void onLocationChanged(Location location) { longitude = location.getLongitude(); latitude = location.getLatitude(); Log.i("", "Latitude: " + latitude); Log.i("", "Longitude: " + longitude); if(activities != null) { for (Activity activity : activities) { Location newLocation = new Location(provider); newLocation.setLongitude(activity.getLongitude()); newLocation.setLatitude(activity.getLatitude()); if(location.distanceTo(newLocation) > 15 && activity.isInProximity()) { activity.setInProximity(false); stopTimer(activity.getId()); } else if (location.distanceTo(newLocation) <= 15 && !activity.isInProximity()) { activity.setInProximity(true); startTimer(activity.getId()); } } } }
protected void handleBoundaryEvents() { for (BoundaryEvent boundaryEvent : boundaryEvents) { mxGeometry geometry = new mxGeometry(0.8, 1.0, eventSize, eventSize); geometry.setOffset(new mxPoint(-(eventSize/2), -(eventSize/2))); geometry.setRelative(true); mxCell boundaryPort = new mxCell(null, geometry, "shape=ellipse;perimter=ellipsePerimeter"); boundaryPort.setId("boundary-event-" + boundaryEvent.getId()); boundaryPort.setVertex(true); Object portParent = null; if (boundaryEvent.getAttachedToRefId() != null) { portParent = generatedVertices.get(boundaryEvent.getAttachedToRefId()); } else if (boundaryEvent.getAttachedToRef() != null) { portParent = generatedVertices.get(boundaryEvent.getAttachedToRef().getId()); } else { throw new RuntimeException("Could not generate DI: boundaryEvent '" + boundaryEvent.getId() + "' has no attachedToRef"); } graph.addCell(boundaryPort, portParent); generatedVertices.put(boundaryEvent.getId(), boundaryPort); } }
List<ExecutionEntity> miChildExecutions = executionEntityManager.findChildExecutionsByParentExecutionId(miExecution.getId()); for (ExecutionEntity miChildExecution : miChildExecutions) { if (subProcessExecution.getId().equals(miChildExecution.getId()) == false && activity.getId().equals(miChildExecution.getCurrentActivityId())) { executionEntityManager.deleteExecutionAndRelatedData(miChildExecution, deleteReason, false);
if (childExecutions != null) { for (ExecutionEntity childExecution : childExecutions) { if (activity.getId().equals(childExecution.getCurrentActivityId())) { callActivityExecutionIds.add(childExecution.getId()); && callActivityExecutionIds.contains(childExecution.getSuperExecutionId())) { executionEntityManager.deleteProcessInstanceExecutionEntity(childExecution.getId(), activity.getId(), "call activity completion condition met", true, false);
MultiInstanceActivityBehavior miParallelActivityBehavior = null; MultiInstanceActivityBehavior miSequentialActivityBehavior = null; ActivityImpl activity = bpmnParse.getCurrentScope().findActivity(modelActivity.getId()); if (activity == null) { bpmnParse.getBpmnModel().addProblem("Activity " + modelActivity.getId() + " needed for multi instance cannot bv found", modelActivity);
scopeExecution, compensationActivity.getId());