11 Replies Latest reply on Jul 24, 2007 10:34 AM by Anonymous User Anonymous User

    can't get task list of an actor

    clause Mbacky Newbie

      Hi everybody.

      i am using jbpm-jpdl 3.1 and i have done my process successfully.
      deployment was a success.
      But when i tried to get task list like that:

      List task_list=jbpmContext.getTaskList(jbpmContext.getActorId());
      System.out.println("number of task:"+task_list.size());
      


      result:
      number of task:0


      i don't understand this.
      should you explain me please.

        • 1. Re: can't get task list of an actor
          subrahmanyam adapa Newbie

          Hi,


          TaskMgmtSession.findTaskInstancesByActorId("username");

          can be used.

          OR u can get all the task list by using processinstance also


          • 2. Re: can't get task list of an actor
            clause Mbacky Newbie

            thank for your response.

            i tried by using processinstance and taskinstance like this:

            ProcessInstance processInstance=new ProcessInstance(processDefinition);
             System.out.println("processinstance.id: "+processInstance.getId());
             System.out.println("processinstance.version: "+processInstance.getVersion());
            
             TaskInstance taskInstance=processInstance.getTaskMgmtInstance().createStartTaskInstance();
             taskInstance.setActorId(jbpmContext.getActorId());
            


            but i have this error:

            javax.servlet.ServletException: improper format of duration ''
            org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:535)
            org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:433)
            org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
            org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
            org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
            javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
            javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
            org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1085)
            org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:398)
            org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:241)
            org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
            org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
            javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
            javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
            org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

            root cause

            java.lang.IllegalArgumentException: improper format of duration ''
            org.jbpm.calendar.Duration.<init>(Duration.java:151)
            org.jbpm.taskmgmt.exe.TaskInstance.setTask(TaskInstance.java:117)
            org.jbpm.taskmgmt.exe.TaskMgmtInstance.createTaskInstance(TaskMgmtInstance.java:113)
            org.jbpm.taskmgmt.exe.TaskMgmtInstance.createStartTaskInstance(TaskMgmtInstance.java:283)
            com.WebApplicationWithJbpm.actions.FirstTask.performAction(FirstTask.java:44)
            com.WebApplicationWithJbpm.actions.BaseAction.execute(BaseAction.java:17)
            org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
            org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
            org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
            org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
            javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
            javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
            org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1085)
            org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:398)
            org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:241)
            org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
            org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
            javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
            javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
            org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)



            what that means ?

            • 3. Re: can't get task list of an actor
              Andreas Schienagel Newbie

              Would you post your process definition?

              javax.servlet.ServletException: improper format of duration ''


              Seems that you have set some scheduler improperly...e.g. a duedate on your task with value "" like
              <task name="task1" duedate="">
              .


              • 4. Re: can't get task list of an actor
                clause Mbacky Newbie

                this is my processdefinition:

                <?xml version="1.0" encoding="UTF-8"?>
                
                <process-definition xmlns="urn:jbpm.org:jpdl-3.1" name="holiday-request">
                
                
                 <swimlane name="participant">
                 <assignment expression="user(ernie)"></assignment>
                 </swimlane>
                
                 <swimlane name="rh">
                 <assignment expression="user(martin)"></assignment>
                 </swimlane>
                
                
                 <start-state name="enter request">
                 <task name="request entry" duedate="">
                 <assignment class="ErnieAssignment"></assignment>
                 <controller>
                 <variable access="read,write" name="start date"></variable>
                 <variable access="read,write" name="duree"></variable>
                 </controller>
                 </task>
                 <transition to="evaluate request"></transition>
                 </start-state>
                
                
                 <task-node name="evaluate request">
                 <task name="request evaluation" duedate="" swimlane="rh">
                 <controller>
                 <variable access="read" name="start date"></variable>
                 <variable access="read" name="duree"></variable>
                 <variable access="read" name="info"></variable>
                 <variable access="read,write" name="decision"></variable>
                 </controller>
                 </task>
                 <transition to="give additionnal info" name="more info needed"></transition>
                 <transition to="end" name="approve/disapprove"></transition>
                 </task-node>
                
                 <task-node name="give additionnal info">
                 <task name="additional info entry" swimlane="participant">
                 <controller>
                 <variable access="read" name="start date"></variable>
                 <variable access="read" name="duree"></variable>
                 <variable access="read,write" name="info"></variable>
                 </controller>
                 </task>
                 <transition to="evaluate request"></transition>
                 </task-node>
                
                
                 <end-state name="end"></end-state>
                
                
                </process-definition>
                


                duedate is it an optional entry ?

                • 5. Re: can't get task list of an actor
                  Andreas Schienagel Newbie

                  yes, duedate is optional. But afaik if you set it to "" a exception due to incorrect format is thrown. I already had the same problem.

                  Did you try it without?

                  Seems like a bug to me...Does anyone know if this is an already known problem? JIRA created? JIRA necessary?

                  Or is this correct behaviour?


                  • 8. Re: can't get task list of an actor
                    clause Mbacky Newbie

                    i have just cleared this option.
                    i didn't use it .

                    • 9. Re: can't get task list of an actor
                      clause Mbacky Newbie

                      hi, i have another problem.

                      into the last task, when i added

                      taskInstance.end();

                      in this code:

                      GraphSession graphSession=jbpmContext.getGraphSession();
                       TaskMgmtSession taskMgmtSession=jbpmContext.getTaskMgmtSession();
                      
                       jbpmContext.setActorId("martin");
                      
                       ProcessInstance processInstance=graphSession.getProcessInstance(34);
                      
                       TaskInstance taskInstance=(TaskInstance) taskMgmtSession.findTaskInstances(jbpmContext.getActorId()).iterator().next();
                       System.out.println("taskinstance_actor: "+taskInstance.getActorId());
                       System.out.println("taskinstance: "+taskInstance.getName());
                       taskInstance.setVariable("decision","yes");
                       System.out.println("taskinstance_priority: "+taskInstance.getPriority());
                       System.out.println("taskinstance_Id: "+taskInstance.getId());
                       taskInstance.end();
                      
                       jbpmContext.save(processInstance);
                       processInstance.signal();
                      


                      i have this error:

                      2007-07-23 09:20:12,388 ERROR [STDERR] org.jbpm.graph.def.DelegationException: couldn't resolve assignment expression 'user(ernie)'
                      2007-07-23 09:20:12,388 ERROR [STDERR] at org.jbpm.taskmgmt.exe.TaskMgmtInstance.performAssignment(TaskMgmtInstance.java:214)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at org.jbpm.taskmgmt.exe.TaskMgmtInstance.getInitializedSwimlaneInstance(TaskMgmtInstance.java:182)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at org.jbpm.taskmgmt.exe.TaskMgmtInstance$$FastClassByCGLIB$$e1d53490.invoke(<generated>)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:163)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at org.jbpm.taskmgmt.exe.TaskMgmtInstance$$EnhancerByCGLIB$$7662fcc2.getInitializedSwimlaneInstance(<generated>)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at org.jbpm.taskmgmt.exe.TaskInstance.assign(TaskInstance.java:192)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at org.jbpm.taskmgmt.exe.TaskMgmtInstance.createTaskInstance(TaskMgmtInstance.java:154)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at org.jbpm.taskmgmt.exe.TaskMgmtInstance$$FastClassByCGLIB$$e1d53490.invoke(<generated>)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:163)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at org.jbpm.taskmgmt.exe.TaskMgmtInstance$$EnhancerByCGLIB$$7662fcc2.createTaskInstance(<generated>)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at org.jbpm.graph.node.TaskNode.execute(TaskNode.java:168)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at org.jbpm.graph.def.Node.enter(Node.java:318)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at org.jbpm.graph.def.Node$$FastClassByCGLIB$$d187eeda.invoke(<generated>)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:163)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$abec2600.enter(<generated>)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at org.jbpm.graph.def.Transition.take(Transition.java:151)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at org.jbpm.graph.def.Node.leave(Node.java:393)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at org.jbpm.graph.node.TaskNode.leave(TaskNode.java:209)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at org.jbpm.graph.def.Node$$FastClassByCGLIB$$d187eeda.invoke(<generated>)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:163)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$abec2600.leave(<generated>)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at org.jbpm.graph.exe.Token.signal(Token.java:194)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at org.jbpm.graph.exe.Token.signal(Token.java:139)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at org.jbpm.graph.exe.Token$$FastClassByCGLIB$$74df1c6e.invoke(<generated>)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:163)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at org.jbpm.graph.exe.Token$$EnhancerByCGLIB$$db45937c.signal(<generated>)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at org.jbpm.taskmgmt.exe.TaskInstance.end(TaskInstance.java:476)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at org.jbpm.taskmgmt.exe.TaskInstance.end(TaskInstance.java:390)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at com.WebApplicationWithJbpm.actions.FourthTask.performAction(FourthTask.java:41)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at com.WebApplicationWithJbpm.actions.BaseAction.execute(BaseAction.java:17)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1085)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:398)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:241)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1085)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:398)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:241)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
                      2007-07-23 09:20:12,388 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
                      2007-07-23 09:20:12,404 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                      2007-07-23 09:20:12,404 ERROR [STDERR] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                      2007-07-23 09:20:12,404 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                      2007-07-23 09:20:12,404 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                      2007-07-23 09:20:12,404 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
                      2007-07-23 09:20:12,404 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
                      2007-07-23 09:20:12,404 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
                      2007-07-23 09:20:12,404 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
                      2007-07-23 09:20:12,404 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
                      2007-07-23 09:20:12,404 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
                      2007-07-23 09:20:12,404 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
                      2007-07-23 09:20:12,404 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
                      2007-07-23 09:20:12,404 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
                      2007-07-23 09:20:12,404 ERROR [STDERR] at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
                      2007-07-23 09:20:12,404 ERROR [STDERR] at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
                      2007-07-23 09:20:12,404 ERROR [STDERR] at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
                      2007-07-23 09:20:12,404 ERROR [STDERR] at java.lang.Thread.run(Thread.java:595)
                      2007-07-23 09:20:12,404 ERROR [STDERR] Caused by: org.jbpm.identity.assignment.ExpressionAssignmentException: couldn't resolve assignment expression 'user(ernie)'
                      2007-07-23 09:20:12,404 ERROR [STDERR] at org.jbpm.identity.assignment.ExpressionAssignmentHandler.assign(ExpressionAssignmentHandler.java:97)
                      2007-07-23 09:20:12,404 ERROR [STDERR] at org.jbpm.taskmgmt.exe.TaskMgmtInstance.performAssignmentDelegation(TaskMgmtInstance.java:226)
                      2007-07-23 09:20:12,404 ERROR [STDERR] at org.jbpm.taskmgmt.exe.TaskMgmtInstance.performAssignment(TaskMgmtInstance.java:199)
                      2007-07-23 09:20:12,404 ERROR [STDERR] ... 84 more
                      2007-07-23 09:20:12,404 ERROR [STDERR] Caused by: org.jbpm.identity.assignment.ExpressionAssignmentException: user 'ernie' couldn't be fetched from the user db
                      2007-07-23 09:20:12,404 ERROR [STDERR] at org.jbpm.identity.assignment.ExpressionAssignmentHandler.getUserByName(ExpressionAssignmentHandler.java:209)
                      2007-07-23 09:20:12,404 ERROR [STDERR] at org.jbpm.identity.assignment.ExpressionAssignmentHandler.resolveFirstTerm(ExpressionAssignmentHandler.java:147)
                      2007-07-23 09:20:12,404 ERROR [STDERR] at org.jbpm.identity.assignment.ExpressionAssignmentHandler.assign(ExpressionAssignmentHandler.java:75)
                      2007-07-23 09:20:12,404 ERROR [STDERR] ... 86 more


                      i don't undersand this issue beacause i don't set ernie like user of this task.
                      i want to end task in order to end process.

                      • 10. Re: can't get task list of an actor
                        Andreas Schienagel Newbie

                        1. In the last task, you do assign ernie as actor...Does ernie exist in your db?

                        2. You shouldn't signal processInstance. Try it only with taskInstance.end

                        • 11. Re: can't get task list of an actor
                          Anonymous User Anonymous User Newbie

                          it seems something like the user ernie doesn't exists.

                          maybe is "ernie" the user involved in the subsequent task? or maybe it is "participant", that I see resolves to "ernie"