Multi Instance Send Task

Another way in which Barium Live supports multi instance tasks is the multi instance send task. This features allows a task to send multiple process messages which is extremely useful for when you want to trigger an application multiple times by process message. The number of times the send task is triggered depends on the number of selections made in a multi select field in an associated data object form and each instance triggered by the process message can be named using the individual values from the multi select field.

If you instead want a task to trigger multiple times based on the number of users in a specific role check out the article on Multi Instance Task.



How to set up your Multi Instance Send Task

You need to configure both a sending and a receiving process application, one containing the Send Task and the other being triggered multiple times by it. Bellow you will find a step by step guide on how to set up first the receiving process and then the sending one.


Setting up the receiving process triggered by the Send Task


1. Create a new BPMN 2.0 process


2. Create a form template containing the multi select field you wish to govern how many times this process is initiated and associate the form template to the start event.

3. Set the start event to message type and configure it, giving it a name and specifying what form fields should be populated on initiation.

NOTE: In order to have each instance named from the multi select field that decides how many instances are created, it is important you configure this field to be populated by the process message as shown below.

 4. Finally, publish and deploy this process and when the Configure Process screen shows, press the Instance Settings tab and set the name with a variable referencing that same multi select field as mentioned above, the multi select field that dictates the number of instances created by the multi instance send task.


 

5. The process we want to trigger multiple times with the send task is now done!

Setting up the sending process containing the triggering Send Task


1.Create a new BPMN 2.0 process


2. Add a new pool, double click it and turn on the collapsed black box feature and select the process application just created earlier that you wish to trigger multiple times with your send task.

3. Attach a form template to your start event containing the same multi select field used in the application you wish to trigger multiple times.


4. Add a task, set it to type Send Task, connect it to the black box pool, associate the data object created by the form template finally set it ti Loop type Multi Instance. As explained by the text it is defaulted to create a number of instances based on the number of users in the current role. We don't want this so we press the change button and are prompted to select a multi select field in an associate data object to base the number of times this task is run on instead. Once we've selected the multi select field the text will instead read "Multi instance based on selected values in 'dataObject.field'.


5. Finally, configure the message by double clicking the Send Task and clicking the Configure message button. 



6. Under the Message fields tab you will find what data the receiving application expects. In order to name each created instance based on the multi select values, change Value type to Multi Instance and Value to Name. This will ensure that the Multi Instance name will be based on the values in the multi select field.



7. Both the triggering and the multi-triggered applications have bow been created and once run, the triggering application will start a number of instances of the receiving process depending on the number of values selected in the multi select field.

Read more on setting up a process message to start another application.