I am trying to add support for Groovy Objects in my project.
In a Groovy script of mine, I am facing a GroovyCastException.
Script1.groovy
Foo f = new Foo() // <--- Foo is a Groovy class of mine
execution.setVariable('foo', f);
Up to here, it works fine, but later on, in another script I try to assign this value.
Script2.groovy
Foo f = foo // <-- Assigning the in-memory variable 'foo' to my new variable 'f'
The GroovyCastException happens here. This is because in Script1, I call VariableScope#setVariable() which loads the class with Activiti classloader, but in Script2 it is a custom classloader of mine that loads the class.
Hence my question, is it possible to override Activiti classloader with my own classloader ? If yes, which guidelines should I follow ?
Thanks
Louis