It seems to me, that in jBPM2.0 there was a chance to specify a variable type with the
format="..."syntax in the forms.xml. Or it seems in JPDL v2.0 there was a
<type> <variable .../> </type>entry, with which I guess the variable Object type could be set at the process definition level.
Do we have any workaround in jBPM 3.0? How to set variable object type at process definition level?
these are two different questions.
If you want to change the process definition, use a low level api. If you just want to add a variable to the running process instance, just use the normal update function you would use in e.g. an actionhandler. If you choose a name that is not used yet, the variable is created. You can try this e.g. in the monitor part of the webapp
Thanks for the input. My problem is the same with the use of ActionHandler. In the processdefinition.xml you have no chance to specify preferred java object type for a variable (- nor to set description, that comes from TaskFormParameter) - that would be created when contextInstance returns with a null object, because of not founding a VariableInstance for the new varible. What's more, I have seen no test pages or testcases for defining a non-string variable.
I've found entries in JIRA, that will handle types in a future release.
did you check out the jbpm.varmapping.properties configuration file ? that allows you to configure the way that jbpm stores objects in the database on a jbpm level.
or do you have a good motivation to configure how jbpm variables are persisted on a process level ?
I looked at the JIRA, and voted for some issues regarding this feature. But finally I added a "className" and "description" attribute to the JpdlXmlReader, VariableAccess and TaskFormParameter, so this way I can add className-specific SpringMVC binders to the web page form, and evalute className-type objects. At submit, TaskFormParameter.value objects are stored properly by jBPM with variableInstances If you're interested in the modifications I made, I can send you diffs.