use of io.camunda.zeebe.model.bpmn.instance.Activity in project zeebe by camunda.
the class ProcessBuilderTest method testCompensateEventDefintionCatchBoundaryEvent.
@Test
public void testCompensateEventDefintionCatchBoundaryEvent() {
modelInstance = Bpmn.createProcess().startEvent().userTask("userTask").boundaryEvent("catch").compensateEventDefinition().waitForCompletion(false).compensateEventDefinitionDone().endEvent("end").done();
final CompensateEventDefinition eventDefinition = assertAndGetSingleEventDefinition("catch", CompensateEventDefinition.class);
final Activity activity = eventDefinition.getActivity();
assertThat(activity).isNull();
assertThat(eventDefinition.isWaitForCompletion()).isFalse();
}
use of io.camunda.zeebe.model.bpmn.instance.Activity in project zeebe by camunda.
the class ProcessBuilderTest method testCompensateEventDefintionCatchStartEvent.
@Test
public void testCompensateEventDefintionCatchStartEvent() {
modelInstance = Bpmn.createProcess().startEvent("start").compensateEventDefinition().waitForCompletion(false).compensateEventDefinitionDone().userTask("userTask").endEvent("end").done();
final CompensateEventDefinition eventDefinition = assertAndGetSingleEventDefinition("start", CompensateEventDefinition.class);
final Activity activity = eventDefinition.getActivity();
assertThat(activity).isNull();
assertThat(eventDefinition.isWaitForCompletion()).isFalse();
}
use of io.camunda.zeebe.model.bpmn.instance.Activity in project zeebe by camunda.
the class ProcessBuilderTest method testCompensateEventDefintionThrowEndEvent.
@Test
public void testCompensateEventDefintionThrowEndEvent() {
modelInstance = Bpmn.createProcess().startEvent().userTask("userTask").endEvent("end").compensateEventDefinition().activityRef("userTask").waitForCompletion(true).compensateEventDefinitionDone().done();
final CompensateEventDefinition eventDefinition = assertAndGetSingleEventDefinition("end", CompensateEventDefinition.class);
final Activity activity = eventDefinition.getActivity();
assertThat(activity).isEqualTo(modelInstance.getModelElementById("userTask"));
assertThat(eventDefinition.isWaitForCompletion()).isTrue();
}
use of io.camunda.zeebe.model.bpmn.instance.Activity in project zeebe by camunda.
the class AbstractBaseElementBuilder method createBpmnShape.
public BpmnShape createBpmnShape(final FlowNode node) {
final BpmnPlane bpmnPlane = findBpmnPlane();
if (bpmnPlane != null) {
final BpmnShape bpmnShape = createInstance(BpmnShape.class);
bpmnShape.setBpmnElement(node);
final Bounds nodeBounds = createInstance(Bounds.class);
if (node instanceof SubProcess) {
bpmnShape.setExpanded(true);
nodeBounds.setWidth(350);
nodeBounds.setHeight(200);
} else if (node instanceof Activity) {
nodeBounds.setWidth(100);
nodeBounds.setHeight(80);
} else if (node instanceof Event) {
nodeBounds.setWidth(36);
nodeBounds.setHeight(36);
} else if (node instanceof Gateway) {
nodeBounds.setWidth(50);
nodeBounds.setHeight(50);
if (node instanceof ExclusiveGateway) {
bpmnShape.setMarkerVisible(true);
}
}
nodeBounds.setX(0);
nodeBounds.setY(0);
bpmnShape.addChildElement(nodeBounds);
bpmnPlane.addChildElement(bpmnShape);
return bpmnShape;
}
return null;
}
use of io.camunda.zeebe.model.bpmn.instance.Activity in project zeebe by camunda.
the class AbstractCompensateEventDefinitionBuilder method activityRef.
public B activityRef(final String activityId) {
final Activity activity = modelInstance.getModelElementById(activityId);
if (activity == null) {
throw new BpmnModelException("Activity with id '" + activityId + "' does not exist");
}
final 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;
}
Aggregations