Search in sources :

Example 1 with BpmnModelException

use of org.camunda.bpm.model.bpmn.BpmnModelException in project camunda-bpmn-model by camunda.

the class AbstractCompensateEventDefinitionBuilder method activityRef.

public B activityRef(String activityId) {
    Activity activity = modelInstance.getModelElementById(activityId);
    if (activity == null) {
        throw new BpmnModelException("Activity with id '" + activityId + "' does not exist");
    }
    Event event = (Event) element.getParentElement();
    if (activity.getParentElement() != event.getParentElement()) {
        throw new BpmnModelException("Activity with id '" + activityId + "' must be in the same scope as '" + event.getId() + "'");
    }
    element.setActivity(activity);
    return myself;
}
Also used : BpmnModelException(org.camunda.bpm.model.bpmn.BpmnModelException) Activity(org.camunda.bpm.model.bpmn.instance.Activity) Event(org.camunda.bpm.model.bpmn.instance.Event) BoundaryEvent(org.camunda.bpm.model.bpmn.instance.BoundaryEvent)

Aggregations

BpmnModelException (org.camunda.bpm.model.bpmn.BpmnModelException)1 Activity (org.camunda.bpm.model.bpmn.instance.Activity)1 BoundaryEvent (org.camunda.bpm.model.bpmn.instance.BoundaryEvent)1 Event (org.camunda.bpm.model.bpmn.instance.Event)1