Query on variable scope

cancel
Showing results for 
Search instead for 
Did you mean: 
swamy2156
Active Member

Query on variable scope

My workflow has 50 constant data values rather create these variables for each instance, Is there a way to define them as constants at process definition level or so? So those will be used by process instances under that process definition.

2 Replies
wabson
Active Member II

Re: Query on variable scope

Could you give more info on where you want to access the constants from? If you are utilising them from inside a service task then you could put them in your Java class. You can also add custom beans to resolve values in your BPMN at runtime from expressions.

Note Activiti Enterprise has Data Models that allow you to store constants inside a related DB table, but you will not have that if you are using the Community engine. See this blog post for more info on this feature.

gdharley
Intermediate

Re: Query on variable scope

The way I handle things like this i to create a properties file in my deployment bar file.

You can then reference this as a "resources" associated with the specific deployment.

In Activiti Enterprise (and Activiti 6) it is a little more difficult as Proces App's don't allow for ad hoc files to be added to the App.

Another option is to add a classpath resource but this will have a different lifecycle to the process app and could be problematic if the contained data is unique per process (as is often the case).

Greg

bp3‌