Fluent builder API boundary events

I’m using the fluent builder API to generate some process definitions on the fly. I know the support is limited, but I was wondering about boundary events. They are not documented as supported. It seems however that there are builders in there and the generated process contains the boundaries if you define them. I can’t find how to complete the path though.

I tried something like this after a service task:

.boundaryEvent("some-id")
                .error("code", "name").endEvent()...

However, anything I add after this gets stuck on to the same path after the end event. How do I end the path from the boundary event and proceed with the outgoing flow from the same service task?

Hi @tiesebarrell,

#moveToActivity does the job. Full example:

BpmnModelInstance modelInstance = Bpmn.createExecutableProcess()
  .startEvent()
  .userTask("userTask")
    .boundaryEvent("boundary")
    .error("error")
    .endEvent()
  .moveToActivity("userTask")
  .userTask("nextTask")
  .endEvent()
  .done();

This build API is tested and support by the way. It is not yet documented at https://docs.camunda.org/manual/7.11/user-guide/model-api/bpmn-model-api/fluent-builder-api/ though.

Cheers,
Thorben

2 Likes

Hi Thorben,

That is awesome! I’ll check that as soon as I can but it looks like that’s exactly the option I couldn’t find :+1:t2:

It would be a good idea to document it a bit more, I think. I also noticed there doesn’t seem to be a way to add documentation to elements. That would also be a neat addition.

Now I’m off to find how far I can take this thing :slight_smile:

Thanks, Thorben!