Super Classes and Sub Classes
  • 14 May 2021
  • 3 Minutes to read
  • Dark
    Light
  This documentation version is deprecated, please click here for the latest version.

Super Classes and Sub Classes

  • Dark
    Light

Article summary

Overview 

Super Classes are features that assist with data inheritance. In other words, a Super Class is a type of class that acts as the uppermost level of classification in a structure and contains common traits that would be associated with all the elements of the Child Class. These can be used in several Data Structures such as Flow Structures, Defined Data Structures, and Entities in Decisions environments. Due to their hereditary nature, Super Classes are also referred to as Parent Classes. When used, the Parent Class then gives its properties and characteristic to the Subclasses or the Child Classes.

As an example, consider a Super Class Data Structure called Movies that contains the film production properties Director, Producer, and Actors. A Sub Class Data Structure named Movie Genres will inherit the properties of the Super Class. The table below demonstrates how these datatypes relate to one another:

Name
Also Known As
Example Data StructureProperties
Super ClassParent Class, Base ClassMoviesDirector, Producer, Actors
Sub ClassChild ClassMovies.GenreHorror, Romance, Comedy

Example 

Creating Super Class

To demonstrate the function of a Super Class:

  1. Begin by navigating to a Designer Folder and creating a Defined Data Structure via the CREATE DATATYPES/INTEGRATION button located on the bottom toolbar.
  2. Next, select Defined Data Structure and click CREATE. Name the Data Structure "Movies;" this will be the Super Class for this example. 
  3. Begin defining the Data Structure by entering "Directors" into the Name box for the first property of the Data Structure. 
  4. Continue configuring the structure by adding the additional property "Producer" and "Actors." 
  5. SAVE to close and save the Data Structure. 

Creating Sub Class

  1. Create the Sub Class; this will be the structure that inherits the Super Class's properties.  
  2. Begin by creating another Defined Data Structure by using the CREATE DATATYPES/INTEGRATION button, selecting a Defined Data Structure, and clicking CREATE.
  3. Name the Data Structure "MovieGenres" and then navigate to the Advanced section on the right. 
  4. In the box labeled Super Class, enter the Name of the Super Class.
    Note
    The Super Class input utilizes both the Type Name Space as well as the Structure Type namespace of the Super Class to determine which class to inherit traits from. The input is case sensitive and is formatted as the Type Name Space, a period, and then the Structure Type Name. This example is formatted as Documentation.Movies. 
  5. Now, start defining the variables of the Data Structure. 
  6. For this example, name the first one "Horror," the second one, "Drama," and the third one, "Romance." 
  7. Save and close.

Use in a Flow

After creating both the Super Class and Sub Class structures:

  1. Create a new Flow by selecting CREATE FLOW from the bottom toolbar within a Designer Folder.
  2. This Flow will demonstrate how the Sub Class inherits the traits from the Super Class.
  3. Attach a Create Data step to the Start step's Done path by clicking and dragging the step from the Steps tab on the right.
  4. Connect the Done path of the Create Data step to the End step. 
  5. Select the Create Data step.
  6. From the Create Data Properties tab, select Show Editor to enter the Data Definitions panel. 
  7. Create a definition for both "Movies" and "MovieGenres" by naming each Data Type, selecting the Type from the drop down menu, and selecting the Build Data mapping type by selecting Edit and then Build Data.
  8. Close twice to exit the panel and return to the Flow Designer.

Identifying the Relationship

Debugger

There are three ways to ensure that the Sub Class is inheriting properties from the Super Class. The first is to use the Debugger. 

  1. To access the Debugger, select Debug from the top toolbar. 
  2. Debug the Flow in full. 
  3. Select the Create Data step, then the Execution, and lastly, View Input/Output Data.

  4. Both the Inputs and Outputs on the step reveal the Sub Class has inherited the Super Class's properties. 

Data Mapping

The second way to view data inheritance is revealed when using the Build Data mapping type on the Sub Class. Selecting this mapping type reveals all the elements of the data type that the mapping is enacted upon. 

Note
Selecting Build Data will expose all the elements of each Data Type. For the Movies type, this will be the original three configured Elements. If the Super Class was properly applied to the Sub Class, the Build Data step will show the original configured elements for this Data Type, as well as the three that were inherited by the Super Class.











Data Explorer

The third way to see that the Sub Class has inherited the Super Class properties is to view the Data from the Data Explorer.

  1. Start by navigating to the Data Explorer tab located on the left side of the Flow Designer. 
  2. Select the drop down menu beside the Sub Class to expose each element of the Data Structure. The listed Elements should include the originally configured Elements as well as the inherited traits from the Super Class.



Was this article helpful?