How To Pass Variables to Reusable Sub Process

1,218 views
Skip to first unread message

Madhu Nali

unread,
Aug 25, 2015, 1:05:59 AM8/25/15
to jBPM Usage

Hi,

I have age and name fields in my process. I am able to pass these values from one activity to another activity

But, I am unable to pass these values to sub process(I have used assignment, DataInputSet and DataOutputSet)

Can any one help me how can i pass the values from process to reusable sub process


Thanks,
Madhu N.

Abhijit Humbe

unread,
Aug 25, 2015, 1:29:30 AM8/25/15
to Madhu Nali, jBPM Usage
Hi,
Try with following steps:

- Create a variable in the parent process, clicking in an empty space in the parent process canvas and adding an attribute to "Variables Definitions" in the Properties tool bar (right side menu bar), naming it, for example, "processInstanceId"
- Clicking on the Reusable SubProcess Node, define a dataInputSet which will be mapped to a process variable in the subprocess - let's call it "parentProcessInstanceId"
- Create a map for "processInstanceId" to "parentProcessInstanceId", it is done by the Assignments property, there you define this kind of mapping.
~~
FromObject: processInstanceId
Assignment Type: is mapping to
ToObject: parentProcessInstanceId
~~
- Create a process variable in the sub process, opening that process, and defining a new local Variable Definition using the same name ("parentProcessInstanceId") used in the DataInputSet in the subprocess node in parent process.

Hope it helps..

Abhijit Humbe

--
You received this message because you are subscribed to the Google Groups "jBPM Usage" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jbpm-usage+...@googlegroups.com.
To post to this group, send email to jbpm-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jbpm-usage/5f156e09-3ad5-44e0-b2e2-cfcb0084b09e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Madhu Nali

unread,
Aug 25, 2015, 2:10:17 AM8/25/15
to jBPM Usage, madhu...@gmail.com
Hi Abhijit,

Thanks for the reply,

I understood upto

FromObject: processInstanceId
Assignment Type: is mapping to
ToObject: parentProcessInstanceId

 and created like as you said

After that, i added a variable "parentProcessInstanceId" in sub process and added in DataInputSet also 

Can you plz tell me how can i map

for example i want to forward "age" value from main process to subprocess

FromObject: age

Assignment Type: is mapping to
ToObject: parentProcessInstanceId

is this correct or do i need to change any thing.

Abhijit Humbe

unread,
Aug 25, 2015, 4:51:29 AM8/25/15
to Madhu Nali, jBPM Usage
Hi,
Take a look at attached BPMN processes.

Abhijit Humbe

executeProcess.bpmn2
reusableTest.bpmn2

Madhu Nali

unread,
Aug 25, 2015, 9:27:35 AM8/25/15
to jBPM Usage, madhu...@gmail.com
Hi ,

I tried with your files and just added one user task to get the values(user submitted values) in sub-process 

But i am getting null

variable mapped into sub process:null

I am attaching the files what i have tried please find the below
If possible please let me know where i did mistake
reusableTest.bpmn2
executeProcess.bpmn2
ExampleActivity-taskform.form
Reply all
Reply to author
Forward
0 new messages