Modify BpmnModel before deploy


Where is the best place to modify BpmnModel before deploy process? The main goal is to create some boundary timer events or service tasks programatically. Can i use (pre/post)BpmnParseHandlers?

Thanks in advance.

Hi João,

Can you provide a use case for changing model before a deployment.
BPMNParseHandlers are used for hooking into process model parsing. You do not change model or deployment but the change is done on the parsed deployment in the memory. That’s a good place to add something (e.g. logger,…) into process instance behavior.


Hi Martin,

We would like to do the following (pex):

  • Add an execution listener to some user tasks based on some configuration (this configuration could exist in property files or database)

    • Should i use BPMNParseHandlers to do this?
  • Create a boundary timer event for some user tasks using some configuration too

    • We want to “enforce” or ease the modeling for “regular users” and for some users tasks we would like to create a boundary timer event connected to a service task or a notification task

    • We want to add this automatically before process deployment

I know that all of this can be done in the modeler directly, but we would like to “add some common behaviour” based on some configurations to avoid depende on users to remember this.

Is possible to do this?

Should this be done here or not done at all :slight_smile: ?

final BpmnModel model = new BpmnJsonConverter().convertToBpmnModel(modelNode);
// TODO: change model here before deployment?
final Deployment deployment = service.createDeployment()
    .addBpmnModel("name", model)


Hi João,

Yes, ParseHandler is exactly the place where you can add required functionality.

I would use Parse handlers. May be easier way would be to add a listener which will create a timer.