<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How can I use my own classloaders instead of the default one within the ProcessEngine ? in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/how-can-i-use-my-own-classloaders-instead-of-the-default-one/m-p/39426#M16567</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to add support for Groovy Objects in my project.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a Groovy script of mine, I am facing a GroovyCastException.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Script1.groovy&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Foo f = new Foo() // &amp;lt;--- Foo is a Groovy class of mine&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;execution.setVariable('foo', f);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Up to here, it works fine, but later on, in another script I try to assign this value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Script2.groovy&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Foo f = foo // &amp;lt;-- Assigning the in-memory variable 'foo' to my new variable 'f'&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hence my question, is it possible to override Activiti classloader with my own classloader ? If yes, which guidelines should I follow ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Louis&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 20 Jun 2019 09:06:24 GMT</pubDate>
    <dc:creator>louisp</dc:creator>
    <dc:date>2019-06-20T09:06:24Z</dc:date>
    <item>
      <title>How can I use my own classloaders instead of the default one within the ProcessEngine ?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-can-i-use-my-own-classloaders-instead-of-the-default-one/m-p/39426#M16567</link>
      <description>I am trying to add support for Groovy Objects in my project.In a Groovy script of mine, I am facing a GroovyCastException.Script1.groovyFoo f = new Foo() // &amp;lt;--- Foo is a Groovy class of mineexecution.setVariable('foo', f);Up to here, it works fine, but later on, in another script I try to assign</description>
      <pubDate>Thu, 20 Jun 2019 09:06:24 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-can-i-use-my-own-classloaders-instead-of-the-default-one/m-p/39426#M16567</guid>
      <dc:creator>louisp</dc:creator>
      <dc:date>2019-06-20T09:06:24Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use my own classloaders instead of the default one within the ProcessEngine ?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-can-i-use-my-own-classloaders-instead-of-the-default-one/m-p/39427#M16568</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;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&amp;nbsp;SpringProcessEngineConfiguration.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jun 2019 09:09:23 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-can-i-use-my-own-classloaders-instead-of-the-default-one/m-p/39427#M16568</guid>
      <dc:creator>louisp</dc:creator>
      <dc:date>2019-06-20T09:09:23Z</dc:date>
    </item>
  </channel>
</rss>

