Prepare the Vocabulary and mappings
- Last Updated: May 30, 2025
- 3 minute read
- Corticon
- Version 7.2
- Version 7.1
- Documentation
For Corticon to correctly process the request message, you must ensure that XML or JSON tag names map to entity and attribute names in the Corticon rule Vocabulary.
By default, Corticon Studio specifies the entity or attribute name as the XML Element Name. If XML or JSON tag names are different from the entity or attribute names, you need to prepare the Vocabulary by manually mapping them.
Our project Vocabulary looks like this:
Notice that the request message contains two tag names ‘Shipment’ and ‘itemWeight’ that do not appear in our Vocabulary. They correspond to the Cargo entity and the Cargo.weight attribute.
You need to prepare the Vocabulary by manually mapping ‘Shipment’ to Cargo and itemWeight to Cargo.weight.
Open the Vocabulary file Cargo.ecore in the Tutorial-Done folder.
Mapping the Vocabulary for JSON requests
- On the Vocabulary menu, choose Add Document
Mapping > Add JSON Mapping.
- Change the Element Name for the weight
attribute in Cargo to itemWeight.
- Save the file.
You have now prepared the Vocabulary for JSON requests.
Mapping the Vocabulary for XML requests
- On the Vocabulary menu, choose Add Document
Mapping > Add XML Mapping.
- Click the Cargo entity. In the XML Element Name property, you can see the default name
‘Cargo’ in grey.
- Change the default name by double-clicking the property value and
then entering Shipment.
- Similarly, change the XML Element Name for
the weight attribute in Cargo to itemWeight.
- Save the file.
You have now prepared the Vocabulary for XML requests.
Mapping the Vocabulary for Java Objects
If you prefer to use Java Objects you have prepared, map them into the Vocabulary.
- On the Vocabulary menu, choose Add Document Mapping > Add Java Object Mapping.
- On the Java Object Mapping tab added to the Vocabulary root, click METADATA Import.
- In the Import Java Class Metadata window, select
Cargo.jar. - Select
cargoLibrary, and then click Finish. - Save the Vocabulary file.