Hi. My use case is that (I had to put all the information in one image because the forum says that new users can upload only one image):
I think the image is self-explanatory, but if not, this is the description: I have a list of documents that need to be uploaded by a user and reviewed by another one. In the review Task, the user should fill a boolean value that represents if the document is ok. If the document is ok, it flows to the next task; otherwise, the flow should return to the Upload task.
What I tried to do:
I created a form variable “isOk” in each of the Review tasks and a complete listener to set an execution variable based on this form variable (image above).
But I realized that the scope of the form variable is the entire process instance. That way, the second Task of the type “Review” will be initialized with the value filled in the first Task of type “Review”.
I could solve this problem by creating different variable names based on the document name (for example, isDutOk, isCnhOk etc) and eliminating the listener. But I am not happy with this solution. The problem is that as a programming best-practice, it is better to make the scope of a variable as strict as possible. Moreover, if all tasks had the same variable name, it could be much easier to copy/paste to create other ones.
Can I create a more generic variable name only in the scope of a single Task in Camunda and makes this flow works?
I am also sending my bpmn if you want to inspect it.
Thanks in advance!
poc-docs-default (copy).bpmn (10.7 KB)