4 Replies Latest reply on Feb 28, 2010 1:30 PM by swiderski.maciej

    Get node info for finished process instances

    swiderski.maciej

      Hi all,

       

      I am working on some extension to jBPM console to provide capability of browsing already finished process instances. The use case is quite simple:

      - user selects process definition on "Process Definition" tab

      - user changes tab to new one let's say "Process Instance History"

      - on this tab there are two sections:

                - list of finished process instances for selected definition

                - list of all nodes that were executed within life of selected process instance - requires selection of process instance

      - in addition, user can click on Diagram button to show the same information on process definition diagram where all executed nodes are marked

       

      Issue that I have encountered is that there is not simple way (or I did not find it yet) to query for all nodes that were executed. I used:

      HistoryActivityInstanceQuery
      

      but where is only two options that are quite suitable for my use case:

      - specify execution id

      - specify definition id

       

      Both of this options have drawbacks:

      - execution id will not return tasks and states because the execution id is not process instance id, and while working with process instance that's the only id I can use

      - definition id returns all nodes regardless of process instance id which could be rather huge list after some time

       

      Why there is no way to specify processInstanceId instead of these two? Or make execution id with LIKE operand?

       

      At the moment workaround for it is to query for all nodes using definition id and filter them by checking if execution id starts with process instance id. Seems to work so far and it is quite interesting functionality from administration point of view.

       

      Am I missing something?

       

      Thanks

      Maciej