4 Replies Latest reply on Jun 23, 2015 10:58 AM by bsl.lacerda

    Using BRMS Rules on a Dynamic Web Project

    bsl.lacerda

      Hello,

       

      I'm have a Dynamic Web Application running on JBoss EAP 6.3.

      I want to implement some functionalities using Drools Rules.

       

      I'd like to use my domain pojo objects as facts on rule definitions on BRMS intead of define some facts on a BRMS project and use this facts together with my domain pojo objects using the BRMS project as dependency of my Web Project.

       

      Does someone have some tips about what do I have to do to submit facts to BRMS?

       

      Other question is: Can I upload my entire web application to BRMS repository to use the POJO in technical rules definitions?

       

      What is the best way to integrate a Dynamic (already created) Web Application with a new BRMS Project?

       

      Sorry for my english.

       

      Thanks in advance.

        • 1. Re: Using BRMS Rules on a Dynamic Web Project
          tirelli

          The best way is to create a jar file with your domain model and then set your domain jar as a dependency of the BRMS/rules project.

           

          Although you can define your whole web application as a dependency, I would advise against it as it would bring with it transitive dependencies that would simply clutter the project and make it heavier.

          • 2. Re: Using BRMS Rules on a Dynamic Web Project
            bsl.lacerda

            Thank you Edson for reply!

             

            I'll have to refactor my web project to modularize it. Fortunately I'm using maven.

            One more question is, when I refactor the project to extract the POJOs, I'll have a JPA project with JPA annotated classes and persistence.xml in it.

            Do you think I'll have some problems with annotated JPA POJOs when upload the project as dependency of my BRMS project?

             

            Thanks in advance.

            • 3. Re: Using BRMS Rules on a Dynamic Web Project
              tirelli

              You should have no problems with JPA annotations (JPA obviously needs to be set as a dependency in the pom.xml, but nothing else). In fact the new version of BRMS even supports creating the JPA annotations for you, but that's a different discussion.

              • 4. Re: Using BRMS Rules on a Dynamic Web Project
                bsl.lacerda

                I already refactored the web project and created the domain project with POJOs and everything is working as well.

                 

                Thank you again Edson for the explanations.