Pre process task

Hi everyone!

I would like to add some tasks before the first step of a proccess. Is there a way to execute those tasks when the proccess is instantiated if they are not defined in the BPMN?

Thank you,
Ignacio.

Hi @Ignacio_Requena_Elvi,

you have several options to achive this:

  1. You can model the steps in another BPMN process which ends which a message end event and starts your original process from here: https://docs.camunda.org/manual/7.10/reference/bpmn20/events/message-events/#message-end-event.
  2. You can model the steps in another BPMN process with the last task as service task to start your original process.
  3. You can model the steps in another BPMN process and call the original process with a call activity: https://docs.camunda.org/manual/7.10/reference/bpmn20/subprocesses/call-activity/. Then your superprocess will finish when your original process is finished.
  4. You can hard code the service calls in your java program that starts your original process. But I wouldn’t do this.

Hope this helps, Ingo

1 Like

In addition to the options Ingo mentioned, if you can edit the process, you could add an ExecutionListener to the process’ start event (or the actual start event of the process). The actions there remain functionally invisible in the process diagram, but are still executed before any other activity. Of course, you can wonder whether you really want them invisible (ie, purely technical) or want to make them visible, just not in this process. In the latter case, Ingo’s options are better :slight_smile:

1 Like