Decision Intelligence Platform

Release Notes 10.0

July 20, 2023. OpenRules Release 10.0 is a major release that essentially changes the internal structure of the generated Java code. It was necessary to support newly introduced OpenRules features such as dynamically defined decision variables with the qualifier “Of”, advanced “for-each” loops, different versions of SpringBoot 2 and 3, JDKs from versions 1.8, 11, and 17+ with Jakarta.

Composing Decision Variable Names using “OF” or “::”. In previous versions of OpenRules ALL decision variables used in any decision or test tables were supposed to be defined in the glossary. Even temporary decision variables used only within a certain decision table needed to be exposed in a glossary. Release 10.0 brings more flexibility by letting decision tables to use names like “State of Customer’s Location” without declaring them in Glossary. For example, previously sample project “HelloNestedLocation” used this Glossary:

To produce a greeting like: “Good Afternoon, Ms. Kaye in CA!”, a user could create the following table:

Now a user doesn’t need the line “State of Customer’s Location” in the above Glossary at all. More than that, to produce “Good Afternoon, Ms. Kaye in Los Angeles, CA!” s/he may write a more precise decision table without any changes in the Glossary:

Instead of qualifier “of” you may use a special divider “::“, e.g. in the above tables instead of “City of Customer’s Location” you may write “Customer’s Location :: City“.

The corresponding test data may be defined in the following table:

The qualifier “of” and divider “::” may be used multiple times in the decision variable names when you have multiple nested objects, e.g.

“Salary of Manager of Department” or “Department :: Manager :: Salary”. See more details in the new sample project OpenRulesSamples/DepartmentsEmployeesLocations.

The qualifier “of” is case insensitive, so you may use “OF” or “Of” as well.

Reminder. The names of decision variables should start with a letter or underscore and can contain only letters, digits, spaces, underscores, hyphens, and apostrophes (no other special characters).

Using Local Variables inside Loops. It is not necessary anymore to define variables used in “for each” loops inside the global Glossary. For example, the standard sample project “ICD10” uses two nested loops over the same array of strings “Diagnoses”:

The String variables Diagnosis1 and Diagnosis2 are local for this decision table and may not be defined in the glossary anymore:

Another example “DuplicateCharges” uses two nested loops over the same array of objects of the type “Charge”:

Here is how these nested loops are shown in OpenRules Debugger when you executed them one by one:

In the column “Variable” on the right you can see that the current rule deals with Charge1 that is actually Bill Charges[1] and Charge2 that is Bill Charges[3] while their current values are shown in the column “Value”. It really helps to understand how complex nested loops actually work.

Again, we don’t need to define local objects Charge1 and Charge 2 in the glossary:

More than that, we may freely refer to Product of Charge1 or Price of Charge 2 without defining them in the Glossary.

Support for SpringBoot 3 and JDK 17+. Based on multiple requests, we now allow our customers to build OpenRules-based microservices using SpringBoot, both version 2.x and SpringBoot 3.x. SpringBoot-3 is backward incompatible with SpringBoot-2 and requires Java 17+ and “jakarta” instead of “javax“.

OpenRules Release 10.0 maintains backward compatibility by automatically recognizing which JDK and SprinBoot versions are being used and generating the proper Java code. The standard installation OpenRulesDecisionManager 10.0 allows our customers to choose the preferred version of SpringBoot (if any) using the following sample projects:

  • VacationDaysSpringBoot (for SpringBoot 3.1.0)
  • VacationDaysSpringBoot2 (for the old SpringBoot 2.7.13)
  • VacationDaysSpringBootSecure (for SpringBoot 3.1.0)
  • VacationDaysSpringBootSecure2 (for the old SpringBoot 2.7.13)

See an implementation example of “SecurityConfig.java” in the projects “VacationDaysSpringBootSecure” and “VacationDaysSpringBootSecure2”.

Thus, with release 10.* OpenRules supports all JDK starting from 1.8 and higher, and all SpringBoot versions.

Option “Ignore Case” for String Conditions. We added the option “[Ignore Case]” to all comparison operators that deal with strings. For instance, you may use this condition

to check if the Employee Name is one of the elements of the array “Smith, Brown, Doe, Kane”. This condition will be satisfied even if you wrote “smith, brown, doe, kane”.

Now you also can control case sensitivity for ALL string comparison operators. Release 10.0 supports the optional property “model.ignoreCase” with values false or true that you may place into the Environment table or in the file “project.properties”. If you define model.ignoreCase=true then all string comparison operators will become case insensitive. However, if you use the operator “Is One Of [Case Sensitive]” it will override this global setting. Read more in the User Manual pp. 40, 49.

Simple Business Concepts. Release 10.0 allows a user to use “simple” business concepts expressed using basic types such as strings or numbers. From now on, there is no need to define these simple attributes inside artificial business concepts as the concepts themselves can play a role of attributes. For example, traditional glossary for the sample “VacationDays” and the corresponding JSON interface look as below:

Now you may move attributes to the column for “Business Concept”. Then the corresponding JSON interface will look as below:

This glossary is especially convenient when you already have a JSON interface that uses many attributes on the top-level not being embedded in any high-level object. The standard installation “OpenRulesSamples” now includes project HelloJson that demonstrates these features.

Simplified Test Cases for Arrays and Lists. Now you don’t need to use Java snippets starting with “:=” in you DecisionData and DecisionTest tables and refer to data arrays directly by their names. For example, if you define the array “companies” in a table of the type DecisionData, you may refer to the elements of this array in your DecisionTest table as below:

Improved Build Time Error Diagnostics. The release 10.0 catches more possible errors in decision model during the build time and provides business-friendlier error diagnostics.

Updated Dependencies and Documentation

As usual, we updated all OpenRules dependencies using an automated vulnerability check from the NVD. We also updated User Manual for Business and User Manual for Developers.

Latest Patches.

  • The release 10.0.1 fixed an error in RuleDB for complex queries using Oracle.
  • The release 10.0.2 fixed an error related to handling of JSON batch records.