- 21 Aug 2024
- 3 Minutes to read
- Print
- DarkLight
Entity Extension CRUD Actions
- Updated on 21 Aug 2024
- 3 Minutes to read
- Print
- DarkLight
Overview
An Entity Extension Data Structure extends the data stored in Decisions for an existing Entity Data Structure (e.g. a "Person" Entity with an "Address" extension).
Entity Extension CRUD actions can be used to configure the extension's fields for its attached Entity.
Prerequisites
Entity Data Structure
For this tutorial, create an Entity Data Structure created with the following data fields. Ensure this Entity contains at least one record to extend its data.
Financial Account | |
---|---|
Data Field Name | Data Field Type |
AccountID | String |
AccountHolder | String |
AccountType | String |
Balance | String |
AccountStatus | String |
Entity Extension
After creating the Entity Structure, create an Entity Extension with the following fields and tie it to the previously created Entity. This extension allows the association of multiple account owners with a financial account. It's particularly useful for joint accounts or accounts with multiple beneficiaries.
AccountOwnership | |
---|---|
Data Field Name | Data Field Type |
OwnerID | String |
OwnerType | String |
OwnerPercentage | Decimal |
Relationship | String |
ContactDetails | String |
Create
End Result
OLD Update section BELOW:
- Navigate to a Designer Folder, create a Flow, and name it "EE Create Flow". It will automatically open in the Flow Designer.
- Add a Fetch Entities step in the Toolbox's Favorites category after the Start step.
- Open the Fetch Entities' Properties. For the Type Name, select the original Entity to extend. For this example, this is 'EntityPerson'.
- Navigate to the Toolbox > USER DEFINED TYPES > ENTITY EXTENSIONS > ADDITIONALPERSONINFO_ENITITYPERSON category. Drag a Create AdditionalPersonInfo step after the Results outcome of the Fetch Entities step.
- Connect the No Results outcome to the End step.
- In the Properties panel of the Create AdditionalPersonInfo_EntityPerson step, change the Item to Create input's mapping type from Unknown to Build Data.
Locate the AdditionalPersonInfo input and change its input mapping to Build Data. Provide example information for the Extension's fields by changing the input mappings from Ignore to Constant. - Navigate to INPUTS > Entity Person, change the input mapping from Ignore to Select From Flow, and select Entity Results.First.
Update
- Navigate to a Designer Folder and create a Flow, and name it "EE Update Flow". It will automatically open in the Flow Designer.
- In the Toolbox's Favorites category, add a Fetch Entities step after the Start step.
- Open the Fetch Entities' Properties. For the Type Name, select the original Entity to extend. For this example, this is 'EntityPerson'.
- Navigate to the Toolbox > USER DEFINED TYPES > ENTITY EXTENSIONS > ADDITIONALPERSONINFO_ENITITYPERSON category. Drag an Edit AdditionalPersonInfo step after the Results outcome of the Fetch Entities step. Connect the No Results step to the End step
- In the Properties panel of the Edit AdditionalPersonInfo_EntityPerson step, change the Item to Create input's mapping type from Unknown to Build Data.
Locate the AdditionalPersonInfo input and change its input mapping to Build Data. Changing the Extension's input mapping from Ignore to Constant and edit the desired fields. - Navigate to INPUTS > Entity Person and change the input mapping from Ignore to Select From Flow and select Entity Results.First.
Delete
Entity Extensions contain no Delete steps. Instead, the Edit AdditionalPersonInfo_EntityPerson step will be used again to produce empty values.
- Navigate to a Designer Folder and create a Flow, and name it "EE Delete Flow". It will automatically open in the Flow Designer.
- In the Toolbox's Favorites category, add a Fetch Entities step after the Start step.
- Open the Fetch Entities' Properties. For the Type Name, select the original Entity to extend. For this example, this is 'EntityPerson'.
- Navigate to the Toolbox > USER DEFINED TYPES > ENTITY EXTENSIONS > ADDITIONALPERSONINFO_ENITITYPERSON category. Drag an Edit AdditionalPersonInfo step after the Results outcome of the Fetch Entities step.
Connect the No Results outcome to the End step. - In the Properties panel of the Edit AdditionalPersonInfo_EntityPerson step, change the Item to Create input's mapping type from Unknown to Build Data.
Locate the AdditionalPersonInfo input and change its input mapping to Build Data. Leave the new inputs with Ignore mappings; this will remove the additional values tied to the original Entity Data Structure. - Navigate to INPUTS > Entity Person and change the input mapping from Ignore to Select From Flow and select Entity Results.First.
Debug
- Select Debug from the Top Action Panel, doing so will save the Flow and open the Debugger. After it runs, save and exit the Flow.
- Create a new Flow and add a Fetch Entities step after the Start step.
The Edit step produces null values for the Ignored data fields effectively deleting their data.