5 Replies Latest reply on Oct 28, 2014 2:39 PM by Kyle Smith

    How to create my own BRMS Decision Table Application

    Kyle Smith Newbie

      Hello Everyone,

       

      I am trying to mimic the brms decision table example shown here: http://www.jboss.org//quickstarts/brms/decision-table/index.html I successfully created 1) a repository, 2) a project with a folder structure, 3) some automatically created java classes made through the data modeler tool, 4) created a decision table, 5) validated this by clicking 'validate' and 6) built and deployed the kmodule. So basically I have most of what I need to create a similar project as what is in the example.

       

      What I am missing is the files and folders that are stored out of the .m2 repository that are used to build the and run the project through Maven. These files and folders include the 1) pom.xml file, 2) the src and target folders, and 3) everything underneath these src and target folders such as a java source file, a byte-code file, some lst files, and an XML file.

       

      How can I create the files that sit outside of the Maven .m2 repository that work with creating and deploying the application?

       

      Thank-you for reading this.

       

      Respectfully,

       

      Kyle Smith

        • 1. Re: How to create my own BRMS Decision Table Application
          Petr Široký Newbie

          Hello,

           

          I am sorry, but I am not sure I understand your problem entirely. If you create the project and add java files, decision tables, etc, these files are stored in git repository. You can access this repository either directly on filesystem in directory $DIR_YOU_STARTED_BRMS_FROM/.niogit (not recommended though) or by ssh using something like git clone ssh://localhost:8001/repository1 (this url is shown in the Authoring -> Administration perspective).

           

          If this is not what you are looking for, please clarify a bit more what is it you want to achieve.

           

          Thanks,

          Petr

          • 2. Re: Re: How to create my own BRMS Decision Table Application
            Kyle Smith Newbie

            Petr,

             

            I am trying to create my own project. One that is very similar to one of the examples. I am not trying to import the repository from Git. I did this when following the example.

             

            What I am trying to do is create my own JBoss Business Rules Management System (BRMS) application from the ground up. I have created the Decision Table and the Java objects that are used in the Decision Table through the Data Modeler in the BRMS web application. So basically I have a similar project as the example Decision Table example that one can download and also install through cloning the repository in the BRMS.

             

            What I am asking for is help creating the files that are used outside of the repository. These are the files that are not in the Maven repository to create the knowledge jar and call from the M2 directory on the localhost. I am wondering how to create the 1) Pom.xml file, 2) Java source file to test the decision table, 3) the folder structure, and 4) the other files that make this application work when building and running it with Maven from the command line.

             

            If this does not make any sense or it still is unclear what I am trying to describe please let me know.

             

            Respectfully,

             

            Kyle

            • 3. Re: How to create my own BRMS Decision Table Application
              Petr Široký Newbie

              Hello,

               

              >>>> I am wondering how to create the 1) Pom.xml

              Well this is standard Maven file, so unless you need something specific you can base yours on the one that comes with the quickstart jboss-brms-quickstarts/decision-table at 6.0.x · jboss-developer/jboss-brms-quickstarts · GitHub

              >>>> 2) Java source file to test the decision table

              This can also be found as a part of the quickstart: jboss-brms-quickstarts/DecisionTableTest.java at 6.0.x · jboss-developer/jboss-brms-quickstarts · GitHub

              >>>> 3) the folder structure

              No idea what you mean here. Creating folders is OS specific and I usually use "mkdir", but I doubt that this is what you are asking about...

              >>>> 4) the other files that make this application work when building and running it with Maven from the command line.

              The quickstart may not be perfect, but it should be self contained, so everything needed should be there. If it is not, please us know so we can eventually fix it.


              Thanks,

              Petr

              • 4. Re: How to create my own BRMS Decision Table Application
                Kyle Smith Newbie

                Petr,

                 

                I am not sure if you completely understand me. This is tough to explain. I am not the best communicator. After completing some of the examples for the brms I want to take another step and create my own project from the ground up. Simply downloading source code, cloning repositories, building kjars, and executing the program through a predefined Maven command will only get me so far. I want to make everything in the project and run it with Maven or by double-clicking on an executable jar file.

                 

                Where I am Now

                I have created my own project and a repository for it as well as created some java source files through the data modeler. I also created a decision table that calls the objects declared in the Java source files created through the data modeler. This even validates and does not show any warnings much less errors. What I am trying to do now, going forward, is to create the other things necessary to run this with Maven. Looking at the example it requires some type of folder structure that mirrors the folder structure created in JBoss BRMS, it requires a pom.xml file, maybe a settings.xml file, and possibly other components.

                 

                What I Need

                I need to figure out how to create my own 1) folder structure, 2) java source file that uses the knowledge is everything (KIE) stuff, 3) pom.xml file, and 4) a settings.xml file.

                 

                Does this make more sense?

                 

                Thank-you for the help Petr and responding to my posts. I am surprised the forum is not more active.

                 

                Sincerely,

                 

                Kyle Smith

                • 5. Re: How to create my own BRMS Decision Table Application
                  Kyle Smith Newbie

                  Petr,

                   

                  I actually figured out what I was trying to figure out on my own!

                   

                  What I Did

                  I made a directory structure inside a folder on my desktop that basically mirrors the directory structure in the JBoss BRMS application for the kjar I created using a Decision Table and an object I created with the Data Modeler. From here I edited the pom.xml file to find this new kjar in the M2 repository. I altered the Maven command to call this new BRMS KModule Dependency. Then I modified the java source test program to instantiate the object created with the data modeler and run some unit tests as before with the example for the decision table. I made sure to pass this created object to the kSession.execute() method in order to execute the rules in the decision table. This is a high-level and sort low-level view of what I did to build my own project based on the decision-table example on jboss.org.

                   

                  Thank-you for your help Petr. I appreciate the feedback on my post.

                   

                  Respectfully,

                   

                  Kyle