the way that process variables are stored changed between 2 and 3.
in jbpm 3, the way that a variable is stored completely depends on the java-type of the variable value. for more info, see the user guide.
if you have a good usecase where you want to store the same java-type differently for different variables, let us know about it. cause that is the only situation that we dropped between 2 and 3.
I'm enhancìng the GUI (and will send the fax for cvs access, shame on me;-) ) You can only show the right ui control if the variable has been created. If you cannot declare it one way or another, You have to write some code to create the variables in an actionhandler (e.g. on the process-start event) so you in fact still need to declare it if you want the ui to automagically show the right controls. I to would like it to be declared in the process even if it is just usable as a hint for the ui and not automagically creates them.
if what you want is building a GUI depending on a Tasknode, why you don't use your own TaskController with its own mapping between variables and GUI-View:
<controller class='TestTaskController' config-type='constructor' >
<variable name='a' access='read' mapped-name='x' type='String' renderas='viewtype1' />
<variable name='b' access='read,write,required' mapped-name='y' type='Interger' renderas='viewtype2' />
maybe it is also possible to put the variable with the right objecttype in the context
For putting declaring variables in processdefinition look at: Delegation.java method:instantiate
you will find the different instantiatorClasses under org.jbpm.instantiation
my be there is an error in this doc for config-type configuration-property the methodname in the instantiatorClass used by reflection is "setConfiguration(String)" and not like in jbpm 2 void configure(String);
I ran across this problem with 3.1 recently. It seems to me you have to do the following to make this work:
- Custom Task Controller (implementing TaskControllerHandler.java)
- Modify VariableAcess, possibly VariableAccess.hbm.xml
- Modify JpdlXMLReader
I ended up just adding my types to the access attribute using
Access->toString() for retrieval:
Not ideal, but better in my mind than modifying JBPM.