Use Relationship Membership as a Rule Input

Relationship membership can be used as a rule input by creating a membership statement and using it as a condition in a rule. A membership statement always reasons against the source entity and the target entity. The membership statement will be true if the target entity is the target of the relationship for the source entity. A membership statement can be true when the relationship is partially known. So long as it is known that the entity instance in question is a member of the relationship, the membership statement will return as true.

A membership statement can be used for any type of relationship.

A membership statement used as a condition takes one of the following forms:

  • <target entity> is a member of <relationship text>
  • IsMemberOf(<target entity>, <relationship text>)

For example,

The product is selected if

ForScope(the customer who chose the product)

IsMemberOf(the product, the customer's chosen products)

As shown in the example above, both entities (that is, the source entity and the target entity) must be brought into the scope of the rule, otherwise an attribute "<target entity> is a member of <relationship text>" will be created.

A membership statement that is used as a condition cannot have any children under it in that rule. Therefore either:

  • membership of the relationship must be proved by another rule. For example, 'the dog is a member of the person's favorite dogs if the dog is well-behaved', or
  • membership of the relationship is collected on an interview screen. This can be useful where it is explicit user input that determines whether a particular entity is a member of a reference relationship.

Tip: The Retail Discounts example policy model that is installed with Policy Modeling demonstrates the use of membership statements.