06-20-2019 05:06 AM
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
06-20-2019 05:09 AM
Also, I have one constraint which is that I have different kinds of classloaders that are resolved at runtime. So I can't just rely on that static SpringProcessEngineConfiguration.
Explore our Alfresco products with the links below. Use labels to filter content by product module.