AnsweredAssumed Answered

Reference to FileFolderService in jbpm Workflow Java Action

Question asked by netboy1977 on Apr 15, 2012
Latest reply on Apr 15, 2012 by afaust
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 to NodeRef cookbook you receive an instance to FileFolderService this way:

ServiceRegistry serviceRegistry = (ServiceRegistry) beanFactory.getBean(ServiceRegistry.SERVICE_REGISTRY);
       FileFolderService fileFolderService = serviceRegistry.getFileFolderService();

However, I see no way to get the serviceRegistry since I am implementing org.jbpm.graph.def.ActionHandler which only provides org.jbpm.graph.exe.ExecutionContext.

This is my relvant action code in the process definiton:

    <event type="node-leave">
      <action class="org.example.FileFolderCreator"/>


1. Which interface to best implement to get a reference of ServiceRegistry?
2. Do I have to add/inject anything to my workflow action?
3. Is there another way to acquire this, i.e. use NodeService?

Thanks for your replies!