use of org.camunda.bpm.model.bpmn.instance.BaseElement in project camunda-bpm-platform by camunda.
the class CompensateEventOrderTest method addServiceTaskCompensationHandler.
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);
}
use of org.camunda.bpm.model.bpmn.instance.BaseElement in project camunda-bpm-platform by camunda.
the class CompensationModels method addUserTaskCompensationHandler.
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);
}
Aggregations