cancel
Showing results for 
Search instead for 
Did you mean: 

basic fork problem

msacchetti
Champ in-the-making
Champ in-the-making
Hi all

I'm wokring on alfresco advanced workflow with jbpm but i'm strucked on a issue with forks.

I'm trying to implement a basic fork, with 2 task node assigend to 2 different groups, here is my code:



<swimlane name="AreaManager">
      <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
         <pooledactors>#{people.getGroup('AREA_MANAGER')}</pooledactors>
      </assignment>
   </swimlane>

   <swimlane name="ProductManager">
      <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
         <pooledactors>#{people.getGroup('PRODUCT_MANAGER')}</pooledactors>
      </assignment>
   </swimlane>

<task-node name="SelectItemToOrderGlobal">
      <task name="wf:workflowTask" swimlane="ProductManager" />
      <transition to="join1" name="ItemsSelectedGlobal"></transition>
      <description>
         Once catalog has been checked, need to decide if a new order must be submitted
      </description>
      <event type="node-enter">
         <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
            <script>
               logger.log("Node Enter:SelectItemToOrder(Global)");
                </script>
         </action>
      </event>
   </task-node>

   <task-node name="SelectItemToOrderArea">
      <task name="wf:workflowTask" swimlane="AreaManager" />
      <transition to="join1" name="ItemsSelectedArea"></transition>
      <description>
         Once catalog has been checked, need to decide if a new order must be submitted
      </description>
      <event type="node-enter">
         <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
            <script>
               logger.log("Node Enter:SelectItemToOrder(Area)");
                </script>
         </action>
      </event>
   </task-node>

   <fork name="fork1">
      <event type="node-enter">
         <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
            <script>
               logger.log("Node Enter:Fork");
                </script>
         </action>
      </event>
      <transition name="GlobalSelection" to="SelectItemToOrderGlobal"></transition>
      <transition name="AreaSelection" to="SelectItemToOrderArea"></transition>
   </fork>

   <join name="join1">
      <event type="node-enter">
         <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
            <script>
               logger.log("Node Enter:join1");
                </script>
         </action>
      </event>
      <transition to="Beforeend"></transition>
   </join>

both swimlane gropus exists and have 1 user each.

what i get reaching the fork (previous nodes works fine) is:

11:41:17,075 User:admin DEBUG [repo.jscript.RhinoScriptProcessor] Time to execute script: 172ms
11:41:17,086 User:admin DEBUG [repo.jscript.RhinoScriptProcessor] Imports resolved, adding resource '_root
11:41:17,088 User:admin DEBUG [repo.jscript.ScriptLogger] Node Enter:Fork
11:41:17,089 User:admin DEBUG [repo.jscript.RhinoScriptProcessor] Time to execute script: 3ms
11:41:17,103 User:admin DEBUG [repo.jscript.RhinoScriptProcessor] Imports resolved, adding resource '_root
11:41:17,108 User:admin DEBUG [repo.jscript.ScriptLogger] Node Enter:SelectItemToOrder(Area)
11:41:17,108 User:admin DEBUG [repo.jscript.RhinoScriptProcessor] Time to execute script: 5ms
11:41:17,128 User:admin DEBUG [repo.jscript.RhinoScriptProcessor] Imports resolved, adding resource '_root
11:41:17,133 User:admin DEBUG [repo.jscript.RhinoScriptProcessor] Time to execute script: 4ms
11:41:17,135 User:admin DEBUG [repo.jscript.ScriptLogger] ERROR:JavaException: org.alfresco.service.cmr.workflow.WorkflowException: Failed to signal transition 'null' from workflow task 'jbpm$72'
11:41:17,135 User:admin DEBUG [repo.jscript.RhinoScriptProcessor] Time to execute script: 533ms
11:41:17,271 User:admin ERROR [ui.common.Utils] A system error happened during the operation: Transaction silently rolled back because it has been marked as rollback-only
org.springframework.transaction.UnexpectedRollbackException: Transaction silently rolled back because it has been marked as rollback-only
   at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:667)
   at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:632)
   at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:314)
   at org.alfresco.util.transaction.SpringAwareUserTransaction.commit(SpringAwareUserTransaction.java:445)
   at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:334)
   at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:227)
   at org.alfresco.web.bean.dialog.BaseDialogBean.finish(BaseDialogBean.java:127)
   at org.alfresco.web.bean.dialog.DialogManager.finish(DialogManager.java:534)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:132)
   at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:61)
   at javax.faces.component.UICommand.broadcast(UICommand.java:109)
   at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:97)
   at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:171)
   at org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplicationExecutor.java:32)
   at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:95)
   at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70)
   at javax.faces.webapp.FacesServlet.service(FacesServlet.java:139)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.alfresco.web.app.servlet.AuthenticationFilter.doFilter(AuthenticationFilter.java:81)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
   at java.lang.Thread.run(Thread.java:619)

as you can see the flow reach the fork ( Node Enter:Fork ) and enter one of the 2 sides (  Node EnterSmiley FrustratedelectItemToOrder(Area) ) but crashes on the other one.

looking into the workflow console and asking for paths I got this strange result:
path id: jbpm$41-@ , node: fork1
path id: jbpm$41-@AreaSelection , node: SelectItemToOrderArea
path id: jbpm$41-@GlobalSelection , node: fork1

It seems that the second branch got correct id (GlobalSelection) but is somehow "mapped over the fork node (name should be SelectItemToOrderGlobal but is fork1 )

I've found some other post suggesting to assign name to every transiction (already done) and so on, but nothing worked to me.

please help me getting out from this…  :x

thanks in advance!
Michele
1 REPLY 1

msacchetti
Champ in-the-making
Champ in-the-making
ok, I got it…

the error was not related to fork but to assignement.

replacing every
#{people.getGroup('AREA_MANAGER')}
with
#{people.getGroup('GROUP_AREA_MANAGER')}
fix everything.

just to notes for the future.
1) all trasaction must have names (unnamed seems to cause trouble)
2) task go into "my pooled task" and not in "my task" so if you have standard interface layout you have to add it to see your task  :?

now my only question is…. my group name is AREA_MANAGER, why I have to add "GROUP_" prefix into a method called "getGroup" ?!?!?!
the method itself could add it!!!  :evil: 

documentation says:
ScriptNode getGroup(string groupname) 
, no mention about "GROUP_" prefix…  :evil:  :evil:  :evil:

however.. solved  Smiley Happy