Define Conditions for Data Associations

There may be a business scenario where you want a data association to execute in runtime only when a particular condition fulfills. Control the execution of data associations in runtime by adding conditions to them in the data association editor.

A data association that has been configured with conditional mapping executes in runtime only when the defined condition fulfills. Otherwise, it fails to execute. All other data associations that do not have conditional mapping defined execute normally in runtime.

To define a new condition:

  1. Click the Data Association icon in the data association for which you want to configure a condition. You can define the new condition in the resulting dialog box.
  2. Define the new condition by entering values directly in the given field.
  3. Alternatively, use the inline expression builder to define a condition using standard functions and operators.
  4. If the condition is valid a green icon is displayed next to the Data Association icon.
  5. If the configured condition is invalid, the icon turns red indicating an error Invalid data association condition.
    Note that you can also view the error details when you click the process validation error from the process editor canvas.
  6. Finally, click Apply to save all data associations including the data associations with conditions set on them.
In runtime, the data associations for which you have defined conditions execute only if the conditions fulfill. In case of our example, if the first passenger name was entered in the Start activity form, then its value will be passed on as payload to the primary passenger field in the next activity of the process. Otherwise, the travel agent name will appear in the primary passenger field.