7 Replies Latest reply on Jan 3, 2013 12:50 PM by swiderski.maciej

    Jbpm 5 listing processes

    roxy1987

      Hi,

       

      I am working on a web application and ve been able to achieve task related stuff, thanks to the community. I am looking for some process related APIs. to list processes and stuff.

      I use a TaskClient to connect and a BlockingTaskOperationResponseHandler to get the response. Is there a similar client for processes?

      Any help would be highly appreciated. Thanks.

       

      Regards.

        • 1. Re: Jbpm 5 listing processes
          swiderski.maciej

          Take a look at api docs and most important for you will be StatefulKnowledgeSession.getKnowledgeBase().getProcesses()

           

          HTH

          • 2. Re: Jbpm 5 listing processes
            roxy1987

            Thanks for a quick reply Maciej.

            I have tried using StatefulKnowledgeSession.

             

            StatefulKnowledgeSession ksession = createKnowledgeSession(kBase);

            ksession.getProcessInstances();

             

            But it returns me an empty string always. May be I am not creating the session well?

            What I am doing is the following.

             

             

            Untitled.png

             

            I am mostly doing hit and trial as the version is pretty different from previous one and I am in a little bit if a hasty situation with the project. I am guessing that the WorkItemHandler should not be registered as string Human Task? but it works with starting the process so may be.

            Anyway may be you could help with this. Thanks a million.

            • 3. Re: Jbpm 5 listing processes
              swiderski.maciej

              so you want to list processes or process instances?

               

              for processes use kBase.getProcesses()

               

              for process instances you should enable history log and then use query methods to get active process instances from log entries as (you already noticed) runtime will load process instance only when it's needed - while it being executed.

               

              HTH

              1 of 1 people found this helpful
              • 4. Re: Jbpm 5 listing processes
                roxy1987

                No. I am looking for process instances, whether running, completed or terminated. Could you please tell me how the history logging is enabled? Thanks.

                • 5. Re: Jbpm 5 listing processes
                  swiderski.maciej

                  Here you can find details on how to configure it and then you can use  org.jbpm.process.audit.JPAProcessInstanceDbLog to query for stored information.

                   

                  HTH

                  • 6. Re: Jbpm 5 listing processes
                    roxy1987

                    Thanks Maciej. You should start coming here more regularly. People wont have trouble getting jBPM5

                    Thanks a lot man.

                    • 7. Re: Jbpm 5 listing processes
                      swiderski.maciej

                      trying to be as often as possible