-
1. Re: adding a variable at runtime
tsandor Sep 15, 2005 4:40 AM (in response to tsandor)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?
--
Thomas -
2. Re: adding a variable at runtime
kukeltje Sep 15, 2005 8:50 PM (in response to tsandor)these are two different questions.
Answer 1:
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
Answer 2: -
3. Re: adding a variable at runtime
tsandor Sep 16, 2005 3:21 AM (in response to tsandor)Ronald,
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.
--
Thomas -
4. Re: adding a variable at runtime
tom.baeyens Sep 20, 2005 4:51 AM (in response to tsandor)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 ?
regards, tom. -
5. Re: adding a variable at runtime
tsandor Sep 20, 2005 6:58 AM (in response to tsandor)Tom,
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.
--
Thomas