1 Reply Latest reply on Apr 10, 2006 7:36 AM by koen.aers

    Error with the jbpm context

      hi,

      this is the problem:
      Home.jsp------>viewtask.jsp

      int the action Taskaction i open a jbpmcurrentcontext and i attribute to him an actorid.

      in the page : viewtask.jsp , when I want to get the actorid the response was null .

      My code :
      1. a part of web.xml

      <filter>
       <filter-name>JbpmContextFilter</filter-name>
       <filter-class>org.jbpm.web.JbpmContextFilter</filter-class>
       </filter>
       <filter-mapping>
       <filter-name>JbpmContextFilter</filter-name>
       <url-pattern>/*</url-pattern>
       </filter-mapping>
      


      2. the taskaction.java:
      ....
      Taskform taskform = (Taskform) form;
      String username = taskform.getUsername();
      JbpmContext jbpmcontext=JbpmContext.getCurrentJbpmContext();
      jbpmcontext.setActorId(username);
      ....
      
      


      3. a part of viewtask.jsp
      <TABLE border="1" width="200px">
       <%
       Tasklist tl=new Tasklist();
       String actor=tl.acteur();
       Iterator it = tl.tache(actor).iterator();
       while(it.hasNext()) {
       %>
      
       <TR>
       <TD><%=it.next()%></TD>
       </TR>
      <% } %>
      
       </TABLE>
      


      4. Tasklist.java:

      public class Tasklist{
      
      public String acteur()
      
      {
      JbpmContext jbpmcontext=JbpmContext.getCurrentJbpmContext();
      return (jbpmcontext.getActorId()) ;
      }
      
      public List tache(String s){
      JbpmContext jbpmcontext=JbpmContext.getCurrentJbpmContext();
      TaskMgmtSession taskmgmtsession =jbpmcontext.getTaskMgmtSession();
      List l = taskmgmtsession.findTaskInstances(s) ;
       return l;
      }
      }
      


      Why Jbpmcontext retu rn an "null" actorid ??

      Thanks for your help.