I want to know if we can set a list of string values during the process initiation from springboot and once done, can we check if a string value exists within the list at the modeler gateway.
consider below example,
stringVariableList = [“apple”,“orange”,mango"]; ← Can we set something like this in java?
now within the modeler gateway can I check stringVariableList.contains(“apple”) → go to task 1, stringVariableList.contains(“orange”) → go to task 2, else task 3. If yes, pls let me the approach to achieve this.
@syedkp It’s possible to store variable as list in camunda.
stringVariableList = [“apple”,“orange”,”mango”];
stringVariableList.contains(“apple”) → go to task 1, stringVariableList.contains(“orange”) → go to task 2, else task 3
In this case, if you want to create tasks only for a few specific items, then checking the condition using XOR gateway would be perfect. Conditions can be configured in the outgoing sequence flows from the XOR Gateway.
If you want to create a task for each items in the list then a multi-instance task would be perfect for this use case.
@aravindhrs - Thanks for your response. I wanted to know the syntax. like simple boolean I used to check this way #{isAppleAvailable==true} but how will the above check be validated? Is it this way? #{stringVariableList.contains(“apple”)==true}. Please share some example for my better understanding. TIA.
@aravindhrs - This worked, thanks. Do you know how will the condition be set in camunda 8 and I dont see the options as expression or script.
I tried this way, = stringVariableList.contains(“apple”) but it failed saying its returning java.lang.String instead of java.lang.boolean.