2 Replies Latest reply on Dec 4, 2007 9:14 AM by chawax

    How to use a Seam component in swimlane assignment

    chawax

      Hi,

      My application uses a JBPM business process and I need to assign tasks on runtime. To do this I made a Seam component and I call it in the swimlane assignment expression.

      To be more precise, the task is defined as following :

      <task-node name="validation">
       <task swimlane="valideurs"></task>
       <transition to="acceptation" name="ok"></transition>
       <transition to="refus" name="nok"></transition>
      </task-node>


      And the swimlane is defined as following :

      <swimlane name="valideurs">
       <assignment expression="#{assignmentHandler.assignByRole('USAGE')}"></assignment>
      </swimlane>


      The assignByRole method of my assignmentHandler component returns String[] (not sure it is correct, but I could not find any example).

      But when I create a process instance, I have the following error :

      11:55:04,241 ERROR [STDERR] Caused by: org.jbpm.identity.assignment.ExpressionAssignmentException: couldn't resolve assignment expression '#{assignmentHandler.assignByRole('USAGE')}'
      11:55:04,241 ERROR [STDERR] at org.jbpm.identity.assignment.ExpressionAssignmentHandler.assign(ExpressionAssignmentHandler.java:97)
      11:55:04,241 ERROR [STDERR] at org.jboss.seam.bpm.SeamUserCodeInterceptor$2.process(SeamUserCodeInterceptor.java:102)
      11:55:04,241 ERROR [STDERR] at org.jboss.seam.bpm.SeamUserCodeInterceptor$ContextualCall.run(SeamUserCodeInterceptor.java:33)
      11:55:04,241 ERROR [STDERR] at org.jboss.seam.bpm.SeamUserCodeInterceptor.executeAssignment(SeamUserCodeInterceptor.java:96)
      11:55:04,241 ERROR [STDERR] at org.jbpm.taskmgmt.exe.TaskMgmtInstance.performAssignmentDelegation(TaskMgmtInstance.java:226)
      11:55:04,241 ERROR [STDERR] at org.jbpm.taskmgmt.exe.TaskMgmtInstance.performAssignment(TaskMgmtInstance.java:201)
      11:55:04,241 ERROR [STDERR] ... 171 more
      11:55:04,241 ERROR [STDERR] Caused by: org.jbpm.identity.assignment.ExpressionAssignmentException: couldn't interpret first term in expression '#{assignmentHandler.assignByRole('USAGE')}'
      11:55:04,241 ERROR [STDERR] at org.jbpm.identity.assignment.ExpressionAssignmentHandler.resolveFirstTerm(ExpressionAssignmentHandler.java:155)
      11:55:04,241 ERROR [STDERR] at org.jbpm.identity.assignment.ExpressionAssignmentHandler.assign(ExpressionAssignmentHandler.java:75)
      11:55:04,241 ERROR [STDERR] ... 176 more


      So it looks like you can not use EL expressions in swimlane assignment ... Anyone has an idea how I should do this ?

        • 1. Re: How to use a Seam component in swimlane assignment
          chawax

          Well, I tried something too complicated ... I have no need to use a swimlane, but just pooled actors on my task.

          So I defined my task node this way :

          <task-node name="validation">
           <task>
           <assignment pooled-actors="#{assignmentHandler.assignByRole('USAGE')}"></assignment>
           </task>
           <transition to="acceptation" name="ok"></transition>
           <transition to="refus" name="nok"></transition>
          </task-node>


          And it works well, datas in JBPM tables look OK.

          Nevertheless when I use the taskInstanceList built-in component in my facelet, it returns an empty list. Any idea why ?

          • 2. Re: How to use a Seam component in swimlane assignment
            chawax

            I found it ... I have to use pooledTaskInstanceList built-in component. I also have to be sure that the groupActorIds of the actor component has been set on authentication.