Text Interpolation in OpenRules

Many popular languages (e.g. Angular or Mustache) use text interpolation to incorporate dynamic string values into the text. OpenRules Decision Manager Release 8.2.1 gives our customers an option to use text interpolation by putting text decision variables in the double curly braces {{ and }}.  For example, see how it’s being used in the standard sample project “PatientTherapy”:

The same text expression can be presented using traditional text concatenation:

Our customers like text concatenation as it allows them to use variable names like “Recommended Medication” or “Drug Interaction Warning” without any special indicators around them. However, the necessity to put quotations around text constants and pluses for concatenation makes it look more like programming and provokes errors. I am sure our customers will appreciate that now they have more choices and will use text interpolation whenever appropriate. Probably DMN may consider to add it to the standard as well.

P.S. Of course, you also may use Java snippets that allow you to do programming inside Excel’s cells. Here is an example:

Of course, everybody would prefer one of two first decision tables to Java snippets. However, all 3 above tables will always produce “Drug Interaction Warning” even when it is “None”. So, if you don’t want to display the warning “None”, you may use adjust the Java snippet as follows:

 While this Java snippet solves the problem of hiding a non-existing warning, it hardly would be acceptable for business users.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.