Figure Pr.15 - Policy Rule Components : Class diagram
Created: 3/28/2022 3:51:09 PM
Modified: 4/29/2022 4:46:48 PM
Project:
Advanced:
The price of a ProductOffering is governed by a PolicySet.  The PolicySet may be a single PolicyRule or a PolicyGroup which ties together a number of PolicyRules.   The use of both single rules and grouped rules will be explained via examples.<br/>For example, suppose there is a ProductOffering called “Subscribe for a Year, Get Two Accessories Free”.  The free accessories can be selected from list of available accessories.  In this example, the accessories are a cell phone re-charger, hands-free holder, cell phone wallet, or earphone and microphone.  Included in the offering are the cell phone service and the accessories.  There is an instance of PolicySet rule related to this offering.  <br/>All PolicyRules consist of three types of components, which define the semantics of the rule.  (Please see Policy guide book for more information.) This is shown in the figure below.<br/><br/>The semantics of a rule that governs the price of a ProductOffering builds upon this generic structure. The first component is a PolicyEvent, which triggers the evaluation of the PolicyRule. The second defines the PolicyCondition(s) of the PolicyRule being evaluated.  The third defines the PolicyAction(s) that are taken if the PolicyCondition(s) of the rule are met.  In the “Subscribe for a Year” offering:<br/>The PolicyEvent is the time of purchase<br/>The PolicyCondition is the particular type of cell phone service offering being purchased (since different pricing rules could be attached to different types of cell phone offerings)<br/>The PolicyAction taken as a result of this particular condition being true is that two of the accessories are free.<br/>Note that a PolicyRule aggregates at least one or more PolicyConditions and at least one or more PolicyActions. (Policy guide book defines a general set of semantics that specify how a PolicyRule is evaluated, including the concepts of rule priority and a decision strategy for combining different PolicyConditions.) In addition, there are other constructs, such as a Policy Group, that can aggregate multiple PolicyRules. This enables more complex pricing rules to be developed by defining appropriate subclasses of PolicyRule, PolicyCondition and PolicyAction. Note that PolicyCondition and PolicyAction both use the composite pattern; please see Policy guide book for more information.<br/>