<?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 Re: Accessing my own Groovy API from ScriptTask in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/accessing-my-own-groovy-api-from-scripttask/m-p/133565#M93810</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Look at the ExpressionManager if you want to use your own API from within&amp;nbsp; expressions used in activiti. For example, when using spring, you can use Spring-beans in your expressions to call method on.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For scripts, there is a similar approach to get "objects" in the scope of all script-tasks, with our using a process-variable: ScriptBindingsFactory. The ScriptBindingsFactory is responsible for creating ScriptBindings that are exposed in any script (js, groovy, ..). In the procesEngineConfiguration, you can add a custom factory OR add custom resolvers that are called by the dealt bindings:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;nbsp; protected void initScriptingEngines() {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (resolverFactories==null) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; resolverFactories = new ArrayList&amp;lt;ResolverFactory&amp;gt;();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; resolverFactories.add(new VariableScopeResolverFactory());&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; resolverFactories.add(new BeansResolverFactory());&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (scriptingEngines==null) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; scriptingEngines = new ScriptingEngines(new ScriptBindingsFactory(resolverFactories));&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;Using a custom org.activiti.engine.impl.scripting.ResolverFactory, you can make certain keywords resolve to your object. You can, for example create a resolver that always returns a reference to you product services, using "services". In scripts, you can use "service.createPage(execution.getVariable("pageName");".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this helps you…&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 24 Apr 2013 07:43:06 GMT</pubDate>
    <dc:creator>frederikherema1</dc:creator>
    <dc:date>2013-04-24T07:43:06Z</dc:date>
    <item>
      <title>Accessing my own Groovy API from ScriptTask</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/accessing-my-own-groovy-api-from-scripttask/m-p/133564#M93809</link>
      <description>Hello. I am creating an integration between a product and Activiti. Everything works fine so now, I am using my own IdentityService implementation, etc.My product supports natively Groovy, as Activiti does. My product also exposes and API which can be used from Groovy.My goal is to make my product G</description>
      <pubDate>Tue, 23 Apr 2013 07:28:19 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/accessing-my-own-groovy-api-from-scripttask/m-p/133564#M93809</guid>
      <dc:creator>sorinello</dc:creator>
      <dc:date>2013-04-23T07:28:19Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing my own Groovy API from ScriptTask</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/accessing-my-own-groovy-api-from-scripttask/m-p/133565#M93810</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Look at the ExpressionManager if you want to use your own API from within&amp;nbsp; expressions used in activiti. For example, when using spring, you can use Spring-beans in your expressions to call method on.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For scripts, there is a similar approach to get "objects" in the scope of all script-tasks, with our using a process-variable: ScriptBindingsFactory. The ScriptBindingsFactory is responsible for creating ScriptBindings that are exposed in any script (js, groovy, ..). In the procesEngineConfiguration, you can add a custom factory OR add custom resolvers that are called by the dealt bindings:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;nbsp; protected void initScriptingEngines() {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (resolverFactories==null) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; resolverFactories = new ArrayList&amp;lt;ResolverFactory&amp;gt;();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; resolverFactories.add(new VariableScopeResolverFactory());&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; resolverFactories.add(new BeansResolverFactory());&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (scriptingEngines==null) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; scriptingEngines = new ScriptingEngines(new ScriptBindingsFactory(resolverFactories));&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;Using a custom org.activiti.engine.impl.scripting.ResolverFactory, you can make certain keywords resolve to your object. You can, for example create a resolver that always returns a reference to you product services, using "services". In scripts, you can use "service.createPage(execution.getVariable("pageName");".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this helps you…&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Apr 2013 07:43:06 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/accessing-my-own-groovy-api-from-scripttask/m-p/133565#M93810</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2013-04-24T07:43:06Z</dc:date>
    </item>
  </channel>
</rss>

