6 Replies Latest reply on Oct 23, 2007 8:41 AM by kukeltje

    Where is my process waiting for execution?

    danymatte

      Hi,
      I have a trouble...
      In my process there are many different user and many different task. I need to find where a process instance is waiting for execution, and which user has blocked it...I need to do it from outside my process (so I can't use ExecutionContext, right?), for example in a Jsp page, where a user can understand the current task where the process is waiting for execution...
      Anyone can help me? And sorry for my English....
      Thanks

        • 1. Re: Where is my process waiting for execution?
          dleerob

          The process image can show you where it is currently sitting. For example, the jbpm-console has a process image, and if you look at the image for a process instance, the node where it is sitting will be highlighted.
          I build that same functionality into my own webapp, so I simply click an "image" button for a process instance, and the image shows me where it is sitting.

          You could also iterate through all task instances for the specific process instance, and those which have an end date are completed, and those whose end date is null, means its not completed. So you can determine from that which node it is sitting at in the process.

          • 2. Re: Where is my process waiting for execution?
            dleerob

            Oh yes and to get the user its currently sitting with, just simply get the actor id from the task instance its currently sitting at.

            • 3. Re: Where is my process waiting for execution?
              danymatte

              Thank you for your answer...
              But how can I get the correct process instance, if I'm not the owner of root token? I mean, I log in my application with the user who partecipates in the process and wants to know where the process instance is waiting, but he hasn't any activity to complete...he wants only to know where the process instance is blocked...
              For example I've seen ExecutionContext has method getProcessInstance...but if I'm outside a process instance, how can I get it? I think I can't access ExecutionContext...
              I hope I've explained my problem...
              Thanks!!!

              • 4. Re: Where is my process waiting for execution?
                kukeltje

                you SHOULD have a reference to the process in your system/model/.... being it the root token, processid, busisnesskey otherwise there is no relation at all

                • 5. Re: Where is my process waiting for execution?
                  dleerob

                  All my users have a list of all task instances that they have completed. So if they did complete a task at some stage, they can click on "completed" tasks, view their list, and then select the task they want to view the process for.
                  If a user never actually performs a task for a process instance, you could always list all process instances, and let him select which one he wants to view.

                  I also have an "initiated processes" view, where a user can view a list of all process instances that he was the initiator of.

                  I have an admin user that can also view a list of all process instances, and all tasks, so he can take a look at anything he wants.

                  There are many ways to determine the process instance you want to view, it all depends on how your application is used, and how you want it to be used.

                  • 6. Re: Where is my process waiting for execution?
                    kukeltje

                    and also a process can be waiting in a 'state' where there are no tasks.