Hello eveyone,
How to pass form data information from running the current process instance to another running process instance (passing data information between two process instances)?
Hello @YazanAsaad ,
for passing variables from one process instance to another one, there are several possibilities:
- Setting variable via Runtime Service: Very easy, but consider that setting a variable in another process should affect the behaviour of the process, usually
- Sending a message via Runtime Service: Make sure the target process is waiting for a message. This message can contain a map of variables which are set in the target process. This was is more explicit as the target process has some kind of catching message Event or task.
- Sending a signal via Runtime Service: Edge case, as signals are not targeted.
Hope this helps
Jonathan
Helllo @jonathan.lukas
I attached what i want to do, the project is a BPMN model that describes an online requesting products and orders, in the end of the process a summary form should be send to admin in order to manage the orders (screenshot has been attached for summery from), I started to get form variables by using Scrips (screenshot has been attached for extracting form’s variable).
I want to sharing/passing form’s variable to admin by using Service Task (screenshot has been attached for Admin BPMN).
Can you help me in that? what I should do and write for that?
Admin.bpmn
Processing: SendSummeryToAdmin.js… (2.9 KB)
SendToAdminForm.form (3.7 KB)
Hello Dear,
It does not work, this what I has do.
What I share/passing form’s variable and sending the variables to admin,
I will be so happy and grateful if you help me in writing this code,
Hello @YazanAsaad ,
please use the Implementation “External” for the service task and enter “OrderDetailsToAdmin” in the topic field.
This will fix it.
Jonathan
Hello @jonathan.lukas
Form’s variable and variable definitions in the script are local variables, I use the external for service task and I get undefined variables,
Hello @YazanAsaad,
for referencing the correct form, please provide the following:
- Choose this option for Forms type:
- As form ref, enter the id of the form you created, as binding select deployment.
- Deploy the process and the form to the engine
- Start a process instance. After filling the form data, inspect the variables created in the cockpit.
- Design your external Task Handler according to the variables you can see in the cockpit for this process instance.
Also, @Niall created some awesome videos. Please watch this one, as it is quite close to your use case:
Jonathan
Hello @jonathan.lukas
I watched this wonderful video, what Nill has done is sharing/ passing the variabel between two process instances in the same BPMN, what I want to do is sharing/passing form’s variables between two BPMN models, the first model to user and the second model is for system admin, the system admin get the form’s data information from user.
Or sending a Service Task between two BPMN models,
Yazan,
Hello @YazanAsaad ,
from what I understand about your requirements is that you are trying to decouple processes.
This is an example on how this can be done:
The data store object between the two processes is an abstract representation of a storage you might want to use to save the order summaries from the process above until you need them for the process below.
Is this close to what you imagine your process to work like?
Jonathan
Hello @jonathan.lukas
I will try to do that,
Yazan,
Hello @jonathan.lukas
Is there any tutorials/ videos in order to learn how to do that?
Yazan,
@Hafflgav ,
is there an example on loose process coupling via data source?
Hello,
I want to share/pass form’s data variables from one process to another by using storage in database, how can I do that? it requres any settings?
I did that without any settings and there was any reaction in camunda tasklist when I am reaching to this point.
Hey @YazanAsaad and @jonathan.lukas
In such a case I would also recommend to use a domain database to exchange data between two distinct processes or even Camunda instances.
To achieve this you would need to read and write data to your domain database. You are free to choose the database in such a case. Nevertheless you need to integrate it by yourself.
Apparently I am not aware of any tutorials about this topic.
I would rather use some message send event between those two processes.
Best,
Thomas