Best practise to update process variables with external data

Hi,

we have an external system that saves some data which has to be updated in my process when it is edited in the external system.
I thought I could handle this via the tasklistener (assignment event). But it is possible that someone claims a user task and works on it a few days later, so the data could be old again.

What I need is to look after new data in the external system at the moment, when a user clicks on the task in his tasklist.


Is there any event or something where I can do that? If not, have you got an idea how I can handle this situation?

Thank you a lot
Nicole

Hello @NickiMueller,
You could use an event based subprocess with a non-interrupting message start event. The message is being sent from your UI and triggers the variables value update. These values then can be loaded by the task form.

https://camunda.com/best-practices/building-flexibility-into-bpmn-models/#_event_sub_processes

Best, McAlm

1 Like

Hello @McAlm,
thank you for your idea. But it is not clear for me.

What do you mean with “triggered from the UI?”. Something like javascript ‘onload’?

But when I do this, how does the event subprocess know that it should be carried out?

Here is my example.
grafik
I want that the event subprocess is carried out when the user wants to work on task “Antrag ausfüllen”

“Antrag ausfüllen” has a form where I can fill in the javascript “onload”: grafik

And then? How das the event subprocess know that it should be carried out?

Thank you a lot for more explanation / examples.
Nicole

I think it’s supposed that the external system sends a request to your process which is then translated to the start event of the subprocess.

If the external system does not care about any processes then I’d probably use a timer start event. I.e. perform time based polling of the external data.

The client needs to trigger (send) an event to the backend. You can use some javascript to send a rest request to your backend application that correlates the message to your process instance.