Iterate through the lifecycle again
- Last Updated: November 6, 2023
- 5 minute read
- Corticon
- Version 6.3
- Tutorials
Rule modeling is an iterative process. As your business needs change, you may need to make changes to your rules. Let’s see how easy it is to do this in Corticon Studio by adding, analyzing, and testing a new rule in our Rulesheet.
![]()
Let’s begin by adding a rule statement for the new rule.
Add a new rule statement
Switch back to your Rulesheet by clicking the Cargo.ers tab. If you closed it earlier, reopen it by double-clicking the file inside the Rule Project Explorer pane.
![]()
Enter the new Rule Statement—Cargo requiring refrigeration must be packaged in a reefer container. This will guide us when we model the new rule.
To model this rule, we need to edit the Vocabulary. First, we need to add a new attribute to the Cargo entity to define whether the Cargo requires refrigeration or not (let’s call this needsRefrigeration). Second, we need add “reefer” as another possible selection option for the container attribute.
Open and edit the Vocabulary
- Click the Vocabulary tab, Cargo.ecore tab. If you closed it, open it again by selecting Cargo.ecore from the Recent File list at the bottom of the File menu or double-click the file in the Rule Project Explorer pane. The Vocabulary opens in the Vocabulary editor.
- Let’s add a Boolean attribute named needsRefrigeration:
- In the Vocabulary editor in the upper right pane, right-click
Cargo and choose Add Attribute and then Boolean from the submenu.

- Define the attribute name by double-clicking the default
attribute name value (Attribute_1) and changing it to needsRefrigeration.

- In the Vocabulary editor in the upper right pane, right-click
Cargo and choose Add Attribute and then Boolean from the submenu.
- Add “reefer” as another allowable type of container:
- Select the container attribute and note the Data Type:
containerType. This is a custom data type that defines a set of allowable
values for container (an enumerated set).

- To define custom data types, you must first click on the
“root” node of the Vocabulary, denoted by the open book icon—in this case,
Cargo.

- Click the containerType entry. This will display the
enumerated set in the rightmost table.

- Add “reefer” as both a Label and a Value.

- Select the container attribute and note the Data Type:
containerType. This is a custom data type that defines a set of allowable
values for container (an enumerated set).
- Save the Vocabulary by selecting File > Save and close the Vocabulary Editor pane.
Custom data types are a powerful capability that helps you define a Vocabulary that matches how you think about your business.
Model the new rule
Now that the Vocabulary contains the new terms required by the new rule, let’s model the new rule—Cargo requiring refrigeration must be packaged in a reefer container. When you are done, your Rulesheet should look like this:
![]()
Be sure to define the Reference link from the Rule Statement to column 4 and add Post and Alias as shown here.
![]()
Analyze the new rule
Whenever we add or change our rules, we should re-analyze.
that appears right below the menu bar. As you can see, adding the new rule has caused three new conflicts, one with each of our three existing rules.
![]()
You can step through multiple conflicts, and filter the Rulesheet to view only the conflicting rules, using the buttons to the right of the Conflict Check button.
![]()
Note that Rules 1, 2, and 3 each define a specific container type for cargo based on weight and volume, while Rule 4 defines the container type based on whether the cargo needs refrigeration. The conflict occurs because a cargo load that requires refrigeration may also trigger Rules 1, 2, or 3.
After you have made these changes, your Rulesheet looks like this:
![]()
Next, let’s check for completeness by selecting Rulesheet > Logical Analysis > Check for Completeness.
![]()
As you can see, the Rulesheet is complete. Click OK in the dialog box and save the Rulesheet file.
Run the Ruletest again
The last step is to modify your test case to test the new rule.
- Open Cargo.ert.
- Copy and paste Cargo[1] to create Cargo[4], in both the Input and Expected panes.
- Drag and drop the needsRefrigeration attribute from your Vocabulary onto both Cargo[4] entities.
- In both panes, set the value of needsRefrigeration to “true”.
- In the Expected pane, change the value of container in Cargo[4] to “reefer”.
- Run the test. Your Ruletest should now look like this:

As you can see, the actual results match the expected results.
Congratulations! You have now completed two full iterations of the Corticon decision service development lifecycle and understand the basic concepts of rule modeling, analysis, and testing in Corticon Studio.
To learn more rule modeling techniques, take the Advanced Rule Modeling Tutorial .