Creating Entity Extension with a Form

Last Updated: 06/29/2018 Introduced in Version: 3.2

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 Entity.

Example

In this example we are going to create an Entity Extension (Address) for the Entity (Person). For this example we created a simple Person Entity that has First Name and Last Name properties.

 

 

In the Designer Folder we click Datatypes/Integrations > User Defined Types > Entity Extension on Folder Actions Panel.

 

In the resulting window we define Structure Name and properties. Also, we pick Extension For Type (entity type that we need to extend). Click Ok to save Entity Extension.

 

 

System creates Entity Extension Data Structure and Configuration Folder for this structure. We navigate to the Configuration Folder of the Entity that we created Extension for (Person Configuration).

 

In the Person Configuration Folder we click Entity Actions > Entity Action on Folder Actions Panel.

 

Then we Name Action and select Create to proceed to the Flow Designer.

 

In the Flow Designer we add an Address Form Generated from Address Entity Extension data structure.

Note: to learn how to generate Form from a Data Structure, please click here.

Generate Data for a Form from the designer folder: Navigate to the designer folder and right click. 

 

In the Flow Designer we add an Address Form Generated from Address Entity Extension data structure.

 

Generated Address Form

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

 

Next, we Edit Input Mappings for Create Address Step

 

Mention: to create Entity Extension we need to build extension data and entity object. This Flow is an Action for our Person Entity, therefore Person object data is available for us. First, we pick Build Data mapping type for Item To Create. Then, we map Entity data to Person input. Next, we pick Build Data mapping type for Address property.

We map output data from our Form to the Address fields. When finished, we can click Ok to save and close Mapping Editor.

Back in the Flow Designer we locate the Add Address Flow. Navigate to Entity Extension and Person Configuration. Open the flow and connect outcome from Create Address step to the End Step. This completes our Flow. We can save it and close Flow Designer.

 

 

We fill out a Form and click Ok to save Entity Extension.

 

For this example we create a Person Entity…

 

Then, we locate our Person and click Add Address action that we created previously in this tutorial.

 

 

 

Finally, we are going to create a simple Flow to use Address Entity Extension. In the Flow Designer we use Get All Address step from Integrations > My Integrations > User Defined Types > Entity Extensions > Address_Person category.

 

 

Next, we connect the Outcome from Get All Address step to the End Step. This completes our Flow. We click Debug Flow on the top panel of the Flow Designer.

 

Our Flow executes and Get All Address outputs our Entity Extension. We can see Address data and Person data that this Address extends. Note: Entity data is not stored in Entity Extension database table. System creates a relation between Entity table and its Extension.

Additional Resources