4 Replies Latest reply on Oct 11, 2007 10:18 AM by Rares Chiriacescu

    JBPM-BPEL process monitoring - engine API

    Rares Chiriacescu Newbie

      Hello.

      I have to develop a monitoring application (similar to the one IBM provides for its BPEL engine) for BPEL processes deployed on the JBPM-BPEL engine.

      Regarding this issue, I have read the following thread:
      http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4029585#4029585

      My question is: how can I access the BPEL engine and query/inspect the deployed processes? Is there any engine API that I can use (e.g. a stateless session bean implementing the facade pattern, which provides methods like getRunningProcesses(..) )?

      I need a starting point in this regard.

      Thanks in advance.

      Kind regards, ruhl22.

        • 1. Re: JBPM-BPEL process monitoring - engine API
          Alejandro Guizar Master

          The jBPM BPEL runtime inherits the engine API provided by jBPM jPDL. The class JbpmContext is the (pojo) facade to the publicly available process operations. The so-called "named" sessions, available from the jbpmContext object, encapsulate different categories of database access. The GraphSession provides methods to retrieve the deployed process definitions and the running process instances. A sample includes:
          findAllProcessDefinitions()
          findLatestProcessDefinitions()
          findProcessInstances(processDefinitionId)

          • 2. Re: JBPM-BPEL process monitoring - engine API
            Rares Chiriacescu Newbie

            Thanks for your reply. This helps a lot.

            What about process administration functionality? Is there a way (API) to start/stop deployed/running processes?

            Kind regards, ruhl22.

            • 3. Re: JBPM-BPEL process monitoring - engine API
              Rares Chiriacescu Newbie

              I have inspected the mentioned classes, my previous question is obsolete.

              Thanks again, ruhl22.

              • 4. Re: JBPM-BPEL process monitoring - engine API
                Rares Chiriacescu Newbie

                Hi Alex.

                I have implemented a session bean facade and deployed it to the jboss server, where the jbpm-bpel engine runs. Additionally, using a client application, I access the method exposed by the deployed session bean.

                Everything runs as imagined, except that I get an exception (related to hibernate lazy collection initialization) when trying to access the Actions of a BpelProcess.

                Clinent code:
                Map<String, Action> actionMap = bpelProcessTemplate.getActions();
                actionMap.size(); //exception flies here.


                The exception stack is:

                Exception in thread "main" org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: org.jbpm.graph.def.ProcessDefinition.actions, no session or session was closed
                 at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:358)
                 at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:350)
                 at org.hibernate.collection.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:97)
                 at org.hibernate.collection.PersistentMap.size(PersistentMap.java:95)
                 at com.agetas.jbpm.client.Run.main(Run.java:83)



                Do you have any idea, how I can prevent this exception to occur? I don't want to modify the hibernate mapping code of the classes within jbpm-jpdl.jar, to deactivate lazy loading...

                Thanks in advane, ruhl22.