Now, let’s implement the Vocabulary in Corticon Studio. To begin, launch Corticon Studio and create a Rule Project:

  1. On the Start menu, select Progress > Corticon Studio.
  2. In the Workspace Launcher dialog box, retain the default workspace and click OK. Corticon Studio opens.
  3. Select File > New > Rule Project.


  4. In the New Corticon Project window, in the Project name field, type MyAdvancedTutorial, and click Finish.

Create the Vocabulary

To create a Vocabulary file:

  1. Right-click MyAdvancedTutorial and select New > Rule Vocabulary.

  2. In the Create a New Vocabulary window, in the File name field, type groceryStore, and click Finish

The Vocabulary opens under the rule project MyAdvancedTutorial.



Add Entities

Now, let’s add the entities (Customer, PreferredAccount, Item, ShoppingCart, Coupon):

  1. In the Vocabulary editor , right-click groceryStore and select Add Entity.

  2. Rename this entity by typing Customer over the default name.

  3. Repeat these steps to add the remaining entities. The result looks like this:


Add Attributes

To add the attributes, start by adding attributes for the Customer entity based on this table:



  1. Right-click Customer and select Add Attribute, and then choose String.

    Note: The Data Type Time is not available in Corticon.js.
  2. Rename this attribute by typing name over the default name.

  3. Right-click Customer, select Add Attribute, and then choose Boolean

  4. Type isPreferredMember over the default attribute name and enter .

  5. In the Mode drop-down list, select Transient.

  6. Add attributes for the rest of the entities based on this table:

After adding all the attributes, the Vocabulary looks like this:



Add Associations

To create associations between the entities, start with the association between Customer and PreferredAccount. This is a many-to-one association.

  1. Right-click Customer and select Add Association.


  2. In the Association dialog box:
    1. In the Source Entity group, select Customer with the Source Many and Mandatory.
    2. In the Target Entity Name group, select PreferredAccount with the Target One.
    3. Click OK.


    The association appears as shown here.
  3. Notice that the association appears as many-to-one () under Customer and one-to-many () under PreferredAccount.

  4. Similarly, add associations between:
    • Customer and ShoppingCart (one-to-many)
    • Item and ShoppingCart (many-to-one)
    The final output will look like this.


Each association has an association role name. For example, the association between Customer and PreferredAccount has the name preferredAccount. Note that the opposite association between PreferredAccount and Customer has the role name customer. A role name helps describe or clarify the relationship of an entity with another entity.

You can change the role name for an association to make it more meaningful. In our example, let’s change the role name for the association between Customer and PreferredAccount to preferredCard by double-clicking the association under Customer,and typing preferredCard over the default value.