-
1. Re: Converting a variable back
jochen_mader Mar 3, 2010 8:48 AM (in response to jochen_mader)I dug in a little deeper and found out that my variables generally don't get reverted.
calling:
engine.getExecutionService().getVariable(exec.getId(), "dataEntity")
Just gives me a long and doesn't trigger revert on the converter.
Is variable conversion a one way road?
Thx,
Jochen
-
2. Re: Converting a variable back
jochen_mader Mar 3, 2010 11:58 AM (in response to jochen_mader)Solved it.
looks like the documentation is lacking a little.
To actually use the converter one needs to edit
jbpm.execution.hbm.xml and add the converter to the converter typedef.
Pretty hard to figure out and probably woth adding it to the docs.
<!-- ### TYPEDEFS ####################################################### --> <typedef name="converter" class="org.jbpm.pvm.internal.hibernate.ConverterType"> <param name="org.jbpm.pvm.internal.type.converter.BooleanToStringConverter" >bool-str</param> <param name="org.jbpm.pvm.internal.type.converter.ByteToLongConverter" >byte-long</param> <param name="org.jbpm.pvm.internal.type.converter.CharacterToStringConverter" >char-str</param> <param name="org.jbpm.pvm.internal.type.converter.DateToLongConverter" >date-long</param> <param name="org.jbpm.pvm.internal.type.converter.DateToStringConverter" >date-str</param> <param name="org.jbpm.pvm.internal.type.converter.DoubleToStringConverter" >double-str</param> <param name="org.jbpm.pvm.internal.type.converter.FloatToDoubleConverter" >float-double</param> <param name="org.jbpm.pvm.internal.type.converter.FloatToStringConverter" >float-str</param> <param name="org.jbpm.pvm.internal.type.converter.IntegerToLongConverter" >int-long</param> <param name="org.jbpm.pvm.internal.type.converter.SerializableToBytesConverter">ser-bytes</param> <param name="org.jbpm.pvm.internal.type.converter.ShortToLongConverter" >short-long</param> <param name="com.hre.portaldb.crosscommon.base.internal.DataEntityToLongConverter">dataEntity-long</param> </typedef>
-
3. Re: Converting a variable back
kukeltje Mar 8, 2010 7:27 AM (in response to jochen_mader)Pretty hard to figure out and probably woth adding it to the docs.
:-) This part of jBPM is afaik not officially 'stable' and so not realy in the docs yet, but you might want to create a jira issue and e.g. 'document adding custom converters' so it will not be forgotten at a certain (yet unspecified) moment in time.
But great you got it working and thanks for reporting back. Might indeed be helpful to others.
-
4. Re: Converting a variable back
jochen_mader Mar 10, 2010 6:10 PM (in response to kukeltje)Sorry for the delay.
I opened a feature request https://jira.jboss.org/jira/browse/JBPM-2821.
Thx,
Jochen