|
|
|
Synchronisation between Tasks 3 Months ago
|
Karma: 0
|
|
Hello,
I want to accomplish a simple thing.
A workflow is startet, and then split by a "inclusive data based" gateway. Imagine all flows (e.g. 3) are activated.
Each flow updates a global variable with additional data.
Right now - I think - the result is not determined. It looks like that the result is overwritten sometimes, sometimes not. If I execute the workflow several times, different results appear.
I designed the workflow in a consecutive way (one task after the other), and the workflow was fine.. but not optimal.
So my question: if the tasks are activated in parallel, how do I synchronize between the tasks that only ONE task accesses the global var at the same time?
Or is the only way to append the second task after the first and forgetting about executing them in parallel?
thanks
|
|
|
|
|
|
|
The administrator has disabled public write access. |
|
|
|
Re:Synchronisation between Tasks 3 Months ago
|
Karma: 26
|
|
I see two workarounds:
1. Use a variable per flow, and merge in the end.
2. Make sure the assignments are not updating the whole variable, just a small part of it related to your changes.
|
|
|
|
|
|
|
|
|
|
The administrator has disabled public write access. |
|
|
|
Re:Synchronisation between Tasks 3 Months ago
|
Karma: 0
|
|
Thanks...
Is there any way of synchronisation between tasks? I have a "inclusive data based gateway" that spawns over 3 flows. each of the updates the global var.
I use a XSLT stylesheet for updating the var... previously I found out that if I update a global var I have to copy the values from the var to the output var and append the new content. that works fine if the tasks are executed sequentially.
As stated before, I changed it to the include database based gateway. Now the result is undermined.. sometimes only the output of task 1 (which takes longer than task 2 and 3.. all of them call an external webservice) is available, sometimes the output is correct with the values of all three tasks.
|
|
|
|
|
|
|
The administrator has disabled public write access. |
|
|
|
Re:Synchronisation between Tasks 3 Months ago
|
Karma: 0
|
|
Uups, made a mistake.
Although I copied it in the XSLT sheet, I did not pass this variable in the <bpel:copy> statement...
Now it seems to work.
A technical/functional question: what happens if two tasks are simultaneously writing to the same variable? is there any kind of internal semaphore and therefore synchronisation?
|
|
|
|
|
|
|
The administrator has disabled public write access. |
|
|
|
Re:Synchronisation between Tasks 3 Months ago
|
Karma: 26
|
|
No, there is no such thing. You will need to do your own locks, or merge the flow.
Thanks,
Antoine
|
|
|
|
|
|
|
|
|
|
The administrator has disabled public write access. |
|