Build the Vocabulary
- Last Updated: July 19, 2023
- 4 minute read
- Corticon
- Version 7.2
- Version 7.1
- Version 6.3
- Corticon.js
- Version 2.3
- Tutorials
Now, let’s implement the Vocabulary in Corticon Studio. To begin, launch Corticon Studio and create a Rule Project:
- On the Start menu, select Progress > Corticon Studio.
- In the Workspace Launcher dialog box, retain the default workspace and click OK. Corticon Studio opens.
- Select File > New > Rule Project.

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

Create the Vocabulary
To create a Vocabulary file:
- Right-click MyAdvancedTutorial and select New > Rule
Vocabulary.

- 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):
- In the Vocabulary editor , right-click groceryStore
and select Add Entity.

- Rename this entity by typing
Customerover the default name.
- 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:
- Right-click Customer and select Add Attribute, and
then choose String.
Note: The Data Type Time is not available in Corticon.js. - Rename this attribute by typing
nameover the default name.
- Right-click Customer, select Add Attribute, and then
choose Boolean

- Type
isPreferredMemberover the default attribute name and enter .
- In the Mode drop-down list, select Transient.

- 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.
- Right-click Customer and select Add Association.

- In the Association dialog box:
- In the Source Entity group, select Customer with the Source Many and Mandatory.
- In the Target Entity Name group, select PreferredAccount with the Target One.
- Click OK.
The association appears as shown here.
- Notice that the association appears as many-to-one (
) under Customer and one-to-many
(
) under
PreferredAccount.
- Similarly, add associations between:
- Customer and ShoppingCart (one-to-many)
- Item and ShoppingCart (many-to-one)
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.