| Reference > Rule Languages > ILOG Rule Language > IRL Keywords > hierarchy |
hierarchy |
PREVIOUS NEXT |
This keyword is used to define a hierarchical property. This keyword is used at the top level of the ruleset.
hierarchyhierarchyName {"rootName"{"nodeName1"{"nodeName11""nodeName12"... }"nodeName2""nodeName3"{"nodeName31"{"nodeName311"} } } }
A hierarchy defines values and gives a partial order between those values. IRL rules may have hierarchical properties. Specific predicates are defined to deal with hierarchical properties and get the ruleset's rules whose property has a specific value.
When a rule hierarchical property is accessed, its value is considered to be a string.
hierarchy Geography
{ "North"
{ "USA" { "California" { "San Francisco" } "Texas" { "Houston" "Paris" } }
"Europe" { "France" { } "Germany" }
}
}
propertydefinition { Geography location; }
rule r1 { property location = "North/USA/Texas/Paris" when { ... } then { ... } }
rule r2 { property location = "France" when { ... } then { ... } }
rule r3 { property location = "North/Europe/France/Paris" when { ... } then { ... } }
Here we have defined three rules r1, r2, and r3. All of them define a property location which is a hierarchical property. We can see that the location value of both r1 and r3 l is given as a path from the hierarchy root to the final leaf in order to resolve the ambiguity between the two nodes named Paris. The r2 location property value is France which refers to a unique node in the hierarchy.
match predicates, propertydefinition, rule
| Copyright © 1987-2008 ILOG S.A. All rights reserved. Legal terms. Documentation homepage. | PREVIOUS NEXT |