简体   繁体   中英

How to use a globally defined variable in jBPM 6?

What are the differences in usage between the local and global variables in jBPM 6?

I have a variable named id that needs to persist in a single process instance. Currently I'm using I/O Parameters to pass this id variable from one task to another task for all the tasks in the workflow. Is there a way that I set this id variable at the start of the process just once and able to access this id variable in all of my custom work item handlers? Is using global variable a suitable way to do this? If so, how I can access the global variables in a custom work item handler?

Thanks!

I would recommend you to do the mappings for all the tasks. You don't want to pass all the process variables to all the work items or human tasks, that's why the I/O mapping exists. I do recognise that by default you should be able to have access to all the variables, but that restriction is defined in the BPMN spec.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM