Support for contains operator via external rules java api

19 views
Skip to first unread message

Anup Agrawal

unread,
Aug 31, 2018, 11:03:25 AM8/31/18
to OpenRules
Hi There,

I need some help in defining similar to contain operator for list of string via java external rules api. we are adding rules via external rules using decisiontabletemplate. It works well with equal or not equal operator. How can we support when we have to asset of a value is contains in list of string?

Thanks,

Anup

openru...@gmail.com

unread,
Aug 31, 2018, 11:07:06 AM8/31/18
to open...@googlegroups.com

Hi Anup,

 

You can do it exactly in the same way as you would do it in Excel by listing the content of each row cell-by-cell from left to right. For example, in the project “DecisionExternalsRules” in “openrule.decisions” you may write:

 

externalRules.addRuleTable(

"DefineGreeting",   //table name

       "DecisionTableTemplate", //template name

       new String[] { "Condition", "Then" }, // labels

       new String[] { "Current Hour", "Result" }, // descriptions/variables

       new String[][] {    //rules

              new String[] {"Within","(0..11]","Good Morning"},

              new String[] {"Within","(11..17]","Good Afternoon"},

              new String[] {"Within","(18..21]","Good Evening"},

              new String[] {"Within","(21..24]","Good Night"}

       }

);

 

Let us know if you still have any issues.

 

OpenRules Support

--
You received this message because you are subscribed to the Google Groups "OpenRules" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openrules+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Anup Agrawal

unread,
Aug 31, 2018, 4:17:45 PM8/31/18
to open...@googlegroups.com
Hi,

Thanks so much for quick response. Its working fine.

Regards
Anup
Reply all
Reply to author
Forward
0 new messages