Case Entity CRUD Actions
  • 08 Jul 2022
  • 3 Minutes to read
  • Dark
    Light

Case Entity CRUD Actions

  • Dark
    Light

Article Summary

Overview

Case Entity Data Structures are typically used to delineate non-linear, data-driven, or state-driven processes (e.g. order fulfillment). The following article will demonstrate how to use the Create, Update, and Delete steps in a Flow using a Case Entity Data Structure.

CRUD Action Steps: Case Entity
In the Flow Designer's Toolbox, Create, Update, and Delete steps cannot be searched for. Users will have to navigate to USER DEFINED TYPES > CASE ENTITY to add CRUD actions to the workspace. 

Example

In this tutorial, a Case Entity Data Structure was created with the following fields:  

Person
FirstnameString
LastnameString
DOBDate time
For more information on how to create a Case Entity Data Structure, please navigate to Creating a Case Entity Data Structure.

Case Entities store data in Decisions, however, users will have to create a Normal Folder to store the process data. In this example, a Normal Folder [Case Entity Person Data] was created. 

Do Not Store Data In The Configuration Folder
Data Structures that are a part of the Decisions Entity Framework will automatically have a Configuration Folder. Do not store data within that folder. The Configuration Folder is meant for creating Flows, Rules, and other Designer elements to enhance that custom data structure. For more information, please navigate to the Configuration Folder article.

Create 

To create a record in the Person Case Entity Data Structure

  1. To begin, in a Designer Folder, select CREATE FLOW from the Global Action Bar.
  2. In the resulting Create Flow dialog, select and name the default Flow [Case Entity CRUD]. Click CREATE to enter the Flow Designer.
  3. In the Flow Designer, from the Toolbox > USER DEFINED TYPES > CASE ENTITY > PERSON, drag and connect a Create Person step to the Start and End steps.
  4. With the Create Person step selected, in the Properties panel > INPUTS > Extension Data field, change the input mapping from Unknown to Build Data.
  5. Notice the appearance of the Case Entity values "DOB", "FirstName", and "LastName". Change the input mappings on each from Unknown to Constant and input relevant example information.
    In this example, the inputs for the value fields are: DOB: "6/20/2021", FirstName: "Jill", and LastName: "Doe".
  6. Change the input mapping for INPUTS > Folder Description from Unknown to Constant and input a relevant description.
  7. Change the input mapping for INPUTS > Folder Name from Unknown to Constant and input a relevant name.
  8. Change the input mapping for INPUTS > Parent Folder ID from Unknown to Constant and select the Normal Folder previously created.
    In this example, the inputs for the value fields are: Folder Description: "Person Description", Folder Name: "Person Data", and Parent Folder ID: "Case Entity Person Data".
  9. Save and Debug the Flow.
  10. Click START DEBUGGING.
  11. The Flow ends successfully. Decisions has now begun a record in the Folder [Case Entity Person Data].

Notice that the ID was automatically created in the Folder when the Flow was run, even though its input value was set to Ignore.

Update

To update an existing record in a Case Entity Data Structure, the Edit Person or the Selective Update Person steps will be used; these steps are found in the Toolbox > USER DEFINED TYPES > CASE ENTITY > PERSON section. The Edit Person step will change every data field in the object, even if only one data field has been changed; to change only one or more data field values and maintain the rest of the data field values the Selective Update step is recommended. In order to change any record in a Data Structure, the Fetch Entities step will be required to fetch a particular record and then it will pass the Id of the record to be changed into the Edit or Selective Update steps. 

Edit Person step

When using the Edit Person step, notice it is configured similar to the Create Person step in the Properties panel > INPUTS> Extension Data where the input mapping is set to Build Data, except the EntityId has a Select From Flow mapping and is drilled down to First, then EntityId. Also, for this example, the Edit Person step has been configured with a new random FirstName, LastName, and DOB. The Folder ID remains the same, however, the Folder Name and Description reflect "New Person Data" and "New Person Description", respectively.
If the Edit step is used to change one field, that field will update with the new value, and all unchanged fields will be set to Null or Empty.

Selective Update Person step

When using the Selective Update Person step, configure Properties panel > INPUTS > ExtensionId to a Select From Flow input mapping and select Entity Results, drill down and click First, then ExtensionId. In the Properties panel > DATA > DOB, FirstName, and LastName are configured with random information.

Delete

To remove records from a Data Structure, the recommended step is the Delete Person step found in the Toolbox >  USER DEFINED TYPES > CASE ENTITY > PERSON.  This step will expect an Id as an input. Once an Id has been provided, running the flow will delete that record from the Data Structure.


Was this article helpful?