This feature is only available in the current version of Author Studio released in the fall of 2023. If you have not updated to the newest version of the product, see our Archived Author Studio Documentation here.
The Collection element defines the relationship between a parent entity and its collection of child entities or local "complex" structures. The association is made in the Data Type dropdown list of a Field, which is populated with a list of defined entities.
Adding a collection
- Add a Field to the Entity that you want to add the collection to.
- Name the field the name you want the collection to have
- Under Data type, select the entity type for the collection.
Deleting a collection
Since a collection is the type of field, collections are deleted in the same way as a Field.
-
Hover over the Field and a trashcan icon will appear.
- Click on the trashcan icon .
- You will be prompted to confirm the deletion. Click on Delete.
Entity Collections
- Most commonly used over complex collections
- Fields are defined on the entity to which the collection refers
- Have their own rule context (e.g. rules can be authored against Entity1.Collection1 if Collection1 is an entity collection)
Complex Collections
- Less commonly used vs. entity collections
- Fields are defined inline in the entity structure beneath the complex collection
- Do not have their own entity rule context. All rules must be written at the parent entity level. This can lead to complexity in nested complex collection scenarios.
- To add fields to a complex collection, right-click on the collection in the entity tree and select Add > Field, Calculation or Collection.
Using Collections to Establish a Hierarchy
In many situations, a rule application needs to operate over a hierarchy of data rather than a flat set of related fields. InRule allows you to create relationships between entities to establish a parent-child relationship.
For example, a standard company invoice usually has a set of information that relates to the invoice header such as company name, address, billing contact, etc. In addition, there is a collection of line items that comprise the detailed billing section of the invoice. While there are rules that may apply only to the header information or to individual line items, there are also rules that apply to the items as a whole. For example, suppose you wanted a rule that looked at the total amount across all the line items and the customer ID and assigned a discount to the total invoice amount. This can be difficult without the existence of a parent-child structure.
Comments
0 comments
Please sign in to leave a comment.