Best practices to feed input to the instance of a BPMN Process

Hi,
I’m using CAMUNDA primarily as a decision management tool. The rules must be implemented on the record that is fed to the instance. What are the best practices for feeding the input record to that instance? I have two methods to feed the record to the instance:

  1. Feeding the data while starting the instance with the ‘variables’ method:

final ProcessInstanceEvent processInstanceEvent =
client
.NewCreateInstanceCommand()
.BpmnProcessId(bpmnProcessId)
.LatestVersion()
.Variables(data)
.Send();

  1. Adding a service task after the start event in the BPMN process, where the service task is implemented in the application and will read the data from the application.

What is the best practice, and why? Are there any other ways to feed data to the instance of the process?"

Can anyone give reply to this question.

Hi @Nani_2000,

technically, from the perspective of the business rules task, there is no difference between the two approaches.

A difference may arise from the view of the process and the services you have at hand or develop to make this running.

If you give all variables with the start event, you should name the start event accordingly, that something happened to start the process instance with values.

If you read the values in the first task, another event happened to just start the process instance, and you have a task to read the required values from another system.

From the process controlling point of view, the second option can measure how long it took to read values, and it can raise incidents in case the values cannot be read.

But there is no best practice to follow option 1 or 2.

Hope this helps, Ingo

1 Like