1
votes

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!

1
considering the fact you have flagged Java: there are no global variables in Java.Stultuske

1 Answers

2
votes

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.