Mapping Rule Objects

When a RuleObject (ie an attribute of a RuleObject which is itself another RuleObject) is added to the datastore, it is added as a new datastore entity as a child of the datastore entity which was added for the parent RuleObject. This only happens in the instance that the RuleObject's rule object name exists in the schema as a child element of an element, where the parent element's name matches the rule object name of the parent RuleObject. The matching here is case sensitive, person in the RuleObject and Person in the schema will not be considered a match. A RuleObject's rule object name is the resultSchema attribute of the Motivation_Display_Element, if an annotation exists. If no annotation exists, a RuleObject's rule object name is the name of the RuleClass. This is important because this is what is used for comparison with and mapping to the datastore, where appropriate based on what the schema allows.

When a simple attribute (an attribute of a RuleObject which is not itself a RuleObject, example a String or codetable value) is added to the datastore, it is added as an attribute of the datastore entity which was added for the RuleObject the attribute is on. This only happens in the instance that an attribute with the same name exists on the element in the schema which corresponds to the owning RuleObject's datastore entityType. The comparison of attribute names is case sensitive, dateOfBirth in the RuleObject and dateOFBIRTH in the schema will not be considered a match.