use of org.camunda.bpm.model.bpmn.instance.UserTask 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);
}
use of org.camunda.bpm.model.bpmn.instance.UserTask in project camunda-bpm-platform by camunda.
the class TaskListenerProcessEngineServicesAccessTest method createModelAccessTask.
protected Task createModelAccessTask(BpmnModelInstance modelInstance, Class<?> delegateClass) {
UserTask task = modelInstance.newInstance(UserTask.class);
task.setId("userTask");
CamundaTaskListener executionListener = modelInstance.newInstance(CamundaTaskListener.class);
executionListener.setCamundaEvent(TaskListener.EVENTNAME_CREATE);
executionListener.setCamundaClass(delegateClass.getName());
task.builder().addExtensionElement(executionListener);
return task;
}
Aggregations