<?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 Reference to FileFolderService in jbpm Workflow Java Action in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/reference-to-filefolderservice-in-jbpm-workflow-java-action/m-p/257861#M210991</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to create folders from Java action in an jbpm Workflow (Alfresco 3.4d). I am a bit confused how to do this in Java since the JS Code is quite simple and it seems to be far more difficult in Java.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;How best to insert a reference to FileFolderService in a workflow Java action?&lt;BR /&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;According to NodeRef cookbook you receive an instance to FileFolderService this way:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;ServiceRegistry serviceRegistry = (ServiceRegistry) beanFactory.getBean(ServiceRegistry.SERVICE_REGISTRY);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FileFolderService fileFolderService = serviceRegistry.getFileFolderService();&lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;However, I see no way to get the serviceRegistry since I am implementing &lt;/SPAN&gt;&lt;EM&gt;org.jbpm.graph.def.ActionHandler&lt;/EM&gt;&lt;SPAN&gt; which only provides &lt;/SPAN&gt;&lt;EM&gt;org.jbpm.graph.exe.ExecutionContext&lt;/EM&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is my relvant action code in the process definiton:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;event type="node-leave"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;action class="org.example.FileFolderCreator"/&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/event&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;STRONG&gt;Questions:&lt;BR /&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1. Which interface to best implement to get a reference of &lt;/SPAN&gt;&lt;EM&gt;ServiceRegistry&lt;/EM&gt;&lt;SPAN&gt;?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. Do I have to add/inject anything to my workflow action?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3. Is there another way to acquire this, i.e. use NodeService?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your replies!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dominik&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 15 Apr 2012 10:59:44 GMT</pubDate>
    <dc:creator>netboy1977</dc:creator>
    <dc:date>2012-04-15T10:59:44Z</dc:date>
    <item>
      <title>Reference to FileFolderService in jbpm Workflow Java Action</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/reference-to-filefolderservice-in-jbpm-workflow-java-action/m-p/257861#M210991</link>
      <description>Hello all,I want to create folders from Java action in an jbpm Workflow (Alfresco 3.4d). I am a bit confused how to do this in Java since the JS Code is quite simple and it seems to be far more difficult in Java.How best to insert a reference to FileFolderService in a workflow Java action?According</description>
      <pubDate>Sun, 15 Apr 2012 10:59:44 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/reference-to-filefolderservice-in-jbpm-workflow-java-action/m-p/257861#M210991</guid>
      <dc:creator>netboy1977</dc:creator>
      <dc:date>2012-04-15T10:59:44Z</dc:date>
    </item>
    <item>
      <title>Re: Reference to FileFolderService in jbpm Workflow Java Action</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/reference-to-filefolderservice-in-jbpm-workflow-java-action/m-p/257862#M210992</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;for Java actions in jBPM workflows you should be extending the Alfresco-specific JBPMSpringActionHandler class which provides you with a initialiseHandler method that has a BeanFactory as a parameter. Then the example from the Cookbook will work just as in your example - the service reference obtained needs to be put into a member variable in order for the execute method to have access to it, but that is about all the extra wiring you need.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Axel&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 15 Apr 2012 20:14:33 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/reference-to-filefolderservice-in-jbpm-workflow-java-action/m-p/257862#M210992</guid>
      <dc:creator>afaust</dc:creator>
      <dc:date>2012-04-15T20:14:33Z</dc:date>
    </item>
  </channel>
</rss>

