Skip to main content



Business Language Template Reference

InRule® includes a Standard Template Catalog that allows for Business Language entry of conditions, expressions, and actions. Rules may be entered "Topic First" (starting with the current context) or "Template First" — picking a template then filling it out.

Available templates are displayed based on context as a rule is authored. The user is prompted to define necessary fields or tokens, and is presented with a menu of appropriate choices.

The following categories contain all function templates for authoring expressions in Language Rules.

References

Collection Templates

Collection templates perform lookup and aggregate functions over a collection. They can filter out specific collection members to operate over.

Template nameTemplate formatReturn type
lookuplookup <expression> from <collection> where <filter> otherwise use <default>type of evaluated expression
member numbe rmember number <index> in <collection>entity reference
the average ofthe average of <numeric expression> in <collection>integer or decimal
the first matching member fromthe first matching member from <collection> where <filter expression>entity reference
the first member inthe first member in <collection>entity reference
the last member inthe last member in <collection>entity reference
the number ofthe number of <collection>integer
any members exist inany members exist in <collection> filtered by <filter expression>Boolean
no members exist inno members exist in <collection> filtered by <filter expression>Boolean
the total ofthe total of <numeric expression> in <collection>integer or decimal
the minimum ofthe minimum of <numeric expression> in <collection>integer or decimal
the maximum ofthe maximum of <numeric expression> in <collection>integer or decimal
get first valuethe value of <field> on the first member in <collection> otherwise use <default>field value
get last valuethe value of <field> on the last member in <collection> otherwise use <default>field value
the value of a member at an indexthe value of <field> on member number <integer> from <collection> otherwise use <default>field value

Comparison Templates

Comparison functions evaluate to Boolean by comparing values to the left and right of the operator.

FunctionTemplate formatReturn type
is among<field> is among <value>, <value>, [add value] *List of values of same data type as left side of comparisonBoolean
is not among<field> is not among <value>, <value>, [add value] *List of values of same data type as left side of comparisonBoolean
is at leas<numeric> is at least <numeric expression>Boolean
is at most<numeric> is at most <numeric expression>Boolean
is between<date or numeric> is between <date or numeric expression> and <date or numeric expression>Boolean
is not between<date or numeric> is not between <date or numeric expression> and <date numeric expression>Boolean
is equal to<Field> is equal to <value> *value of same data type as left side of comparisonBoolean
is not equal to<field> is not equal to <value> *value of same data type as left side of comparisonBoolean
is empty<field> is emptyBoolean
is not empty<field> is not emptyBoolean
is a number<value> is a numberBoolean
is greater than<numeric> is greater than <numeric expression>Boolean
is greater than or equal to<numeric> is greater than or equal to <numeric expressionBoolean
is less than<numeric> is less than <numeric expression>Boolean
is less than or equal to<numeric> is less than or equal to <numeric expression>Boolean
is after<date> is after <date expression>Boolean
is on or after<date> is on or after <date expression>Boolean
is not after<date> is not after <date expression>Boolean
is before<date> is before <date expression>Boolean
is not before<date> is not before <date expression>Boolean
is on or before<date> is on or before <date expression>Boolean
is null or empty<field> is null or emptyBoolean
is not null or empty<field> is not null or emptyBoolean
is true<Boolean> is trueBoolean
is false< Boolean> is falseBoolean

Conditional Templates

Conditional templates evaluate the Boolean expressions in a list. Conditional templates are extremely useful for grouping multiple rule conditions and make it easy to add new conditions.

Template nameTemplate formatReturn type
allall of the following are true (or false)Boolean
anyany of the following are true (or false)Boolean
at leastat least <number> of the following are true (or false)Boolean
at mostat most <number> of the following are true (or false)Boolean
exactlyexactly <integer> of the following are true (or false)Boolean
more thanmore than <number> of the following are true (or false)Boolean
less thanless than <number> of the following are true (or false)Boolean
other thanother than <number> of the following are true (or false)Boolean
nonenone of the following are true (or false)Boolean

Append condition templates allow the rule conditions to be appended with other conditions.

andand <condition>na
oror <condition>na

Conversion Templates

Conversion templates are used to convert one datatype to another. To use a conversion template, the user must first select convert from the menu.

Template nameTemplate formatReturn type
to upper caseconvert <value> to uppercasetext
to lower caseconvert <value> to lowercasetext
to proper caseconvert <value> to proper cas etext
to Booleanconvert <value> to BooleanBoolean
to integerconvert <value> to integerinteger
to dateconvert <value> to datedate
to datetimeconvert <value> to datetimedatetime
to timeconvert <value> to timetime
to numberconvert <value> to numbernumber
to inner XMLconvert <value> to inner XMLXML
to textconvert <value> to texttext

Date Templates

Date templates are used to manipulate dates and datetime fields.

Template nameTemplate formatReturn type
current daycurrent dayinteger
current hourcurrent hourinteger
current millisecondcurrent millisecondinteger
current minutecurrent minuteinteger
current monthcurrent monthinteger
current secondcurrent secondinteger
current yearcurrent yearinteger
day fromday from <date or datetime>integer
day of the month fromday of the month from <date or datetime>integer
day of the week fromday of the week from <date or datetime>integer
day of the year fromday of the year from <date or datetime>integer
days betweendays between <date or datetime> and <date or datetime>integer
weekdays betweenweekdays between <date or datetime> and <date or datetime>integer
get local datetime fromget local datetime from <datetime>datetime value having a local kind
get unspecified datetime fromget unspecified date time from <datetime>datetime value having a unspecified kind
get UTC datetime fromget UTC datetime from <datetime>datetime value having a UTC kind
hours fromhour from < datetime>integer
hours betweenhours between <datetime> and <datetime>integer
millisecond frommillisecond from <datetime>integer
milliseconds betweenmilliseconds between <datetime> and <datetime>integer
minute fromminute from < datetime>integer
minutes betweenminutes between <datetime> and <datetime>integer
month frommonth from <date or datetime>integer
months betweenmonths between <date or datetime> and <date or datetime>integer
nownowdatetime
number of days in the month fromnumber of days in the month from <date>integer
number of days in the year fromnumber of days in the year frominteger
second fromsecond from < datetime>integer
seconds betweenseconds between <datetime> and <datetime>integer
todaytodaydate
tomorrowtomorrowdate
year fromyear from <date>integer
years betweenyears between <date> and <date>integer
yesterdayyesterdaydate
is a leap year<datetime> is a leap yearBoolean
is a local datetime<datetime> is a local datetimeBoolean
is a week day<datetime> is a week dayBoolean
is an unspecified datetime<datetime> is an unspecified datetimeBoolean
is an UTC datetime<datetime> is an UTC datetimeBoolean
is on a week end<datetime> is on a week endBoolean
minus<datetime> minus <timespan>-
plus<datetime> plus <timespan>-
plus<date or datetime> plus <integer> weekdaysdate or datetime
is a date<text> is a dateBoolean
is a datetime<text> is a datetimeBoolean

Math Templates

Math templates are used to operate over numerical values and handle complex math operations.

Template nameTemplate formatReturn type
% of<number> % of <number>number
divided by<number> divided by <number>number
minus<number> minus <number>number
modulus<number> modulus <number>integer
multiplied by<number> multiplied by <number>number
plus<number> plus <number>number
raised to<number> raised to <number>number
rounded to<number> rounded to <digits> decimal placesnumber
rounded up to<number> rounded up to <digits> decimal placesnumber
rounded down to<number> rounded down to <digits> decimal placesnumber
rounded with bankers rounding to<number> rounded with bankers rounding to <digits> decimal placesnumber
squared<number> squarednumber
absolute value ofabsolute value of <value>number
largest oflargest of <add>number
smallest ofsmallest of <add>number
square root ofsquare root of <value>number
the natural log base e raised tothe natural log base e raised to <number>number
the natural log ofthe natural log of <number>number
the number of digits before the decimal point inthe number of digits before the decimal point in <number>integer
the number of digits after the decimal point inthe number of digits after the decimal point in <number>integer
the number of digits inthe number of digits in <number>integer

Time-Value Templates

Time-Value templates used for common financial operations.

Template nameTemplate formatReturn type
future value ofthe future value of <present lump sum amount> using rate <interest rate> over <number of periods>number
interest rate overthe interest rate over <number of periods> for present value of <present lump sum amount> and future value of <future lump sum amount>number
payment forthe payment for <present lump sum amount> using rate <interest rate> over <number of periods>number
present value ofpresent value of <future lump sum amount> using rate <interest rate> over <number of periods>number

Text Templates

Text templates are used to lookup or modify text values.

Template nameTemplate forma tReturn type
matches regular expression<text> matches regular expression <regex pattern>Boolean
matches wild card expression<text> matches regular expression <wild card pattern>Boolean
with no leading or trailing spaces<text> with no leading or trailing spacestext
with whitespace removed<text> with whitespace removedtext
contains whitespace<text> contains whitespaceBoolean
contains<text> contains <text>Boolean
starts with<text> starts with <text>Boolean
ends with<text> ends with <text>Boolean
the leftthe left <number> of characters in <text>text
the rightthe right <number> of characters in <text>text
the middlethe middle <number> of characters in <text> starting with character <number>text
length ofthe length of <text>text
formatted as currency<number> formatted as currencytext
formatted as hexadecimal<number> formatted as Hexadecimaltext
formatted as number<number> formatted as numbertext
formatted as percent<number> formatted as percenttext
formatted as scientific<number> formatted as scientifictext
combinecombine <value> with <value>text
concatenateconcatenate <values> or use the & operator: <text> & <text>text
formatformat <date> as <format> (Note: templates for <format> are long date, long datetime, long time, short date, short datetime, short time, year month)text
get position ofget position of <search text> in <target text>number
replacereplace <old text> in <text> with <new text>text
replace patternreplace <regex pattern> in <text> with <text>text
select text fromselect text from <text> which matches regular expression <regex pattern>text

Value List Templates

Value List templates are used to check if a Value is found in the Value List.

Template nameTemplate formatReturn type
has a value of<field> has a value of <add list value>Boolean
does not have a value of<field> does not have a value of <add list value>Boolean
is in<field> is in <value list>Boolean
the display value from<field> the display value from <value list>text
create list ofcreate list of <field> in <collection>list
with a new value list<values>list
from existing value list<value list> with <values>list

Expression Designer Templates

The expression designer template allows users to build complex expressions using syntax rule functions. This feature enables the user to combine syntax rules with business language rules. This can be very useful for managing complex parenthetical formulas or functions that are not supported as business language templates.

Template nameTemplate formatReturn type
design expressionexpression valuena
safe expression<expression> otherwise use <default>expression value

Example:

set Payment Summary Monthly Payment to Round((((LoanInfo.Principal * monthlyRate) / (1 - ((1 + monthlyRate) ^ (LoanInfo.TermInMonths * -1)))) * 100) / 100, 2)

Logical Templates

Logical templates may be used to influence the evaluation of the conditional templates.

Template nameTemplate formatReturn type
exactly one ofexactly one of <enter condition>Boolean
notnot ...Boolean

XML Templates

XML template is used to lookup data from an XML file.

Template nameTemplate formatTemplate format
lookuplookup<XPath query expression>text

Validity Templates

Validity templates are used to check the validity of a Field or Entity, which may have been set from Constraints or the Mark Field As Invalid / Set Field Invalid action.

Template nameTemplate formatTemplate format
is not valid<field> is not validBoolean
is valid<field> is validBoolean

Action Templates

Action templates are used to trigger actions. There is no return type.

Template nameTemplate format
activate rule setdeactivate rule set <rule set>
add collection memberlaunches syntax editor
copy collectionlaunches syntax editor
deactivate rule setdeactivate rule set <rule set>
execute database querylaunches syntax editor
execute decision tablelaunches syntax editor
execute rule setexecute rule set <rule set> w/ Parameterized Rule Set: execute rule set <rule set> using (ParamName = <value>)
execute REST servicelaunches syntax editor
execute web servicelaunches syntax editor
execute xpath querylaunches syntax editor
fire notificationfire notification <message> with the following settingsallow multiple notifications as notification type <warning
halt all rule executionhalt all rule execution and log message <message text>
halt rule sethalt rule set and log message <message text>
mark field as invalid*mark <field> invalid and display message <text message>
raise eventlaunches syntax editor
refresh fieldsrefresh fields <add field>
send e-maillaunches syntax editor
set the value to a fieldset <field> to <value>
sort collectionlaunches syntax editor

* The "mark field as invalid" Business Language template is the equivalent of the Syntax action for Set Field Invalid.

Back To Top