i
Embedded Rules Detail
The properties of the detail are described below.
Origin
The value can be a form field, a conditional flow, or page elements.
Type:
It is the embedded rule type.
Possible values:
•OBLIGATORY: for the requirement of a form field.
•EDITION: for the edition of a form field.
•COND: for the validation of a form field.
•CALC: for a calculation rule of a form field.
•RULE_RELATION: for a relation to an advanced rule in a form field.
•VALUE_LIST_RELATION: for a relation to a value list in a form field.
•ENTITY_RELATION: for a relation to an entity in a form field.
Expression
The modeled rule expression is displayed.
Examples
Several examples of embedded rules are included below
Requirement
The project field is required if the newProject field and task are empty.
{ Origin: "project", Type: "OBLIGATORY", Expression: "Y(ISBLANK(newProject), ISBLANK(task))" }
Validation
The from field must be less than the date function().
{ Origin: "dtBegin", Type: "COND", Expression: "IF(from > date(), "Must be before or equal to today")" }
The hours field must be greater than 0 if the totalHours field is less than or equal to 0.
{ Origin: "hours", Type: "COND", Expression: "IF(totalHours <=0, "Must inform the number of hours")" }
If the Develop button is pressed, the assignedProgrammerCd field should be loaded.
{ Origin: “assignedProgrammerCd”, Type: "COND", Expression: "IF(AND(lastButtonPressed()=="Develop", ISBLANK(assignedProgrammerCd)), "Must enter a Programmer")" }
It is evaluated with an embedded rule if the owner is not white and with an advanced rule called ContainsCrmPermissions it is evaluated if it does not have a CRM license.
{ Origin: "", Type: "COND", Expression:
"IF(AND(NO(ISBLANK(owner)),NO(containsCrmPermissions( owner))),"The owner does not have CRM application permissions")" }
Calculation
Example of a calculation rule with an advanced rule. The autUser field obtains the authorizer by calling the following rule:
{ Origin: "autUser", Type: "CALC", Expression: "getAuthorizingUser(requestingUser)" }
10 days are added to the dateMondayWeek field.
{ Origin: “dateMondayWeek”, Type: "CALC", Expression: "addDays(startDate,10)" }
The totalEstimated field has the sum of the iterative lines.total.
{ Origin: ”totalEstimated”, Type: "CALC", Expression: "sum(rows.total)" }
Calculation in an iterative field of the form
Performs the calculation for the first occurrence of the iterative of the rows/total field where it multiplies the rows.amount field by rows.unitPrice.
{ Origin: "rows/total (0)", Type: "CALC", Expression: "rows.amount * rows.unitPrice"}
Performs the calculation for the second occurrence of the iterative of the rows/total field where it multiplies the rows.amount field by rows.unitPrice.
{ Origin: rows/total(1)", Type: "CALC", Expression: " rows.amount * rows.unitPrice"}