I am implementing a "Global Variable" which could be outside the process context and it is not like the process level "global variable" as mentioned in Activiti.
1. I created a resolver api (based on this post http://forums.activiti.org/en/viewtopic.php?f=3&t=268&view=previous), just to resolve the global variables passed through contexts other than "process context", ex. from a UI context. But from bpmn file perspective, I don't see any difference for the resolver to resolve when parsing the global variables vs the local variables? since they are already inside the bpmn file, so they are under the process context, correct? If not, please explain. 2. if they have difference, how can i identify with the resolver (or please suggestions), this variable is global, not local? I am using some naming convention with a prefix "global_"? 3. after i identify that it is a global variable, i was suggested by a coworker, i need to create an interceptor in package org.activiti.engine.impl.persistence.entity.VariableScopeImpl, to check if the variable is global variable, call GlobalVariableResolver in getVariable(), otherwise, no interruption to the method - default to local variable resolver?
No need to fiddle around with the Variable-scope. Instead, create a custom ExpressionManager (extending the default one) which adds a new ELResolver to the chain. The ELResolver should "kick in" when the "key" of the property starts with "global_".
I have a custom resolver, which is backed up by a map. The information of this map comes from some persistent source, ex. a database/registry, does it mean, it is the resolver's responsibility to fetch the data from the database, or the custom expression manager? what is the common way to do it?
2nd question: how to test the following case: "passing a JPA object as an input parameter to a java service task"?
1) Why don't you look at the Activiti sources and see how it's done there? E.g. look at the classes VariableScopeResolver and VariableScopeResolverFactory. You should see that it's the Resolver's responsibility if I'm not mistaken…