For rules in a Decision Service to read or write to a database, the Vocabulary elements used in the rules must be mapped to elements in the database. In the Basic Rule Modeling tutorial, you learned about Vocabulary elements—entities, attributes, and associations. Let’s take a look at how these Vocabulary elements correspond to elements in a database.

As you know, a relational database is a set of tables. Each table in the database corresponds to an entity in a Vocabulary. Each record in the table corresponds to an entity instance in a Ruletest. Columns in the table correspond to attributes in the entity. Table joins or table relationships correspond to associations in the Vocabulary. Finally, the database’s schema is like the Vocabulary tree.

This table summarizes the relationship between a Vocabulary and a database:

media/image1.png

As an integration developer, you are responsible for mapping the Vocabulary to the database. You must map each entity used in a rule to a table in the database, each attribute to a column, etc. Once the mapping is configured, rules that use mapped entities and attributes will automatically access the database. You configure all of this mapping in Corticon Studio.

Before you do any mapping, you should gather and identify mapping requirements. Generally, you will encounter one of the following scenarios:

  • Scenario 1—you have an existing Vocabulary but no corresponding database schema. In this case, you need to generate the database schema from the Vocabulary.
  • Scenario 2—you have an existing Vocabulary and an existing database schema. In this case, you need to map Vocabulary elements with database elements.