public AbstractFlowNodeBuilder compensationDone(){ if (compensateBoundaryEvent != null) { return compensateBoundaryEvent.getAttachedTo().builder(); } else { throw new BpmnModelException("No compensation in progress. Call compensationStart() first."); } }
public BoundaryEventBuilder boundaryEvent(String id) { BoundaryEvent boundaryEvent = createSibling(BoundaryEvent.class, id); boundaryEvent.setAttachedTo(element); BpmnShape boundaryEventBpmnShape = createBpmnShape(boundaryEvent); setBoundaryEventCoordinates(boundaryEventBpmnShape); return boundaryEvent.builder(); }
/** * Sets a catch all escalation definition. * * @return the builder object */ public B escalation() { EscalationEventDefinition escalationEventDefinition = createInstance(EscalationEventDefinition.class); element.getEventDefinitions().add(escalationEventDefinition); return myself; }
final BpmnElement dstElement = elementMap.get(event.getId()); final Activity source = event.getAttachedTo(); final BpmnElement srcElement = elementMap.get(source.getId()); graph.addEdge(srcElement, dstElement, 100);
/** * Set if the boundary event cancels the attached activity. * * @param cancelActivity true if the boundary event cancels the activiy, false otherwise * @return the builder object */ public B cancelActivity(Boolean cancelActivity) { element.setCancelActivity(cancelActivity); return myself; }
private void addServiceTaskCompensationHandler(BpmnModelInstance modelInstance, String boundaryEventId, String compensationHandlerId) { BoundaryEvent boundaryEvent = modelInstance.getModelElementById(boundaryEventId); BaseElement scope = (BaseElement) boundaryEvent.getParentElement(); ServiceTask compensationHandler = modelInstance.newInstance(ServiceTask.class); compensationHandler.setId(compensationHandlerId); compensationHandler.setForCompensation(true); compensationHandler.setCamundaClass(IncreaseCurrentTimeServiceTask.class.getName()); scope.addChildElement(compensationHandler); Association association = modelInstance.newInstance(Association.class); association.setAssociationDirection(AssociationDirection.One); association.setSource(boundaryEvent); association.setTarget(compensationHandler); scope.addChildElement(association); }
/** * Set if the boundary event cancels the attached activity. * * @param cancelActivity true if the boundary event cancels the activiy, false otherwise * @return the builder object */ public B cancelActivity(Boolean cancelActivity) { element.setCancelActivity(cancelActivity); return myself; }
public static void addUserTaskCompensationHandler(BpmnModelInstance modelInstance, String boundaryEventId, String compensationHandlerId) { BoundaryEvent boundaryEvent = modelInstance.getModelElementById(boundaryEventId); BaseElement scope = (BaseElement) boundaryEvent.getParentElement(); UserTask compensationHandler = modelInstance.newInstance(UserTask.class); compensationHandler.setId(compensationHandlerId); compensationHandler.setForCompensation(true); scope.addChildElement(compensationHandler); Association association = modelInstance.newInstance(Association.class); association.setAssociationDirection(AssociationDirection.One); association.setSource(boundaryEvent); association.setTarget(compensationHandler); scope.addChildElement(association); }
/** * Sets a catch all error definition. * * @return the builder object */ public B error() { ErrorEventDefinition errorEventDefinition = createInstance(ErrorEventDefinition.class); element.getEventDefinitions().add(errorEventDefinition); return myself; }
while (iterator.hasNext()) { BoundaryEvent tmp = iterator.next(); if (tmp.getAttachedTo().equals(element)) { attachedBoundaryEvents.add(tmp);
public BoundaryEventBuilder boundaryEvent(String id) { BoundaryEvent boundaryEvent = createSibling(BoundaryEvent.class, id); boundaryEvent.setAttachedTo(element); BpmnShape boundaryEventBpmnShape = createBpmnShape(boundaryEvent); setBoundaryEventCoordinates(boundaryEventBpmnShape); return boundaryEvent.builder(); }
/** * Set if the boundary event cancels the attached activity. * * @param cancelActivity true if the boundary event cancels the activiy, false otherwise * @return the builder object */ public B cancelActivity(Boolean cancelActivity) { element.setCancelActivity(cancelActivity); return myself; }
private void addServiceTaskCompensationHandler(BpmnModelInstance modelInstance, String boundaryEventId, String compensationHandlerId) { BoundaryEvent boundaryEvent = modelInstance.getModelElementById(boundaryEventId); BaseElement scope = (BaseElement) boundaryEvent.getParentElement(); ServiceTask compensationHandler = modelInstance.newInstance(ServiceTask.class); compensationHandler.setId(compensationHandlerId); compensationHandler.setForCompensation(true); compensationHandler.setCamundaClass(IncreaseCurrentTimeServiceTask.class.getName()); scope.addChildElement(compensationHandler); Association association = modelInstance.newInstance(Association.class); association.setAssociationDirection(AssociationDirection.One); association.setSource(boundaryEvent); association.setTarget(compensationHandler); scope.addChildElement(association); }
/** * Sets an error definition for the given error code. If already an error * with this code exists it will be used, otherwise a new error is created. * * @param errorCode the code of the error * @return the builder object */ public B error(String errorCode) { ErrorEventDefinition errorEventDefinition = createErrorEventDefinition(errorCode); element.getEventDefinitions().add(errorEventDefinition); return myself; }
public AbstractFlowNodeBuilder compensationDone(){ if (compensateBoundaryEvent != null) { return compensateBoundaryEvent.getAttachedTo().builder(); } else { throw new BpmnModelException("No compensation in progress. Call compensationStart() first."); } }
public BoundaryEventBuilder boundaryEvent(String id) { BoundaryEvent boundaryEvent = createSibling(BoundaryEvent.class, id); boundaryEvent.setAttachedTo(element); BpmnShape boundaryEventBpmnShape = createBpmnShape(boundaryEvent); setBoundaryEventCoordinates(boundaryEventBpmnShape); return boundaryEvent.builder(); }
public static void addUserTaskCompensationHandler(BpmnModelInstance modelInstance, String boundaryEventId, String compensationHandlerId) { BoundaryEvent boundaryEvent = modelInstance.getModelElementById(boundaryEventId); BaseElement scope = (BaseElement) boundaryEvent.getParentElement(); UserTask compensationHandler = modelInstance.newInstance(UserTask.class); compensationHandler.setId(compensationHandlerId); compensationHandler.setForCompensation(true); scope.addChildElement(compensationHandler); Association association = modelInstance.newInstance(Association.class); association.setAssociationDirection(AssociationDirection.One); association.setSource(boundaryEvent); association.setTarget(compensationHandler); scope.addChildElement(association); }
/** * Sets an escalation definition for the given escalation code. If already an escalation * with this code exists it will be used, otherwise a new escalation is created. * * @param escalationCode the code of the escalation * @return the builder object */ public B escalation(String escalationCode) { EscalationEventDefinition escalationEventDefinition = createEscalationEventDefinition(escalationCode); element.getEventDefinitions().add(escalationEventDefinition); return myself; }
public AbstractFlowNodeBuilder compensationDone(){ if (compensateBoundaryEvent != null) { return compensateBoundaryEvent.getAttachedTo().builder(); } else { throw new BpmnModelException("No compensation in progress. Call compensationStart() first."); } }
public B compensationStart() { if (element instanceof BoundaryEvent) { BoundaryEvent boundaryEvent = (BoundaryEvent) element; for (EventDefinition eventDefinition : boundaryEvent.getEventDefinitions()) { if(eventDefinition instanceof CompensateEventDefinition) { // if the boundary event contains a compensate event definition then // save the boundary event to later return to it and start a compensation compensateBoundaryEvent = boundaryEvent; compensationStarted = true; return myself; } } } throw new BpmnModelException("Compensation can only be started on a boundary event with a compensation event definition"); }