3 Replies Latest reply on Feb 15, 2010 9:57 PM by troy.sellers

    EL expressions not being evaluated in JPDL

    troy.sellers

      Hi All,


      I am trying to build the example in Dan Allens 14th chapter, however I am running into a bit of a problem..


      The taskInstanceListForType and pooledTaskInstanceList are always empty.


      Inspection of the JBPM tables reveal that tasks are being created, however the EL that I have in the jpdl is not being resovled.


      For example, the task  


      <task-node name="actor-inbox">
         <task name="receive" description="#{message.content}">
            <assignment actor-id="#{message.actor.username}"/>
         </task>
         <transition name="acknowledge" to="acknowledged"/>
      </task-node>



      Is being created in the JBPM tables, yet the description is being stored as #{message.content} rather than the value that this should be resolved to.


      I am assuming that my actor variable is also not being resolved, so the taskInstanceList would not be finding anything for the current actor.


      I have injected (and outjected) the Message in the Handler that starts the process, not sure if that is doing silly things with this or not...


      Can anyone suggest a way to help me figure out how to get the EL resolved?


      Troy

        • 1. Re: EL expressions not being evaluated in JPDL
          troy.sellers

          hmm.. i have just figured out why my EL was not being resolved.. I didn't have the create process as part of a long running conversation ...


          this has just proved that my first assumption was wrong as well... it wasn't the fact that actorIds were not being resolved that the taskInstanceList is returning nothing..


          • 2. Re: EL expressions not being evaluated in JPDL
            troy.sellers

            Just some further information..


            None of the task lists are populated for me.


            These output lines are all visible for me when I run my application and create processes.


            <h:outputText value="There is nothing in the taskInstanceList." rendered="#{empty taskInstanceList}"/><br />
            <h:outputText value="There is nothing in the taskInstancePriorityList." rendered="#{empty taskInstancePriorityList}"/><br />
            <h:outputText value="There is nothing in the taskInstanceListForType." rendered="#{empty taskInstanceListForType['receive-actor']}"/><br />
            <h:outputText value="There is nothing in the pooledTaskIstanceList." rendered="#{empty pooledTaskInstanceList}"/><br />
            <h:outputText value="There is nothing in the manually built task list." rendered="#{empty tasksForActor}"/><br />



            The last one of these is one that I am trying to create manually from the JbpmContext, with a similar amount of success.




            package au.com.tracker.action;
            
            import java.util.List;
            
            import org.jboss.seam.annotations.Factory;
            import org.jboss.seam.annotations.In;
            import org.jboss.seam.annotations.Logger;
            import org.jboss.seam.annotations.Name;
            import org.jboss.seam.bpm.TaskInstance;
            import org.jboss.seam.log.Log;
            import org.jbpm.JbpmContext;
            
            @Name("taskListBuilder")
            public class TaskListBuilder {
            
                 @In private JbpmContext jbpmContext;
                 @Logger private Log logger;
                 
                 @Factory("tasksForActor")
                 public List<TaskInstance> getTasksForActor() {
                      logger.info("Trying to manually build task list {0}", jbpmContext.getTaskList().size()); // returns empty list!
                      logger.info("Trying to manually build task list with actor id{0}",jbpmContext.getTaskList(jbpmContext.getActorId()).size()); // returns empty list!!
                      return (List<TaskInstance>)jbpmContext.getTaskList(jbpmContext.getActorId());
                 }
            }



            I am now at a bit of a loss as to why the I required explicit conversation to be set (the todo list in the example package doesn't seem to need it) and how Seam communicates with JBPM.
            When I execute the following query on the JBPM tables, it returns the expected results (i.e. non empty)




            select *from JBPM_TASKINSTANCE where ACTORID_ = 'power' 
                and issuspended_ <> 1 
                and isopen_ =1





            Open for any suggestions..


            Troy

            • 3. Re: EL expressions not being evaluated in JPDL
              troy.sellers

              DOH!!


              I wasn't setting the actor.id value on authentication... this caused null lists to be returned every time..