ASP offering services to prepaid subscribers

29.198-133GPPOpen Service Access (OSA) Application Programming Interface (API)Part 13: Policy management Service Capability Feature (SCF)Release 9TS

The example shown here is based on an Application Service Provider (ASP) offering services to the prepaid subscribers of a certain Network Operator. The ASP discovers that, as part of the business logic of the applications it offers, the prepaid credit of the subscriber needs to be verified with regards to the current charge for the service in order to determine whether the purchase should be allowed or not. Rather than including this credit check in the business logic of each and every application that the ASP has in its service portfolio, the ASP may decide to enable a Policy Rule to be hosted in the Policy Engine of the Network Operator.

1: For the sake of this example, all activities to create a Domain, a Group, and the Rule are contained within a single transaction. The method startTransaction is used by the application to open the transaction.

2: The rule in this simplistic example is part of a single group, which in turn is contained within a single domain. The application creates that domain by invoking the method createDomain. The value of the parameter domainName is "eCommerceDomain".

3: As a result of the createDomain method a new instance of the IpPolicyDomain interface is created. Its interface reference is returned as return parameter of the createDomain method.

4: Once the domain is created a group is created within that domain. The application invokes the createGroup method, where the parameter groupName has value "PrePaidGroup".

5: As a result of the createGroup method a new instance of the IpPolicyGroup interface is created. Its interface reference is returned as return parameter of the createGroup method.

6: At this point in time there exists the "PrePaidGroup" group within the "eCommerceDomain" domain. The actual rule can be created, using the method createRule. The parameter ruleName has value "SufficientCreditRule". The new rule SufficientCreditRule has the following attributes:

– Enabled == TRUE; the policy rule is currently enabled.

– RuleUsage == NULL; no free-format usage recommendation is provided.

– Priority == 0; default value, as there is only one rule.

– Mandatory == TRUE; mandatory rule, evaluation of the expression must be attempted.

– PolicyRoles == PrePaidBalanceCheck. Each rule must be assigned a policy role(s).

– ConditionListType == P_PM_DNF; disjunctive normal form (DNF).

– SequencedActions == 3; do not care, as there is only one rule.

7: A new instance of the IpPolicyRule interface is created. createRule returns the reference to this newly created interface.

8: Once an instance of IpPolicyRule exists, the actual policy rule can be constructed by means of conditions and actions. Invoking the method createCondition creates the condition. The parameter conditionName has value "SufficientCredit". The parameter conditionType has value "P_PM_EXPRESSION_CONDITION", to indicate that the condition must satisfy certain expressional syntax. The parameter conditionAttributes is a set of structures. For this example the set contains of only one attribute structure.

– ConditionAttribute.AttributeName = "SufficientCreditExpression".

– ConditionAttribute.AttributeValue.SimpleValue.StringValue = "PrePaidCredit > CurrentCharge".

Note that the variables "PrePaidCredit" and "CurrentCharge" in the expression of AttributeValue are assumed to be defined a priori. The value of the expression is derived from the core grammar expressed in the PM information model.

9: A new instance of the IpPolicyExpressionCondition interface is created.

10: The construction of the rule is completed by creating the action that is to be performed when the condition expression evaluates to TRUE. The parameter actionName has value "PurchaseAllowed". The parameter actionType has value "P_PM_EXPRESSION_ACTION" to indicate that the action must satisfy certain expressional syntax. The actionAttributes are again a set containing of only one structure.

– ActionAttribute.AttributeName = "PurchaseAllowedExpression".

– ActionAttribute.AttributeValue.SimpleValue.StringValue = "AllowedPurchase == TRUE".

11: A new instance of the IpPolicyExpressionAction interface is created.

12: The attributes for the condition are set by invoking the method setConditionList. The conditionList is a list consisting of one structure:

– conditionList.Condition == <reference to the IpPolicyCondition interface returned by 9>.

– conditionList.GroupNumber == 1; indicates how the conditions need to be grouped in DNF or CNF in case more groups of rules exist.

– conditionList.Negated == FALSE.

13: The attributes for the action are set by invoking the method setActionList. The actionList is a list consisting of only one structure:

– actionList.Action == <reference to the IpPolicyAction interface returned by step 10>.

– actionList.SequenceNumber == 1.

14: The "SufficientCreditRule" now exists in the "PrePaidGroup" of the "eCommerceDomain" and is assigned the policy role of PrePaidBalanceCheck. The rules is as follows:

IF " PrePaidCredit > CurrentCharge " THEN "AllowedPurchase == TRUE". This policy rule is enabled upon creation and it is mandatory for the policy engine to load this rule (and any other within the PrePaidGroup with policy role of PrePaidBalanceCheck) upon an evaluation request and then evaluate it.

The class IpPolicyDomain is defined as a generalized aggregation container, enabling PolicyDomains, PolicyGroups, and PolicyRules to be aggregated in a single container. The following figure shows how this container looks for the example.

+————————————————————-+

|PolicyDomain "eCommerceDomain" |

| |

| +—————————————————+ |

| |PolicyGroup "PrePaidGroup" | |

| | | |

| | +———————————————-+ | |

| | |PolicyRule "SufficientCreditRule" | | |

| | | | | |

| | | +——————-+ +——————-+ | | |

| | | |PolicyCondition | |PolicyAction | | | |

| | | | "SufficientCredit"| | "PurchaseAllowed" | | | |

| | | +——————-+ +——————-+ | | |

| | +———————————————-+ | |

| +—————————————————+ |

+————————————————————-+