cancel
Showing results for 
Search instead for 
Did you mean: 

How Activiti Engine stored String value in process variable?

limcheekin
Champ on-the-rise
Champ on-the-rise
Hi there,

My app stored a string value to process variable using runtimeService.setVariable(), for example:

runtimeService.setVariable(executionId, "domainClassName", "com.vobject.User")
and find out that the string value such as "com.vobject.User" stored as byte array in Activiti tables, not as String.

Can I confirm Activiti Engine stored String as byte array when it set to process variable?

Please advice.

Best regards,
Chee Kin
8 REPLIES 8

limcheekin
Champ on-the-rise
Champ on-the-rise
Hi there,

Anyone? (Especially from Activiti Core Developers)

Thanks in advance.

Best regards,
Chee Kin

walterjs
Champ in-the-making
Champ in-the-making
Does it actually store it as a java serialized string? If so, maybe the default variable types are not in the right order. Try debugging the code and putting a breakpoint in DefaultVariableTypes.findVariableType(Object)

limcheekin
Champ on-the-rise
Champ on-the-rise
Does it actually store it as a java serialized string? If so, maybe the default variable types are not in the right order. Try debugging the code and putting a breakpoint in DefaultVariableTypes.findVariableType(Object)

Thanks for response.

Yes, it stored as java serialized string. Is this the correct behavior of Activiti engine?

Best regards,
Chee Kin

walterjs
Champ in-the-making
Champ in-the-making
No it is not and it definitely does not behave that way for me.

frederikherema1
Star Contributor
Star Contributor
Saving a String shouldn't create a byte-array… This is only done for non-primitive (and wrappers) and non-String serializables + byteArrays. Are you sure you just used a String as variable value?

kanchan
Champ in-the-making
Champ in-the-making
Debugging error

Hi, I am getting following error while debugging with h2 database 1.3.175 when I attach the h2-1.3.175.jar file :

Class File Editor
The source attachment does not contain the source for the file Server.class

Also I am not able to see any database entry for ACT_RE_PROCDEF table.

Thanks in advance,
Kanchan

trademak
Star Contributor
Star Contributor
Can you add a bit of background about your issue? What are you trying to do?

kethur
Champ in-the-making
Champ in-the-making
Kanchan,

I had this problem some time ago and i figured out that in Groovy's case the usual string is treated as GString and is stored as an object. 

you can try this and see if it works
new String("TEST".toString());

Regards,
Raj