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

    How to use a Seam component in swimlane assignment

    Olivier Thierry Apprentice

      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 ?