Rule Types
You can create the following rule types in API Creator:
Use the icon that displays to the left of the rule in the list of rules as a visual indicator for the various rule types.
Rule Type | Icon | Description | Code Examples |
∑ | Sums designated child attribute, with optional child qualification condition. | Derive Customer.balance as:
| |
# | Counts designated child rows using a defined relationship, with optional child qualification condition. | Derive Customer.big_order_count as:
| |
= | Derive an attribute value using other attributes in that entity, or parent entity (changes are propagated). | Derive Lineitem.amount as:
Derive product_billofmaterials.value as:
Derive order.DueDate as:
If a formula rule returns nothing, then the value of the column is unchanged:
| |
↯ | Copy attribute from parent on creation. | Derive Lineitem.Price as:
| |
V | Multi-attribute expression of class/parent attributes that must be met for a transaction to succeed. | Validate Customer.CheckCredit as:
Validate Purchaseorder.NotEmpty on commit as:
| |
E | Invoke JavaScript action (often an extensible service); can execute during or after row processing, or on a commit (after all rows are processed).
Event rules are JavaScript that Layer7 Live API Creator executes whenever a row is inserted, updated, or deleted (when you have enabled the rule for that type of event).For more information:
| See the example for allocateFromTo system method. For more information about this method, see The allocateFromTo System Method. | |
Ep | For inserts, fires when Layer7 Live API Creator maps resource rows to table rows. This occurs in advance of the other event rules and is typically used to compute primary keys. | ||
⌊ | Minimum value of a child attribute, with optional child qualification condition. | Derive Customer.maxOrder as:
| |
⌈ | Maximum value of a child attribute, with optional child qualification condition. | Derive Customer.maxOrder as:
| |
⇞ | Automatically inserts a parent if it does not already exist. | Create parent for GroupBy, for example, empsales to track total sales for employee each month. |