7 Replies Latest reply on Aug 30, 2012 7:29 AM by cybiks

    How can I see process in JBPM 5.3.0 console?

    cybiks

      I have created some proces inside my application via spring config in standard way:

       

      <jbpm:kbase id="kbase">

              <jbpm:resources>

                  <jbpm:resource type="BPMN2" source="classpath:Looping.bpmn"/>

       

              </jbpm:resources>

          </jbpm:kbase>

          <jbpm:ksession id="ksession" type="stateful" kbase="kbase" />

       

      I have changed all nesessary configs of

      designer.war , drools-guvnor.war, jbpm-form-builder.war,jbpm-gwt-console.war,jbpm-gwt-console-server.war,jbpm-human-task-war.war to use the same Oracle schema that use my application.

      And deploysed all of this stuff together with my application (let's say application.war) in jboss-as-7.1.0.Final .

      What should I do to find my process in jbpm console?

       

      From examples and documenatation :

      "To manage your process instances, click on the "Processes" tab at the left an select "Process Overview". After a slight delay (if you are using the application for the first time, due to session initalization etc.), the "Process" list should show all the known processes.  The jbpm-console in the demo setup currently loads all the processes in the "src/main/resources" folder of the evaluation sample in "jbpm-installer/sample/evaluation".  If you click the process, it will show you all current running instances.  Since there are no running instances at this point, the "Instance" table will remain empty."

       

      As I undertood I should set jbpm.console.directory=D:/jbpm in  jbpm-installer_5.3.0\conf\jbpm.console.properties (I allways make changes into configs inside jbpm-installer_5.3.0 which is full installer of 5.3.0 and then run ant clean.jboss; ant install.demo.noeclipse to have designer.war , drools-guvnor.war, jbpm-form-builder.war,jbpm-gwt-console.war,jbpm-gwt-console-server.war,jbpm-human-task-war.war updated ).

      So I copied my process definition file to D:\jbpm\Looping.bpmn (the same file that I have in classpath of my application) . 

      I run Jboss with my application and all wars from JBPM but I can see in debug that my process runs in my application (I put breakpoints in methods that launched from script tasks) but I can't see processes in JBPM console.

      What should I do to be able to see it?

      How does it work ? How JBPM console finds process diagrams and currently running process ?

        • 1. Re: How can I see process in JBPM 5.3.0 console?
          swiderski.maciej

          if you like to have access to the same process definition in jbpm-console you need to either:

          - put your process into jbpm-installer/sample/src/resources/evaluation

          - modify jbpm.console.properties file jbpm.console.directory property should point to a directory where you have your process definition

          - upload your process definition into guvnor and build the package as console will fetch all build packages from guvnor on startup

           

          for option 1 and 2 make sure your process definition file has extension of bpmn or bpmn2

           

          HTH

          • 2. Re: How can I see process in JBPM 5.3.0 console?
            cybiks

            I have used 2-nd example. I have  modified jbpm.console.directory=d:/jbpm where I have only one file D:\jbpm\Looping.bpmn. As you can see file extension is bpmn . But I still cant see such process in jbpm console. (I am completely sure that jbpm console accepts this folder because before this I have made mistake jbpm.console.directory=d:\jbpm and I had a lot of exceptions during deployment .So now folder should be ok).

            Possible here exists some other constraint with jbpm console. Does it accepts bpmn process file with procect specific files or I ahouls someghow upload here jar file with all model classes like with Guvnor repository (https://community.jboss.org/thread/204228 )?

            Do you have an real workable examples with some java code inside script task that use some specific classes (run some methods of this classes) inside of bpmn file that process I can see in Jbpm console and Guvnor repository ? Can you, please, post it here?

            Because, all examples that I have found allways use Strings and that is all.

            • 3. Re: How can I see process in JBPM 5.3.0 console?
              cybiks

              Can you, please, do next steps:

              1.Extract jbpm-5.3.0.Final-installer-full.zip\jbpm-installer\ to D:\jbpm-5.3.0.Final-installer_clean\

              2.Create bpmn dir inside jbpm-5.3.0.Final-installer_clean - to reach  D:\jbpm-5.3.0.Final-installer_clean\bpmn

              3. Copy jbpm-5.3.0.Final-examples.zip\jbpm-examples\src\main\resources\looping\Looping.bpmn to D:\jbpm-5.3.0.Final-installer_clean\bpmn\Looping.bpmn

               

              4.Change in build.xml all lines like

              <arg value="-Djbpm.console.directory=${install.home}/sample/evaluation/src/main/resources" />

              to

              <arg value="-Djbpm.console.directory=${install.home}/bpmn" />

               

              5.Run D:\jbpm-5.3.0.Final-installer_clean>ant install.demo.noeclipse

              6.Run D:\jbpm-5.3.0.Final-installer_clean>ant start.demo.noeclipse

              Go to http://localhost:8080/jbpm-console/ in browser and login as admin and check Processes-Process Overview.

              You should see after that :

              type Exception report

              message

              description The server encountered an internal error () that prevented it from fulfilling this request.

              exception

              org.jboss.resteasy.spi.UnhandledException: java.lang.NullPointerException org.jboss.resteasy.core.SynchronousDispatcher.unwrapException(SynchronousDispatcher.java:345) org.jboss.resteasy.core.SynchronousDispatcher.handleApplicationException(SynchronousDispatcher.java:321) org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:214) org.jboss.resteasy.core.SynchronousDispatcher.handleInvokerException(SynchronousDispatcher.java:190) org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:534) org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:496) org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:119) org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208) org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) javax.servlet.http.HttpServlet.service(HttpServlet.java:847) org.jboss.bpm.console.server.util.GWTJsonFilter.doFilter(GWTJsonFilter.java:59) 

              root cause

              java.lang.NullPointerException org.jbpm.integration.console.StatefulKnowledgeSessionUtil.checkPackagesFromGuvnor(StatefulKnowledgeSessionUtil.java:447) org.jbpm.integration.console.CommandDelegate.getProcesses(CommandDelegate.java:67) org.jbpm.integration.console.ProcessManagement.getProcessDefinitions(ProcessManagement.java:42) org.jboss.bpm.console.server.ProcessMgmtFacade.getDefinitionsJSON(ProcessMgmtFacade.java:125) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:597) org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:140) org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:255) org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:220) org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:209) org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:519) org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:496) org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:119) org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208) org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) javax.servlet.http.HttpServlet.service(HttpServlet.java:847) org.jboss.bpm.console.server.util.GWTJsonFilter.doFilter(GWTJsonFilter.java:59) 

               

              Where I made mistake ?

              Or second case " - modify jbpm.console.properties file jbpm.console.directory property should point to a directory where you have your process definition" didn't work at all?

              • 4. Re: How can I see process in JBPM 5.3.0 console?
                swiderski.maciej

                Your configuration is completely correct, there was a bug in handling knowledge agent and collecting packages from guvnor. It was resolved on master but what you could do is after server startup and first logon to console give little bit more time to initialize session before you go to Processes section - like 5 - 10 seconds.

                 

                 

                Anatoliy Kalenskiy wrote:

                Or second case " - modify jbpm.console.properties file jbpm.console.directory property should point to a directory where you have your process definition" didn't work at all?

                If you start it with ant start.demo then value given in jbpm-console.properties is overridden by jvm property given in build script -Djbpm.console.directory....

                 

                HTH

                • 5. Re: How can I see process in JBPM 5.3.0 console?
                  cybiks

                  Thanks for your reply!

                  I am still trying to see my process in JBPM console and main problem that in my process definition (.bpmn file) I use some pojo model. And with your answer on https://community.jboss.org/thread/204228 I have successfully add it to Guvnor and build it.

                  Now I what to see it in JBPM console.

                  When I try to open : http://localhost:8080/gwt-console-server/rs/process/definitions

                  It shows me: {"definitions":[]}

                  And in server log :

                  Caused by: java.lang.ClassNotFoundException: example.com.MyConstants from [Module "deployment.jbpm-gwt-console-server.war:main" from Service Module Loader]

                  17:58:25,697 ERROR [stderr] (http--127.0.0.1-8080-1)     at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)

                  17:58:25,697 ERROR [stderr] (http--127.0.0.1-8080-1)     at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)

                  17:58:25,698 ERROR [stderr] (http--127.0.0.1-8080-1)     at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)

                  17:58:25,701 ERROR [stderr] (http--127.0.0.1-8080-1)     at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423)

                  17:58:25,702 ERROR [stderr] (http--127.0.0.1-8080-1)     at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)

                  17:58:25,703 ERROR [stderr] (http--127.0.0.1-8080-1)     at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)

                  17:58:25,704 ERROR [stderr] (http--127.0.0.1-8080-1)     at java.lang.Class.forName0(Native Method)

                  17:58:25,707 ERROR [stderr] (http--127.0.0.1-8080-1)     at java.lang.Class.forName(Class.java:247)

                  17:58:25,708 ERROR [stderr] (http--127.0.0.1-8080-1)     at org.drools.common.DroolsObjectInputStream.resolveClass(DroolsObjectInputStream.java:85)

                  17:58:25,708 ERROR [stderr] (http--127.0.0.1-8080-1)     at org.drools.common.DroolsObjectInputStream.resolveClass(DroolsObjectInputStream.java:97)

                  17:58:25,709 ERROR [stderr] (http--127.0.0.1-8080-1)     at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1574)

                  17:58:25,709 ERROR [stderr] (http--127.0.0.1-8080-1)     at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1495)

                  17:58:25,710 ERROR [stderr] (http--127.0.0.1-8080-1)     at java.io.ObjectInputStream.readClass(ObjectInputStream.java:1461)

                  17:58:25,710 ERROR [stderr] (http--127.0.0.1-8080-1)     at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1311)

                  17:58:25,711 ERROR [stderr] (http--127.0.0.1-8080-1)     at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)

                  17:58:25,711 ERROR [stderr] (http--127.0.0.1-8080-1)     at java.util.HashMap.readObject(HashMap.java:1030)

                  17:58:25,712 ERROR [stderr] (http--127.0.0.1-8080-1)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                  17:58:25,712 ERROR [stderr] (http--127.0.0.1-8080-1)     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

                  17:58:25,713 ERROR [stderr] (http--127.0.0.1-8080-1)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                  17:58:25,713 ERROR [stderr] (http--127.0.0.1-8080-1)     at java.lang.reflect.Method.invoke(Method.java:597)

                  17:58:25,713 ERROR [stderr] (http--127.0.0.1-8080-1)     at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974)

                  17:58:25,714 ERROR [stderr] (http--127.0.0.1-8080-1)     at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1848)

                  17:58:25,714 ERROR [stderr] (http--127.0.0.1-8080-1)     at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752)

                  17:58:25,714 ERROR [stderr] (http--127.0.0.1-8080-1)     at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)

                  17:58:25,715 ERROR [stderr] (http--127.0.0.1-8080-1)     at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)

                  17:58:25,715 ERROR [stderr] (http--127.0.0.1-8080-1)     at org.drools.rule.MVELDialectRuntimeData.readExternal(MVELDialectRuntimeData.java:85)

                  17:58:25,715 ERROR [stderr] (http--127.0.0.1-8080-1)     at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1791)

                  17:58:25,716 ERROR [stderr] (http--127.0.0.1-8080-1)     at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1750)

                  17:58:25,716 ERROR [stderr] (http--127.0.0.1-8080-1)     at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)

                  17:58:25,717 ERROR [stderr] (http--127.0.0.1-8080-1)     at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)

                  17:58:25,717 ERROR [stderr] (http--127.0.0.1-8080-1)     at java.util.HashMap.readObject(HashMap.java:1030)

                  17:58:25,717 ERROR [stderr] (http--127.0.0.1-8080-1)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                  17:58:25,718 ERROR [stderr] (http--127.0.0.1-8080-1)     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

                  17:58:25,718 ERROR [stderr] (http--127.0.0.1-8080-1)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                  17:58:25,719 ERROR [stderr] (http--127.0.0.1-8080-1)     at java.lang.reflect.Method.invoke(Method.java:597)

                  17:58:25,719 ERROR [stderr] (http--127.0.0.1-8080-1)     at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974)

                  17:58:25,720 ERROR [stderr] (http--127.0.0.1-8080-1)     at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1848)

                  17:58:25,720 ERROR [stderr] (http--127.0.0.1-8080-1)     at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752)

                  17:58:25,721 ERROR [stderr] (http--127.0.0.1-8080-1)     at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)

                  17:58:25,721 ERROR [stderr] (http--127.0.0.1-8080-1)     at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)

                  17:58:25,721 ERROR [stderr] (http--127.0.0.1-8080-1)     at org.drools.rule.DialectRuntimeRegistry.readExternal(DialectRuntimeRegistry.java:59)

                  17:58:25,722 ERROR [stderr] (http--127.0.0.1-8080-1)     at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1791)

                  17:58:25,722 ERROR [stderr] (http--127.0.0.1-8080-1)     at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1750)

                  17:58:25,723 ERROR [stderr] (http--127.0.0.1-8080-1)     at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)

                  17:58:25,723 ERROR [stderr] (http--127.0.0.1-8080-1)     at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)

                  17:58:25,724 ERROR [stderr] (http--127.0.0.1-8080-1)     at org.drools.rule.Package.readExternal(Package.java:208)

                  17:58:25,724 ERROR [stderr] (http--127.0.0.1-8080-1)     at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1791)

                  17:58:25,724 ERROR [stderr] (http--127.0.0.1-8080-1)     at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1750)

                  17:58:25,725 ERROR [stderr] (http--127.0.0.1-8080-1)     at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)

                  17:58:25,725 ERROR [stderr] (http--127.0.0.1-8080-1)     at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1666)

                  17:58:25,726 ERROR [stderr] (http--127.0.0.1-8080-1)     at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1322)

                  17:58:25,727 ERROR [stderr] (http--127.0.0.1-8080-1)     at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)

                  17:58:25,727 ERROR [stderr] (http--127.0.0.1-8080-1)     at org.drools.core.util.DroolsStreamUtils.streamIn(DroolsStreamUtils.java:205)

                  17:58:25,730 ERROR [stderr] (http--127.0.0.1-8080-1)     at org.drools.core.util.DroolsStreamUtils.streamIn(DroolsStreamUtils.java:174)

                  17:58:25,731 ERROR [stderr] (http--127.0.0.1-8080-1)     at org.drools.agent.impl.KnowledgeAgentImpl.createPackageFromResource(KnowledgeAgentImpl.java:749)

                  17:58:25,733 ERROR [stderr] (http--127.0.0.1-8080-1)     ... 46 more

                   

                  Where example.com.MyConstants is a constants that I upload in Guvnor inside POJO model file.

                  How can I explain console where to find such file?

                  • 6. Re: How can I see process in JBPM 5.3.0 console?
                    tsurdilovic

                    Your fact model and dependency jars with 3rd party classes you use in your process/rules should be in jar files and put them in $installer/dependencies directory, then run

                    ant clean.demo

                    ant install.demo.noeclipse

                    ant start.demo.noeclipse

                     

                    putting the jars in $installer/dependencies will assure that they are placed on the console classpath correctly.

                    Since the Drools .pkg file does not include jars you have to do this step manually.

                     

                    Hope this helps.

                    1 of 1 people found this helpful
                    • 7. Re: How can I see process in JBPM 5.3.0 console?
                      cybiks

                      Thanks a lot,  for you reply!

                      It works - I can see my process in jbpm-console in Process Overview.

                      But I can't see any process instances.

                      http://localhost:8080/gwt-console-server/rs/process/definitions   :

                       

                      {"definitions":[{"id":"com.example.myprocess","name":"MyProcess","version":0,"packageName":"defaultPackage","deploymentId":"N/A","suspended":false}]}

                      But

                      http://localhost:8080/gwt-console-server/rs/process/definition/com.example.myprocess/instances :

                      {"instances":[]}

                       

                      I am in debug prosess - I can see that my process starts and  stops on some debug point inside my hander for service task. So,as I think , one process instances should be created.

                       

                      I use spring config like:

                      <beans xmlns="http://www.springframework.org/schema/beans"

                             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                             xmlns:jbpm="http://drools.org/schema/drools-spring"

                             xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd

                                                 http://drools.org/schema/drools-spring http://drools.org/schema/drools-spring.xsd ">

                       

                          <jbpm:kbase id="kbase">

                              <jbpm:resources>

                                  <jbpm:resource type="BPMN2" source="classpath:MyProcess.bpmn"/>

                       

                              </jbpm:resources>

                          </jbpm:kbase>

                          <jbpm:ksession id="ksession" type="stateful" kbase="kbase">

                              <jbpm:configuration>

                       

                                  <jbpm:work-item-handlers>

                       

                                      <jbpm:work-item-handler name="ServiceTask1" ref="event1Handler"/>

                                      <jbpm:work-item-handler name="ServiceTask2" ref="event2Handler"/>

                       

                                  </jbpm:work-item-handlers>

                              </jbpm:configuration>

                          </jbpm:ksession>

                       

                          <bean id="event1Handler" class="com.example.MyEvent1HandlerHandler">

                          </bean>

                          <bean id="event2Handler" class="com.example.MyEvent2HandlerHandler">

                          </bean>

                       

                      </beans>

                       

                      So I put breackpoint inside MyEvent1HandlerHandler.executeWorkItem and stay here -so my process runs but I can't see anty process instances in JBPM console.

                       

                      So where jbpm console takes information about current instances? From PROCESSINSTANCELOG ? I have such empty table in my scheme...

                      Possible problem connected with transaction management?

                      When information for new instances stores in DB and retreaves by JBPM console?

                      Possible I should somehow specify when such information should be stored?

                      (I have reconffigured all wars to use my connection to Oracle DB that I use for application, not H2).

                       

                      I have found in jbpm-5.3.0.Final-docs/jbpm-docs/html_single/index.html 

                      8.3.1. The Business Activity Monitoring data model

                       

                      But in my DB this tables are empty  - only SESSIONINFO table contains some data.

                      What I have miss in my configuration? - Looks like persistance.xml with jdbc/processInstanceDS

                      datasource. But where I sohuld put it?

                      Do I need this file to force JBPM console to find instancess of my process?