8 Replies Latest reply on Oct 31, 2005 5:46 AM by Ronald van Kuijk

    findTaskInstances question

    matafy Newbie

      i use an AssignmentHandler in a tasknode, when the process comes into this node, it seems right because System.out.println( taskInstance.getActorId() ) shows the right peron assigned. but why when i use TaskMgmtSession.findTaskInstances( someone ), it gets empty list.
      also there is a warning message:
      2005-10-31 9:53:43 org.hibernate.hql.ast.ErrorCounter reportWarning
      warn: *** WARNING: Keyword 'end' is being intepreted as an identifier due to: expecting IDENT, found 'end'

      what's wrong?

        • 1. Re: findTaskInstances question
          Ronald van Kuijk Master

          you try to get a tasklist from within an assignmenthandler? Probably for a kind of workloadbalancing? No idea why this is empty. Have to try that myself later today

          Regarding the warning. Nothing serious. I get them to and jBPM works fine

          • 2. Re: findTaskInstances question
            matafy Newbie

            JbpmSession session = jbpmSessionFactory.openJbpmSession();
            session.beginTransaction();
            ProcessDefinition definition = session.getGraphSession().findLatestProcessDefinition( "toushu" );
            ProcessInstance processInstance = new ProcessInstance( definition );
            Token token = processInstance.getRootToken();
            token.signal();
            session.getGraphSession().saveProcessInstance( processInstance );

            TaskInstance taskInstance = (TaskInstance)
            processInstance
            .getTaskMgmtInstance()
            .getTaskInstances()
            .iterator().next();
            TaskMgmtSession taskSession = session.getTaskMgmtSession();
            System.out.println( taskInstance.hasEnded() ); //result:false
            System.out.println( taskInstance.getActorId() ); //result:akernar
            session.commitTransactionAndClose();

            //then in a test method, got some strange thing
            System.out.println( taskInstance.hasEnded() );// result "true", why???
            List list = taskSession.findTaskInstances( "akernar" ); //why it's empty list here???

            help please!!!

            • 3. Re: findTaskInstances question
              Ronald van Kuijk Master

              what does your process look like?

              • 4. Re: findTaskInstances question
                matafy Newbie

                <?xml version="1.0" encoding="UTF-8"?>

                <process-definition name="toushu">
                <start-state name="start">

                </start-state>
                <task-node name="pre state">




                </task-node>
                <task-node name="normal state">




                </task-node>
                <task-node name="confirm">




                </task-node>
                <end-state name="end"></end-state>
                </process-definition>

                • 5. Re: findTaskInstances question
                  matafy Newbie

                  <![CDATA[
                  <?xml version="1.0" encoding="UTF-8"?>

                  <process-definition name="toushu">
                  <start-state name="start">

                  </start-state>
                  <task-node name="pre state">




                  </task-node>
                  <task-node name="normal state">




                  </task-node>
                  <task-node name="confirm">




                  </task-node>
                  <end-state name="end"></end-state>
                  </process-definition>
                  ]]>

                  • 6. Re: findTaskInstances question
                    matafy Newbie

                     

                    "matafy" wrote:
                    <![CDATA[
                    <?xml version="1.0" encoding="UTF-8"?>

                    <process-definition name="toushu">
                    <start-state name="start">
                    <transition name="submit" to="pre state"></transition>
                    </start-state>
                    <task-node name="pre state">
                    <task name='parse1'>
                    <assignment class='com.akernar.toushu.ParseAssignmentHandler' />
                    </task>
                    <transition name="dispatch" to="normal state"></transition>
                    </task-node>
                    <task-node name="normal state">
                    <task name='normal2'>
                    <assignment class='com.akernar.toushu.HandleAssignmentHandler' />
                    </task>
                    <transition name="tocomfirm" to="confirm"></transition>
                    </task-node>
                    <task-node name="confirm">
                    <task name='confirm'>
                    <assignment class='com.akernar.toushu.ConfirmAssignmentHandler' />
                    </task>
                    <transition name="tr1" to="end"></transition>
                    </task-node>
                    <end-state name="end"></end-state>
                    </process-definition>
                    ]]>


                    • 8. Re: findTaskInstances question
                      Ronald van Kuijk Master

                      use the code tag to embed xml of java code