A preprocessor replaces parts of a rule body during execution in order to ease development, have dynamic rules or to  facilitate a more secure execution.

Business Object Notation

We'll be using the following Business Object Model for this explanation.

NameExampleDescription
Business Object<%=Table("Customer")%>Business objects get mapped to tables in the database during deployment. Replaces the tag with the correct table name.
Attribute<%=Column("Customer","Phone")%>Attributes gets mapped as columns in tables in the database during deployment. Replaces the tag with the correct column name.
One-to-Many Relationship Key<%=Key("Customer","CustomerOrder")%>One-to-many relationships create foreign keys in accompanying tables during deployment. Replaces the tag with the correct column name of the foreign ID.
Many-to-Many Primary Key<%=Key("Order","OrderProduct","Entity")%>Many-to-many relationships creates an linking table between two business objects. Replaces the tag with the correct primary key of the Order table that is used by the linking table.
Many-to-Many Foreign Key<%=Key("Order","OrderProduct","Association")%>Many-to-many relationships creates an linking table between two business objects. Replaces the tag with the correct foreign key in the linking table that links to the Order.
Many-to-Many Linking Table<%=Table("OrderProduct")%>Many-to-many relationships creates an linking table between two business objects. Replaces the tag with the correct linking table name.

Placeholders

Unique identifier

NameExampleJavaScript EquivalentDescription
 @TOKEN_ACCESSSUBJECTS@ List of all roles, access subject, the user is assigned to in the runtime environment the current user is logged into. Comma separated.
 @TOKEN_ALLACCESSSUBJECTS@ @TOKEN_ACCESSSUBJECTS@ + User Access Subject on user + access subjects of groups. Comma separated.
Environment Domain ID@TOKEN_DOMAIN@ d
 @TOKEN_GROUPACCESSSUBJECTS@ Replaces the tag with all the groups the current user is part of, comma separated. access subjects
 @TOKEN_SYSTEMDOMAIN@ The domain
 @TOKEN_SYSTEMDOMAINUSER@ name of schema tenant
User ID@TOKEN_USERACCESSSUBJECT@ The current user's Access Subject Code
Sorting column@SORT@ If you are using a Grid on a page, then the SORT and DIR are automatically passed when you click on a column's header. Replaced with the column's schema name
 @DESC@  
Sort order@DIR@ If you are using a Grid on a page, then the SORT and DIR are automatically passed when you click on a column's header. Replaced with the sort direction, either ASC or DESC.

Functional Tags

NameExampleDescription
Sorting<%=Sort("@SORT@","@DESC@")%>Replaces with an ORDER BY @SORT@ @DESC@ if both SORT and DESC are passed to the rule
Search<%=Filter(OPTION=:Name_OPTION, VALUE1=:Name_VALUE1, VALUE2=:Name_VALUE2, FIELD=col_Name)%>

Replaces with a the correct WHERE clause if OPTION is present and a correct VALUE1 and VALUE2. If OPTION is missing or not enough information to make the statement, it ignores that tag.

Schema data type: Text or Large Text
OPTIONDescription
LIKEReplaces with AND COL_NAME LIKE :Name_VALUE1
EQUALReplaces with AND COL_NAME = :Name_VALUE1
Schema data type: Date
OPTIONDescription
BETWEEN

If VALUE1 is present then replaces with AND COL_DEADLINE >= :Deadline_VALUE1
If VALUE2 is present than replaces with AND COL_DEADLINE <= :Deadline_VALUE2
If both VALUE1 and VALUE2, then combines them. 

Schema data type: Integer/Number
OPTIONDescription
EQUALReplaces with AND COL_COST = :Cost_VALUE1
GREATERReplaces with AND COL_COST >= :Cost_VALUE1
LESSReplaces with AND COL_COST <= :Cost_VALUE1

Comma separated VALUE1 and VALUE2 parameters

You can create OR statements by sending values as comma separated in the VALUE1 and VALUE2 parameters. For example:

OPTIONVALUE1Result
EQUAL200, 300, 400AND (COL_COST = 100 OR COL_COST = 200 OR COL_COST = 300)
LIKEJoh, KatAND (COL_NAME LIKE "Joh" OR COL_NAME LIKE "Kat")
Not Null<%= IfNotNull(":NewCost", "AND (COL_COST = :NewCost)") %>Replaces with the second

 

 

  • No labels