AnsweredAssumed Answered

dynamic bpm_groupAssignee

Question asked by bikash on Jan 31, 2014
Latest reply on Feb 3, 2014 by anshu.kumar
Hi,
I have this process definition:
<?xml version="1.0" encoding="UTF-8"?>

<process-definition xmlns="urn:jbpm.org:jpdl-3.1" name="gea:projReview">

    <swimlane name="initiator" />
   
    <swimlane name="reviewer">
      <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
         <pooledactors>#{bpm_groupAssignee}</pooledactors>
      </assignment>
   </swimlane>
   <swimlane name="approver">
      <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
         <pooledactors>#{bpm_groupAssignee}</pooledactors>
      </assignment>
   </swimlane>
    <start-state name="start">
        <task name="wf:submitGroupReviewTask" swimlane="initiator">
      <event type="node-enter">
                <script>
               bpm_groupAssignee = people.getGroup("GROUP_NITC_Reviewer");
                   if (bpm_workflowDueDate != void){taskInstance.dueDate = bpm_workflowDueDate;}
                   if (bpm_workflowPriority != void) {taskInstance.priority = bpm_workflowPriority;}
                  
                   logger.log("InProgress node-enter");
                </script>
            </event>
      </task>
        <transition name="" to="doc_review">
         <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
               <script>
                  bpm_package.children[0].properties["np:contentWFStatus"] = "InProgress";
                  bpm_package.children[0].save();
                  
                  logger.log("InProgress");
                  
               </script>
            </action>
      </transition>
    </start-state>

   
   
    <task-node name="doc_review">
        <task name="wf:submitGroupReviewTask" swimlane="reviewer">
            <event type="task-create">
                <script>
               bpm_groupAssignee = people.getGroup("GROUP_NITC_Approver");
                   if (bpm_workflowDueDate != void){taskInstance.dueDate = bpm_workflowDueDate;}
                   if (bpm_workflowPriority != void) {taskInstance.priority = bpm_workflowPriority;}
                  
                   logger.log("@@@@@@@@@@@@@@@@@@@reviewer");
                </script>
            </event>
          <event type="node-enter">
                <script>
               bpm_groupAssignee = people.getGroup("GROUP_NITC_Approver");
                   if (bpm_workflowDueDate != void){taskInstance.dueDate = bpm_workflowDueDate;}
                   if (bpm_workflowPriority != void) {taskInstance.priority = bpm_workflowPriority;}
                  
                   logger.log("#################InProgress node-enter")
                </script>
            </event>
        </task>
        <transition name="reject" to="rejected" />
        <transition name="approve" to="doc_approve">
           <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
            <script>
               bpm_package.children[0].properties["np:contentWFStatus"] = "Reviewed";
               bpm_package.children[0].save();
                 bpm_groupAssignee = people.getGroup("GROUP_NITC_Approver");
               
            </script>
         </action>
        </transition>
    </task-node>
   <task-node name="doc_approve">
        <task name="wf:reviewTask" swimlane="approver">
         <event type="task-create">
               <script>
                  bpm_groupAssignee = people.getGroup("GROUP_NITC_Approver");
               </script>
         </event>
        </task>
        <transition name="reject" to="rejected" />
        <transition name="approve" to="end">
           <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
            <script>
               bpm_package.children[0].properties["np:contentWFStatus"] = "Approved";
               bpm_package.children[0].save();
               
            </script>
         </action>
        </transition>
    </task-node>

    <task-node name="rejected">
        <task name="wf:rejectedTask" swimlane="initiator" />
        <transition name="resubmit" to="doc_review" />
    </task-node>

    <end-state name="end" />

</process-definition>



I am getting this exception:


org.alfresco.service.cmr.workflow.WorkflowException: 01010000 Failed to signal transition null from workflow task jbpm$107.
        at org.alfresco.repo.workflow.jbpm.JBPMEngine.endTask(JBPMEngine.java:1849)
        at org.alfresco.repo.workflow.WorkflowServiceImpl.endTask(WorkflowServiceImpl.java:648)
        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.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
        at org.alfresco.repo.security.permissions.impl.AlwaysProceedMethodInterceptor.invoke(AlwaysProceedMethodInterceptor.java:34)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:44)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.alfresco.repo.audit.AuditMethodInterceptor.proceedWithAudit(AuditMethodInterceptor.java:217)
        at org.alfresco.repo.audit.AuditMethodInterceptor.proceed(AuditMethodInterceptor.java:184)
        at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:137)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
        at $Proxy68.endTask(Unknown Source)
        at org.alfresco.web.bean.workflow.StartWorkflowWizard.finishImpl(StartWorkflowWizard.java:233)
        at org.alfresco.web.bean.dialog.BaseDialogBean$1.execute(BaseDialogBean.java:118)
        at org.alfresco.web.bean.dialog.BaseDialogBean$1.execute(BaseDialogBean.java:114)
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:381)
        at org.alfresco.web.bean.dialog.BaseDialogBean.finish(BaseDialogBean.java:124)
        at org.alfresco.web.bean.wizard.WizardManager.finish(WizardManager.java:593)
        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:104)
        at sun.reflect.GeneratedMethodAccessor396.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.alfresco.repo.management.subsystems.ChainingSubsystemProxyFactory$1.invoke(ChainingSubsystemProxyFactory.java:116)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
        at $Proxy195.doFilter(Unknown Source)
        at org.alfresco.repo.web.filter.beans.BeanProxyFilter.doFilter(BeanProxyFilter.java:82)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.alfresco.repo.web.filter.beans.NullFilter.doFilter(NullFilter.java:68)
        at sun.reflect.GeneratedMethodAccessor396.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.alfresco.repo.management.subsystems.ChainingSubsystemProxyFactory$1.invoke(ChainingSubsystemProxyFactory.java:116)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
        at $Proxy195.doFilter(Unknown Source)
        at org.alfresco.repo.web.filter.beans.BeanProxyFilter.doFilter(BeanProxyFilter.java:82)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:58)
        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:127)
        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:298)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
        at java.lang.Thread.run(Thread.java:619)
Caused by: org.jbpm.graph.def.DelegationException: Sourced file: inline evaluation of: ``                                    bpm_groupAssignee = people.getGroup("GROUP_NITC_Approver");                . . . '' : Attempt to resolve method: getGroup() on undefined variable or class name: people
        at org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:388)
        at org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:379)
        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.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
        at org.jbpm.graph.node.TaskNode$$EnhancerByCGLIB$$fdb8687c.raiseException(<generated>)
        at org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:379)
        at org.jbpm.graph.def.GraphElement.executeAction(GraphElement.java:301)
        at org.jbpm.graph.def.GraphElement.executeActions(GraphElement.java:241)
        at org.jbpm.graph.def.GraphElement.fireAndPropagateEvent(GraphElement.java:213)
        at org.jbpm.graph.def.GraphElement.fireEvent(GraphElement.java:196)
        at org.jbpm.taskmgmt.exe.TaskInstance.create(TaskInstance.java:170)
        at org.alfresco.repo.workflow.jbpm.WorkflowTaskInstance.create(WorkflowTaskInstance.java:106)
        at org.jbpm.taskmgmt.exe.TaskMgmtInstance.createTaskInstance(TaskMgmtInstance.java:218)
        at org.jbpm.graph.node.TaskNode.execute(TaskNode.java:174)
        at org.jbpm.graph.def.Node.enter(Node.java:390)
        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.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
        at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$705f623e.enter(<generated>)
        at org.jbpm.graph.def.Transition.take(Transition.java:167)
        at org.jbpm.graph.def.Node.leave(Node.java:479)
        at org.jbpm.graph.node.StartState.leave(StartState.java:82)
        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.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
        at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$705f623e.leave(<generated>)
        at org.jbpm.graph.exe.Token.signal(Token.java:223)
        at org.jbpm.graph.exe.Token.signal(Token.java:150)
        at org.jbpm.taskmgmt.exe.TaskInstance.end(TaskInstance.java:490)
        at org.alfresco.repo.workflow.jbpm.WorkflowTaskInstance.end(WorkflowTaskInstance.java:135)
        at org.jbpm.taskmgmt.exe.TaskInstance.end(TaskInstance.java:406)
        at org.alfresco.repo.workflow.jbpm.JBPMEngine$26.doInJbpm(JBPMEngine.java:1823)
        at org.springmodules.workflow.jbpm31.JbpmTemplate$1.doInHibernate(JbpmTemplate.java:87)
        at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:406)
        at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:339)
        at org.springmodules.workflow.jbpm31.JbpmTemplate.execute(JbpmTemplate.java:80)
        at org.alfresco.repo.workflow.jbpm.JBPMEngine.endTask(JBPMEngine.java:1798)
        … 76 more
Caused by: Sourced file: inline evaluation of: ``                                       bpm_groupAssignee = people.getGroup("GROUP_NITC_Approver");                . . . '' : Attempt to resolve method: getGroup() on undefined variable or class name: people : at Line: 2 : in file: inline evaluation of: ``                                    bpm_groupAssignee = people.getGroup("GROUP_NITC_Approver");                . . . '' : people .getGroup ( "GROUP_NITC_Approver" )

        at bsh.UtilEvalError.toEvalError(Unknown Source)
        at bsh.UtilEvalError.toEvalError(Unknown Source)
        at bsh.BSHMethodInvocation.eval(Unknown Source)
        at bsh.BSHPrimaryExpression.eval(Unknown Source)
        at bsh.BSHPrimaryExpression.eval(Unknown Source)
        at bsh.BSHAssignment.eval(Unknown Source)
        at bsh.Interpreter.eval(Unknown Source)
        at bsh.Interpreter.eval(Unknown Source)
        at bsh.Interpreter.eval(Unknown Source)
        at org.jbpm.graph.action.Script.eval(Script.java:130)
        at org.jbpm.graph.action.Script.eval(Script.java:73)
        at org.jbpm.graph.action.Script.execute(Script.java:62)
        at org.jbpm.graph.def.GraphElement.executeAction(GraphElement.java:284)
        … 110 more


Please help how to assign bpm_groupAssignee

Outcomes