All posts by mrules-admin

Version 2.7.0 of MRules is out

We are proud to announce that the version 2.7.0 of MRules is released.

In addition to several fixes and improvement, this version introduces MRules support of JDK up to version 15.

Also, Java 1.6 has been desupported.

Therefore, as of version 2.7.0, MRules supports all versions of Java from 1.7 to 15.

The release notes provides details on all modifications.

Version 2.6.0 of MRules is out

We are proud to announce that the version 2.6.0 of MRules is released.

In addition to several fixes and improvement, this version introduces a new major feature.

MRules now provides out of the box everything needed to easily monitor and collect statistics about rulesets life cycle (execution times, failures, etc …)

This page provides information on this new feature.

The release notes provides details on all modifications.

The web site is currently being updated with the documentation.

How-To #5: Execute Health Insurance Demo

In this tutorial, we’ll see how to import a demo in your favourite IDE, launch it and see results of modifications applied on rules.

We’ll be using the health insurance demo, but the import steps are the same for the other ones.

First, download the archive JAR file from our web site:
 
 
 
Then, extract the files and import them in Eclipse, by opening the “Import” dialog. Select “Existing Maven Projects”, then click “Next”:
 
 
Select the directory where you extracted the sources, all the maven modules are detected and will be imported:
 
 
After what you will see this in the Eclipse Project Explorer:
 
 
 
Please import the licence file, for instance in the common main resources:
 
 
The IDE will download the dependencies and compile everything for you. Just be careful if you are behind a proxy, you should configure Maven to use it.
 
When all is compiled, then start the app. For instance, I will start the batch test Spring Boot app:
 
 
Then you can follow the startup in the console. You should get something like this:
 
 
This log shows that first run builds the ruleset. Next logs will show that it’s found in cache and not rebuilt.
 
Then, open the following url in a browser: http://locahost:8080
 
 
The current ruleset configuration for the batch is loaded. Modify the config like shown above.
Save the config using the button on the top and then look the console: the new configuration is directly taken into account.
 
 
The 2nd and 6th prices have changed accordingly to the new rules configuration.
 
 
Finally, if you have launched the “Batch Test” module, you can have a look at the MRules JMX Beans and the MRules monitoring extension results.
 
First, to see the MBeans, open Java Mission Control (jmc), select your local JVM and open the MBeans Browser.
You should find the “com.massa.mrules” domain, containing one MBean for the ruleset used in the demo module :
 
 
Then, you to the metrics scraping page : http://locahost:8080/actuator/prometheus which should outputs metrics in Open Metrics format, as follows, amongst other stats generated by Spring and Micrometer :
 
# HELP mrules_compilations_last_date RuleSet last compilation date
# TYPE mrules_compilations_last_date gauge
mrules_compilations_last_date{name="2019 Health Pricing",type="RuleSet",} 1.600812930481E12
# HELP mrules_optimizations_last_date RuleSet last optimization date
# TYPE mrules_optimizations_last_date gauge
mrules_optimizations_last_date{name="2019 Health Pricing",type="RuleSet",} 1.600812930505E12
# HELP mrules_compilations_failures RuleSet compilation failures
# TYPE mrules_compilations_failures gauge
mrules_compilations_failures{name="2019 Health Pricing",type="RuleSet",} 0.0
# HELP mrules_optimizations_last_time RuleSet last optimization time
# TYPE mrules_optimizations_last_time gauge
mrules_optimizations_last_time{name="2019 Health Pricing",type="RuleSet",} 2.40872E7
# HELP mrules_optimizations RuleSet optimization total
# TYPE mrules_optimizations gauge
mrules_optimizations{name="2019 Health Pricing",type="RuleSet",} 2.0
# HELP mrules_optimizations_time RuleSet optimization total time
# TYPE mrules_optimizations_time gauge
mrules_optimizations_time{name="2019 Health Pricing",type="RuleSet",} 6.5387726E7
# HELP mrules_optimizations_last_failure_date RuleSet last failed optimization date
# TYPE mrules_optimizations_last_failure_date gauge
mrules_optimizations_last_failure_date{name="2019 Health Pricing",type="RuleSet",} -1.0
# HELP mrules_compilations_time RuleSet compilation total time
# TYPE mrules_compilations_time gauge
mrules_compilations_time{name="2019 Health Pricing",type="RuleSet",} 5.8944502E7
# HELP mrules_executions_time RuleSet execution total time
# TYPE mrules_executions_time gauge
mrules_executions_time{name="2019 Health Pricing",type="RuleSet",} 1.75738057E8
# HELP mrules_optimizations_failures RuleSet optimization failures
# TYPE mrules_optimizations_failures gauge
mrules_optimizations_failures{name="2019 Health Pricing",type="RuleSet",} 0.0
# HELP mrules_compilations RuleSet compilation total
# TYPE mrules_compilations gauge
mrules_compilations{name="2019 Health Pricing",type="RuleSet",} 2.0
# HELP mrules_executions_failures RuleSet execution failures
# TYPE mrules_executions_failures gauge
mrules_executions_failures{name="2019 Health Pricing",type="RuleSet",} 147.0
# HELP mrules_executions_last_time RuleSet last execution time
# TYPE mrules_executions_last_time gauge
mrules_executions_last_time{name="2019 Health Pricing",type="RuleSet",} 215058.0
# HELP mrules_executions_last_date RuleSet last execution date
# TYPE mrules_executions_last_date gauge
mrules_executions_last_date{name="2019 Health Pricing",type="RuleSet",} 1.600813545031E12
# HELP mrules_compilations_last_time RuleSet last compilation time
# TYPE mrules_compilations_last_time gauge
mrules_compilations_last_time{name="2019 Health Pricing",type="RuleSet",} 1.3258079E7
# HELP mrules_executions RuleSet execution total
# TYPE mrules_executions gauge
mrules_executions{name="2019 Health Pricing",type="RuleSet",} 441.0
# HELP mrules_executions_last_failure_date RuleSet last failed execution date
# TYPE mrules_executions_last_failure_date gauge
mrules_executions_last_failure_date{name="2019 Health Pricing",type="RuleSet",} 1.60081354503E12
# HELP mrules_compilations_last_failure_date RuleSet last failed compilation date
# TYPE mrules_compilations_last_failure_date gauge
mrules_compilations_last_failure_date{name="2019 Health Pricing",type="RuleSet",} -1.0

We chose here to demonstrate how easy it is to expose metrics on how MRules behaves in your app and the export them to Prometheus. But lots of other collectors are also supported!

Don’t hesitate to change the metrics configuration in the code of the demo and to directly visualize the effects of the modifications.

Version 2.5.0 of MRules is out

We are proud to announce that the version 2.5.0 of MRules is released.

This version is mainly a technical release, but however brings some new features:

  • Improved Log interface to support Tinylog and Log4J directly (i.e. without slf4j or commons-logging).
  • Enriched rule engine grammar (with elseif for instance).
  • And of course, lots of internal improvements and optimizations.

The release notes provides details on all modifications.

The web site is currently being updated with the documentation of the new features.

Version 2.4.0 of MRules is out

We are proud to announce that the version 2.4.0 of MRules is released.

This version mainly adds:

  • Security management, currently allowing to allow or disallow external program execution and access to static fields or methods.
  • Big improvements on debug logs, more detailed.
  • New possibilities offered by the rule engine.
  • Compatibility improvements with JDK9+, last step before MRules is fully certified with these JDK in next release.

The release notes provides details on all modifications.

The web site is currently being updated with the documentation of the new features.

Version 2.3.0 of MRules is out

We are proud to announce that the version 2.3.0 of MRules is released.

This version mainly:

  • Adds a new demo, which demonstrates several features and use cases of MRules.
  • Changes the other demos packaging to be more practical.
  • Fixes some minor bugs on the rule engine and the DSL extension, that could bring issues depending on the environment.

The release notes provides details on all modifications.

Version 2.2.0 of MRules is out

We are proud to announce that the version 2.2.0 of MRules is released.

This version comes with some new features, among which:

  • Local Java Class or Package imports are now handled in rule sets, to ease the use of Java objects.
  • Static access for Fields and Methods have been added to the property framework.
  • The DSL engine has been enrich with new possibilities.
  • The Rule Set configuration DSL handles all these new features, and more (like raw string litterals, rule set properties configuration, Classes and Packages auto completion, …)

Lots of improvements and optimizations have been made to already existing features. Also, the DSL editor and specifically the autocompletion feature has been improved to be more accurate and intuitive.

Please note the breaking changes in the list of modifications:

  • AdvancedReader has been moved to another package: if you use it directly, you will have to update the code.
  • An order is now mandatory in ruleset DSL configuration file: imports, then configuration and then rules. You may have to update your rule set configurations.

The release notes provides details on all modifications.