1 2 Previous Next 16 Replies Latest reply on May 19, 2012 12:12 AM by wallacepontes

    Drools-jBPM connection

    tomarenz

      Hi all,

      I'm trying to get an overview concerning any relation between Drools and jBPM, e.g. how business rules can drive a process flow.

      Till now I understood that rules enter the game as:

       

      - conditions to constrain choices in xor xplit gateways.

      - business rule tasks (I guess there is an embedded workItemHandler somewhere).

      - anything else ?

       

      However I miss how facts are managed, e.g. how process tasks declare facts to be used later on by rules in the same process and how scopes are defined.

      Is there any document/tutorial/example explaining how these two worlds interconnect ?

      Thanks.

        • 1. Re: Drools-jBPM connection
          salaboy21

          Hi renzo,

          There is a whole new world behind running the processes and rules together in the same runtime (and don't forget events). Running rules and processes you can model and implement very complex scenarios that requires the execution of ordered activities as proposed by business processes and more unstructured activities and business logic using business rules. Combining them both you can drive business processes using business rules or orchestrate your business logic using as you mention business rule tasks and conditions. But you can also trigger new business processes, sub processes, dynamic branches, deal with expcetional situations, etc with business rules more easily, without complicating the process graph.

          If you include events to the mix you can also model more dynamic aspects of your applications, like live streams of information that is coming from different sources and you need to evaluate, aggregate and correlate that information with your process status and your facts information in order to react in near real time.

           

          I strongly suggest you to take a look at the emergency services application that we are developing to show how to architect and model complex scenarios using these technologies:

           

          http://salaboy.wordpress.com/2011/05/28/emergency-services-v2-jbpm5-and-drools-blueprint/

          https://salaboy.wordpress.com/2011/08/12/emergency-services-v3-proposed-features/

           

          source code:

          https://github.com/Salaboy/emergency-service-drools-app

           

          Best Regards

           

          PS: we are currently working on the version 3 of the application, so I think its a very good opportunity to help us an learn in the process.

          • 2. Re: Drools-jBPM connection
            tomarenz

            Thanks Mauricio, the overall picture is challenging.

            Btw, I tried to install v2 sources to have all in Eclipse.

            Maven complains about 2 missing artifacts it could not download from any configured repository:

             

            1) com.wordpress.salaboy.smarttasks:smart-tasks-api:jar:1.0-SNAPSHOT

            2) com.wordpress.salaboy.smarttasks:smart-tasks-jbpm5-impl:jar:1.0-SNAPSHOT

            • 3. Re: Drools-jBPM connection
              salaboy21

              Can you check that this repository is configured:

              https://repository-plugtree-org.forge.cloudbees.com/snapshot/

               

              If so, you should register that repository in your CACERTS certificates, for doing that you can follow this steps:

              https://cloudbees.zendesk.com/entries/20078393-configuring-maven-to-access-https-repositories-with-untrusted-ssl-certificates

               

              Doing this you will trust in this repository to download dependencies.

               

              Cheers

              • 4. Re: Drools-jBPM connection
                tomarenz

                Thanks, but I still have the same issue, also because the above url instructions conflict with README instructions:

                 

                - I'm using win7 64 bits and jdk 1.6.0_27

                - I got the certificate from https://repository-plugtree-org.forge.cloudbees.com/snapshot/

                - I imported it into "\Program Files\java\jdk1.6.0_27\jre\lib\security\cacerts jdk keystore.

                 

                However:

                 

                - this keystore needs a password to retrieve the certificate, I wonder how maven manages it. The same about any assigned alias name.

                - the above repository wants a login with password, I wonder how I can get it and tell maven about.

                • 5. Re: Drools-jBPM connection
                  eaa

                  I think Plugtree's maven repo is having some technical problems right now. The repository shouldn't require any username/password. We will try to fix them asap!

                  • 6. Re: Drools-jBPM connection
                    tomarenz

                    Well, in the mean time I wanted to have a look at process diagrams (emergency-service-core), by opening them in Eclipse (Indigo 3.7, where jBPM diagrams are usually ok).

                    None succeeded, throwing:

                     

                    java.lang.IllegalArgumentException: Unknown model object null

                        at org.drools.eclipse.flow.ruleflow.editor.editpart.RuleFlowEditPartFactory.createEditPart(RuleFlowEditPartFactory.java:94)

                        at org.eclipse.gef.ui.parts.AbstractEditPartViewer.setContents(AbstractEditPartViewer.java:626)

                        at org.drools.eclipse.flow.common.editor.GenericModelEditor.initializeGraphicalViewer(GenericModelEditor.java:175)

                        at org.eclipse.gef.ui.parts.GraphicalEditor.createGraphicalViewer(GraphicalEditor.java:158)

                        at org.eclipse.gef.ui.parts.GraphicalEditorWithPalette.createPartControl(GraphicalEditorWithPalette.java:63)

                        at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:670)

                        at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:465)

                        at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)

                        at org.eclipse.ui.internal.EditorReference.getEditor(EditorReference.java:289)

                        at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2945)

                        at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2850)

                        at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:2842)

                        at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2793)

                        at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)

                        at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2789)

                        at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2773)

                        at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2756)

                        at org.eclipse.ui.internal.ReopenEditorMenu.open(ReopenEditorMenu.java:296)

                        at org.eclipse.ui.internal.ReopenEditorMenu.access$2(ReopenEditorMenu.java:280)

                        at org.eclipse.ui.internal.ReopenEditorMenu$3.widgetSelected(ReopenEditorMenu.java:248)

                        at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:240)

                        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)

                        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)

                        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165)

                        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)

                        at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)

                        at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)

                        at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)

                        at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)

                        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)

                        at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)

                        at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)

                        at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)

                        at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)

                        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)

                        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)

                        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)

                        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)

                        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

                        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

                        at java.lang.reflect.Method.invoke(Unknown Source)

                        at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)

                        at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)

                        at org.eclipse.equinox.launcher.Main.run(Main.java:1410)

                        at org.eclipse.equinox.launcher.Main.main(Main.java:1386)

                     

                    Unfortunately no way even from the designer (in Drools-Guvnor), since the only way I know of to import into Guvnor is from Eclipse.

                    • 7. Re: Drools-jBPM connection
                      salaboy21

                      Hi Renzo,

                      The keystore password is the default one: "changeit"

                      The repositories are now ok and working.If you manage to get the keystore registered in the jdk certificates it should work, because you don't want to change anything in the repos, maven will only check and download artifacts from there.

                       

                      About guvnor and eclipse, all the processes are being displayed here, make sure that you have the latest plugin version, the model project also in your workspace (inside the processes we are using classes from the model project) and the latests drools & jbpm5 runtime configured inside eclipse.

                       

                      Cheers

                      • 8. Re: Drools-jBPM connection
                        tomarenz

                        >>> The repositories are now ok and working. <<<

                         

                        I still get an authentication request:

                         

                        A user name and password are being requested by https://repository-plugtree-org.forge.cloudbees.com.

                        The site says: "plugtree-org repository"

                         

                        Btw I use FF 5.01, but IE8 does the same.

                         

                        About Guvnor and Eclipse: I installed jBPM 5.1.0 final and I tried to open process definitions as single .bpmn files (no java), since I have no projects until the missing artifact issue is solved.

                        • 9. Re: Drools-jBPM connection
                          tomarenz

                          Today there is no login request, so that dowloading from Plugtree succeeds.

                          However no Eclipse projects are generated. One test fails as:

                           

                          >>> Stopping Human Task Server ...

                          26-ago-2011 9.55.03 org.hornetq.core.logging.impl.JULLogDelegate warn

                          AVVERTENZA: Connection failure has been detected: The connection was disconnected because of server shutdown [code=4]

                          26-ago-2011 9.55.03 org.hornetq.core.logging.impl.JULLogDelegate info

                          INFO: HornetQ Server version 2.0.0.GA (Hornet Queen, 113) stopped

                          >>> Human Task Server Stopped!

                          26-ago-2011 9.55.03 org.hornetq.core.logging.impl.JULLogDelegate warn

                          AVVERTENZA: Connection failure has been detected: The connection was disconnected because of server shutdown [code=4]

                          26-ago-2011 9.55.03 org.hornetq.core.logging.impl.JULLogDelegate info

                          INFO: HornetQ Server version 2.0.0.GA (Hornet Queen, 113) stopped

                          Exception in thread "Thread-8" java.lang.RuntimeException: Client Exception with class class org.jbpm.task.service.hornetq.HornetQTaskClientConnector$1 using port 5446

                              at org.jbpm.task.service.hornetq.HornetQTaskClientConnector$1.run(HornetQTaskClientConnector.java:115)

                              at java.lang.Thread.run(Thread.java:662)

                          Caused by: java.lang.RuntimeException: Unable to send message

                              at org.drools.grid.remote.ConversationUtil.sendMessage(ConversationUtil.java:78)

                          ...

                          Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 9.375 sec <<< FAILURE!

                          Running com.wordpress.salaboy.procedures.DefaultHeartAttackProcedureTest

                          >>> Starting Human Task Server ...

                              at org.jbpm.workflow.instance.node.WorkItemNodeInstance.triggerCompleted(WorkItemNodeInstance.java:239)

                          ...

                           

                          and later on:

                           

                          Starting Local Session because Remote takes to long!!!

                          ^^^^^^^^^^^^^^^^^^^^^^^^Starting DUMB PROCEDURE

                          ASDASDASDASDASDA

                          I'm going out of here!!!!!!

                          >>> Disconnecting Client = tasksQueue

                          26-ago-2011 9.55.36 org.jbpm.task.service.hornetq.HornetQTaskClientConnector$1 run

                          INFO: Consumer is closed

                          >>> Stopping Human Task Server ...

                          26-ago-2011 9.55.36 org.hornetq.core.logging.impl.JULLogDelegate info

                          INFO: HornetQ Server version 2.0.0.GA (Hornet Queen, 113) stopped

                          >>> Human Task Server Stopped!

                          26-ago-2011 9.55.36 org.hornetq.core.logging.impl.JULLogDelegate warn

                          AVVERTENZA: Connection failure has been detected: The connection was disconnected because of server shutdown [code=4]

                          26-ago-2011 9.55.36 org.hornetq.core.logging.impl.JULLogDelegate info

                          INFO: HornetQ Server version 2.0.0.GA (Hornet Queen, 113) stopped

                          Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 6.263 sec

                           

                          Results :

                           

                          Failed tests:

                            genericEmergencyProcedureTest(com.wordpress.salaboy.grid.IncomingCallsMGMTServiceTest)

                           

                          Tests run: 6, Failures: 1, Errors: 0, Skipped: 0

                           

                          [INFO] ------------------------------------------------------------------------

                          [ERROR] BUILD FAILURE

                          • 10. Re: Drools-jBPM connection
                            eaa

                            I think "mvn eclipse:eclipse" should make the trick

                            1 of 1 people found this helpful
                            • 11. Re: Drools-jBPM connection
                              tomarenz

                              Yes thanks, now Eclipse projects look ok.

                              • 12. Re: Drools-jBPM connection
                                saihegde

                                Authentication errors to the plugtree repo on cloudbees.

                                Am I missing something here?

                                • 13. Re: Drools-jBPM connection
                                  salaboy21

                                  For what artifact? what are you trying to do? did you check my previous comment about the keystore?

                                  Cheers

                                  • 14. Re: Drools-jBPM connection
                                    saihegde

                                    Yes, I did that. I had to make a few changes to get to that point as well. Like with the hornetq artifacts, the one's used in the project are no longer on maven central.

                                    The slickCokeAndCode repo gets tagged as a Gaming site and the artifacts do not come down at my workplace.

                                    1 2 Previous Next