/xavier-analytics

Primary LanguageJavaEclipse Public License 2.0EPL-2.0

Build Status codecov Quality Gate Status

xavier-analytics

How to create a new rule set for an agenda group with test

The procedure describes how to create a rule set for the agenda group FooAgendaGroup

  1. create a copy of SourceCosts.drl with name FooAgendaGroup.drl within the org.jboss.xavier.analytics.rules package
  2. in the FooAgendaGroup.drl file:
    1. change the agenda-group value to become FooAgendaGroup
    2. change the rule ID value to something like FooAgendaGroupRules (i.e. rule "FooAgendaGroupRules")
  3. create a copy of SourceCostsTest.java with name FooAgendaGroupTest.java within the org.jboss.xavier.analytics.test package
    1. change the constructor to reference the FooAgendaGroup.drl file instead of SourceCosts.drl (i.e. super("/org/jboss/xavier/analytics/rules/FooAgendaGroup.drl", ResourceType.DRL);)
    2. change the agendaGroup to reference the FooAgendaGroup agenda group (i.e. facts.put("agendaGroup", "FooAgendaGroup");)
  4. run the mvn -gs ./configuration/settings.xml test -Dtest=FooAgendaGroupTest to check that everything works fine

Now you have a working rule set with a test and you can start developing the rules keeping updated the test.

How to interact locally with OKD

  1. Follow the "Installation" procedure from xavier-integration project with one difference, use your own fork URL (e.g. https://github.com/mrizzi/xavier-analytics.git) instead of using https://github.com/project-xavier/xavier-analytics.git in the Decision Manager section
  2. go to Settings page in Business Central project
  3. copy the ssh URL (e.g. ssh://analytics-rhdmcentr-2-9ws6w:8001/MySpace/xavier-analytics)
  4. from your local terminal, login to the local OKD instance as developer and switch to use the migration analytics project
  5. oc port-forward oc get pod | grep "^analytics-rhdmcentr" | awk '{print $1}'`` 8001:8001
  6. from your xavier-analytics project root folder, execute git remote add remote-dm ssh://adminUser@localhost:8001/MySpace/xavier-analytics replacing the remote host's name (e.g. analytics-rhdmcentr-2-9ws6w) with localhost
  7. retrieve the code from Decision Manager Business Central using git pull remote-dm MIGENG-45

Known issues

Business Central project deployment

When deploying the latest master in Business Central, it could fail due to a missing dependency. To solve the issue:

  1. go to the Settings tab in Business Central main project page
  2. select Dependencies from left menu
  3. add the dependency:
    1. Group ID org.mockito
    2. Artifact ID mockito-core
    3. Version 2.28.2
  4. save it (if it complains for the project name, change it to Xavier-Analytics in General Settings)

Now it will be safe the Build & Install and Deploy the project.