Creating Entity Extension with a Form
  • 19 Aug 2021
  • 3 Minutes to read
  • Dark
    Light
  This documentation version is deprecated, please click here for the latest version.

Creating Entity Extension with a Form

  • Dark
    Light

Article summary

Overview

This tutorial demonstrates how to create and use Entity Extensions in Decisions. Any Entity type in Decisions may be ‘extended’. Entity Extension creates a new type that is associated with an Entity.

Example

In this example, create an Entity Extension (Address) for the Entity (Person). Create a simple Person Entity that has First Name and Last Name properties. Learn more about Creating Entities.

  1. In the Designer Folder select DATATYPES/INTEGRATIONS > User Defined Types > Entity Extension on the Folder Actions Panel.

  2. In the resulting window define Structure Name and properties. Also, pick Extension For Type (Entity type that needs to be extended). 
  3. Select OK to save Entity Extension.

  4. The system creates an Entity Extension Data Structure and Configuration Folder for this structure. 
  5. Navigate to the Configuration Folder of the Entity that the Extension was created Extension for (Person Configuration).

  6. In the Person Configuration Folder, select User Actions > Create User Actionon the Folder Actions Panel.

  7. Then name the Action and select Create to proceed to the Flow Designer.

  8. In the Flow Designer, add an Address Form Generated from the Address Entity Extension Data Structure.
    To learn how to generate Form from a Data Structure, please click here.
  9. Generate Data for a Form from the Designer Folder.
  10. Navigate to the Designer Folder and right-click the Entity Extension, then select Generate Data Form.

  11. In the Flow Designer, add an Address Form for the Address Entity Extension Data Structure.

  12. Generated Address Form:

  13. Then, add a Create Address step from My Integrations > User-Defined Types > Entity Extensions > Address_Person category.

  14. Next, select Edit Input Mappings for the Create Address step.

  15. To create an Entity Extension, build extension data and Entity object. This Flow is an Action for the Person Entity, therefore Person object data is available. 
  16. First, pick the Build Data mapping type for the Item To Create. 
  17. Then, map Entity data to Person input.
  18. Next, pick Build Data mapping type for Address property.
  19. Map output data from the Form to the Address fields.
  20. When finished, select OK to save and close the Mapping Editor.

  21. Back in the Flow Designer, locate the Add Address Flow. 
  22. Navigate to Entity Extension and Person Configuration. 
  23. Open the Flow and connect the outcome from the Create Address step to the End step. This completes the Flow. 
  24. Save and close Flow Designer.

  25. Now back in the Parent Folder create a new Designer Folder and name it "People."

  26. Next, create a new Flow back Parent Folder and name it "Create People." This Flow will be used to create a Person Entity.

  27. Following the same steps as the Address Entity Extension, generate a data Form for the Person Entity.

  28. In the Flow designer, add the generated data form from the Person Entity and add the Create step found under User Defined Types < Entities < Person.

  29. Select the Create step and click "Edit Input Mapping."

  30. Configure the inputs as shown below. For "Folder Id" select the Designer Folder "People" created in the previous step. This is where the created Entities will be stored.

  31. Save and close the Flow Designer.
  32. Now right-click the "Create People" Flow that was just created and click "Run Flow."

  33. Enter any First and Last name in the designated Form fields and select OK.

  34. Then, open the Designer Folder "People," right-click on the person you just created, and select Add Address, the action that was created previously in this tutorial.

  35. Fill out the Address Form with the desired data and click OK.

  36. Finally, create a Flow to use the Address Entity Extension
  37. In the Flow Designer, use the Get All Address step from the Integrations > My Integrations > User-Defined Types > Entity Extensions > Address_Personcategory.

  38. Next, connect the Outcome from the Get All Address step to the End step. This completes the Flow.  
  39. Select Debug on the top panel of the Flow Designer.

  40. The Flow executes and the Get All Address and outputs the Entity Extension. See Address data and Person data that this Address extends.
    Entity data is not stored in the Entity Extension database table. The system creates a relation between the Entity table and its Extension.


Was this article helpful?