Previous Topic: CA Plex Feature: Dynamic Diagrams

Next Topic: Generating and Building the Employee Entity

Defining the Task Entity

You have created the Task entity but you have not specified anything else about it. In the next series of steps, you add triples to define the Task entity. After you have defined the Task entity, you learn more about the Panel Designer, and you use it to modify the inherited panels.

To define fields for the Task entity:

  1. Add the following triples:

    Task known by Task ID
    Task has Task Description

  2. Add the following triples to define the properties of these fields:

    Task ID is a FIELDS/Identifier
    Task Description is a FIELDS/ShortDescription

    These are similar to the triples you used to define the corresponding fields on the Project entity in the chapter "Your First CA Plex Application in 20 Minutes," except for the FLD length NBR triple. The FLD length NBR triple enables you to override the field length that you inherited from FIELDS/ShortDescription. This is a simple example of one of the ways you can customize the effects of a pattern library object.

  3. Refresh your Model Editor.

Now that you have defined the fields for the Task entity, you need to specify which patterns you want the Task entity to inherit from.

To specify what pattern library objects the Task entity inherits from:

  1. Add the following triples:

    Task is a FOUNDATI/EditDetail
    Task is a STORAGE/RelationalTable
    Task is a FOUNDATI/OwnedCascade

    You have already learned about the EditDetail and RelationalTable patterns, but the OwnedCascade entity is new.

    OwnedCascade connects Task with a parent entity so that each record in the Task entity belongs to a record of the parent entity. When the parent entity that owns the Task records is deleted, the Task records are deleted as well. This is known as cascade deletion.

    In the diagram, you added the relationship Task owned by Project, so Project is Task’s parent. The OwnedCascade pattern contains an abstract (placeholder) parent, called Owner, which you need to replace with a real owner entity.

    Next, you replace the placeholder in the FOUNDATI/OwnedCascade pattern with the Project entity in your model.

  2. In the Model Editor, select the Task is a FOUNDATI/OwnedCascade triple (make sure the whole line is highlighted) and click the Editor toolbar button.

    Defining the Task Entity (1)

    The Template Editor appears:

    Defining the Task Entity (2)

  3. In the blank column, enter Project.
  4. Close the Template Editor, saving the changes when prompted.
  5. If you refresh the Model Editor, you should see that the Template Editor has added the following triples:

    Task replaces FOUNDATI/Owner
    …by Project

  6. Refresh the Object Browser. If the Task entity is not expanded, expand it.

    Defining the Task Entity (4)

    Notice that Task has another view called SuperKeys in addition to the Fetch and Update views inherited from EditDetail. The SuperKeys view stores the key fields of the owner of the entity—in this case, Project. Unlike Fetch and Update, SuperKeys does not have any scoped functions. Views are defined in CA Plex Object Types in the chapter “Your First CA Plex Application in 20 Minutes.” You learn more about them later in this chapter.

Now you have defined the Task entity. You have specified what pattern library entities it should inherit from, defined its fields, and the properties of the fields.