How to pass bidirectional parameter from business process to sequential sub-process and retain value
I have a business process where I want to go through a collection of records, so I create a sequential sub-process to go through them. To this sub-process I also want to pass a string from main process to sequentially concatenate new values onto the string passed between main and sub-process.
For each new instance of sub-process I would then have a string in main process that is updated to "1" and then "1,2", then "1,2,3" and so on.
I have created this string in main process and passed it to a corresponding string in sub-process, however when passing the parameter I cant get it to set a value that is retained in main process. I will attach pics to describe the scenario better:
And here is the subprocess:
Like
Hi!
Unfortunately, in a business process using a sequential subprocess, direct data transfer between the parent and subprocess between iterations is not possible. The parent process cannot read or receive data created by the subprocess because that data is not persisted between iterations.
However, you can achieve the desired result by storing the values between iterations in a database table instead of your current element "Set relation role on Actor A". The subprocess can write each new value to this table, and the parent process can retrieve this data from the table after each iteration.
Here's how you can do it:
-
Create a table in the database that will be used to store the values. For example, name it "SubprocessData" and add a column to store the values (e.g., "Value").
-
In the subprocess, after computing the new value, perform an insertion operation to insert that value into the "SubprocessData" table.
-
After the subprocess completes, in the parent process, execute a query against the "SubprocessData" table to retrieve all the values stored during the subprocess iterations.
-
Use the retrieved values for further processing in the parent process, such as creating strings like "1", "1,2", "1,2,3", and so on.
This approach will allow you to persist values between iterations and pass them from the subprocess to the parent process.
Hi!
Unfortunately, in a business process using a sequential subprocess, direct data transfer between the parent and subprocess between iterations is not possible. The parent process cannot read or receive data created by the subprocess because that data is not persisted between iterations.
However, you can achieve the desired result by storing the values between iterations in a database table instead of your current element "Set relation role on Actor A". The subprocess can write each new value to this table, and the parent process can retrieve this data from the table after each iteration.
Here's how you can do it:
-
Create a table in the database that will be used to store the values. For example, name it "SubprocessData" and add a column to store the values (e.g., "Value").
-
In the subprocess, after computing the new value, perform an insertion operation to insert that value into the "SubprocessData" table.
-
After the subprocess completes, in the parent process, execute a query against the "SubprocessData" table to retrieve all the values stored during the subprocess iterations.
-
Use the retrieved values for further processing in the parent process, such as creating strings like "1", "1,2", "1,2,3", and so on.
This approach will allow you to persist values between iterations and pass them from the subprocess to the parent process.
Alla Blinova,
Hello. Sorry for the late reply, this approach actually worked using a database field to store the value from each subprocess iteration. Thanks for the detailed explanation!