I have a service task where a python program creates a list of items from a DB and this list will be provided via the output variables to the next user task
The user task gets this list and puts in the camunda embedded form’s select element so that the user can select one of those items.
So now my issue:
Sometimes the list is not up2date (item is not in the list). Thats why this list should be updated some time later by repopulating the listed items. As in the current solution this select element is static after the previous task is done. With javscript and a webform this could be easily done in a setup with a webform. How could I solve this problem in my setup as there is no availability of a user fronted with a webform.
Workaround is that the user discards this processInstance and creates a new one next time when he knows for sure that the item is available.
Hi @gevezex - I’m not sure I fully understand your question. Do you mean that sometimes a user task sits in Tasklist long enough that the select options are now out of date, and you’re looking for a way to re-populate the values on an existing task?
If @nathan.loding is correct and the list is getting out of date after a time (1 day?!), you can use a timer bondary non interrupting event to call a service task from time to time updating the list variable.
If you still want to make possible for your user to finish the task saying “item was not found, please update the list”, you can make it an option on your user task and have an exclusive gateway after validating it. If user said you need to reload the list, go back to the service task that updates the list and open the user task again.
@nathan.loding yes exactly that. Is there a way to solve this in the form by having some javascript option to always get the latest list by some webservice endpoint and ajax? If not what are my options?
@gevezex - Tasklist does not support Javascript, so the task itself cannot do this. I don’t think @Jean_Robert_Alves suggestion is quite right, either - once the task is created, it doesn’t pull new variables from the process; you need to update the variables in the task itself.
I haven’t tested this, but I think what you need to do is have a timeout that calls a service task/job worker, and that worker sends the updated data to the Tasklist API. You will need to know the task ID and send that to the job worker too. I think using this endpoint should work … but as I said, I haven’t tested it!
Hmm, the behavior i wrote works in our camunda 7 process as it takes the process variables to fill the form, but i think you are right about how it works now on camunda 8.
These breaking changes still kills me everytime.