Tested on JBoss BRMS v6.2
- copy .niogit from the support folder to EAP_HOME/bin
- Follow the instructions in the following knowledge base article
- Sample properties
<property name="org.kie.server.user" value="brmsAdmin"></property>
<property name="org.kie.server.pwd" value="passw0rd!"></property>
<property name="org.kie.server.location" value="http://localhost:8080/kie-server/services/rest/server"></property>
<property name="org.kie.server.controller" value="http://localhost:8080/business-central/rest/controller"></property>
<property name="org.kie.server.controller.user" value="kieserver"></property>
<property name="org.kie.server.controller.pwd" value="kieserver1!"></property>
<property name="org.jbpm.server.ext.disabled" value="true"></property>
<property name="org.kie.server.id" value="local-server"></property>
- In your EAP configuration EAP_HOME/standalone/configuration/application-roles.properties
- Your user must have the "kie-server" role
- Build & Deploy specific rule projects
- example / Examples / brms
- example / Examples / iteration
- From Business Central
- Click the "+" to the right of your new "local-server", this will create the container
- Name: [container_name]
- Valid GAV (get this from the Project Editor of your project) / or use the search mechanism, search for: [gav]
- Click the radio button of your new container and click Start on the right
- example / Examples / brms
- Rule execution server container settings
- Group Name: com.redhat.test
- Artifact Id: brms
- Version: 1.0
- example / Examples / iteration
- Rule execution server container settings
- Group Name: com.redhat.test
- Artifact Id: iteration
- Version: 1.0
- Use the project brms-rule-service - RuleExecutionXmlPayloadGen POJO to generate your payload
- https://github.com/kenthua/brms-example/blob/master/project/brms-rule-service/README.md
- Call out to the new container and see what response you get back
- Endpoint / URL: http://localhost:8080/kie-server/services/rest/server/containers/instances/[container_name]
- REST Info
- HTTP POST
- Header: Content-Type = application/xml
- Header: X-KIE-ContentType: XSTREAM
- XML Request Payload example (see document end for specific use cases)
NOT TESTED FOR BRMS 6.2
- Build the brms-demo project as a war and add to the EAP_HOME/standalone/deployments folder
- Build & Deploy rule project
- BRMSServiceImpl has a main method, just run the class by itself via JBDS
- OR
- brms-demo project -> mvn package
- copy the .war in the target folder (EAP_HOME/standalone/deployments)
- http://localhost:8080/brms-demo/ListenServlet
- Listen Servlet initializes test data
- BRMSServiceImpl calls for a ksession, copies data from model to BRMS fact
- Depends kmodule/jar being generated by JBoss BRMS for fact model
- Once executed will run through rules written for the data
- Don't expect anything in return, watch the EAP system out (server.log) for messages of rules being executed.
<batch-execution lookup="defaultKieSession">
<insert out-identifier="customer-identifier" return-object="true" entry-point="DEFAULT">
<com.redhat.test.brms.Customer>
<accountCount>0</accountCount>
<firstName>John</firstName>
<lastName>Doe</lastName>
</com.redhat.test.brms.Customer>
</insert>
<insert out-identifier="account1-identifier" return-object="true" entry-point="DEFAULT">
<com.redhat.test.brms.Account>
<balance>100.0</balance>
<customer reference="../../../insert/com.redhat.test.brms.Customer"/>
<number>C-12345</number>
<type>CHECKING</type>
</com.redhat.test.brms.Account>
</insert>
<insert out-identifier="account2-identifier" return-object="true" entry-point="DEFAULT">
<com.redhat.test.brms.Account>
<balance>200.0</balance>
<customer reference="../../../insert/com.redhat.test.brms.Customer"/>
<number>C-67890</number>
<type>CHECKING</type>
</com.redhat.test.brms.Account>
</insert>
<fire-all-rules out-identifier="fire-identifier"/>
</batch-execution>
<batch-execution lookup="defaultKieSession">
<insert out-identifier="insert-identifier" return-object="true" entry-point="DEFAULT">
<com.redhat.test.iteration.Customer>
<accounts>
<com.redhat.test.iteration.Account>
<balance>10.0</balance>
<type>CHECKING</type>
</com.redhat.test.iteration.Account>
<com.redhat.test.iteration.Account>
<balance>20.0</balance>
<type>CHECKING</type>
</com.redhat.test.iteration.Account>
</accounts>
<firstName>John</firstName>
<id>1</id>
</com.redhat.test.iteration.Customer>
</insert>
<fire-all-rules out-identifier="fire-identifier"/>
</batch-execution>