4 NPL Rule File Configuration

This chapter describes the Oracle Communications Offline Mediation Controller Node Programming Language (NPL) rule file configuration for the Oracle Communications Offline Mediation Controller Elastic Charging Engine (ECE) cartridge pack.

NPL Rule File

When creating and configuring the ECE Distribution Cartridge (DC) node, you configure an NPL rule file containing the mapping data from the NAR format to an output format for use by ECE. For more information about NPL, see Offline Mediation Controller Cartridge Development Kit NPL Reference Guide.

When configuring the ECE DC node, define the following in the NPL rule file:

Configuration Block

A configuration block is used to set configuration values that are needed by the node. You can define only one configuration block in an NPL rule file.

Syntax

Config {
PRODUCTTYPES "product_type[, ...]";
PAYLOAD "payload_type[, ...]";
PAYLOADDATATYPE "datatype";
USAGEOBJECTS "usage_object";
EVENT "event_type[, ...]";
VERSION "version_number[, ...]";
MODE "usage_request_mode";
TIME_ZONE "time_zone";
DATE_FORMAT "date_format";
USAGE_REQUEST_BUILDER "request_format";
REQUEST_MODE_TYPE "usage_request_type";}

Configuration Settings

PRODUCTTYPES "product_type[, ...]";

where product_type is a product type defined in ECE. This parameter is specific to the product types the ECE DC processes.

PAYLOAD "payload_type[, ...]";

where payload_type is the payload type defined in ECE.

PAYLOADDATATYPE "datatype";

where datatype specifies the data type used in payloads.

USAGEOBJECTS "usage_object";

where usage_object specifies the usage objects type. The default is USAGEBUILDER.

EVENT "event_type[, ...]";

where event_type specifies the types of events. Add the event_type values separated by commas.

VERSION "version_number[, ...]";

where version_number specifies the version for each record corresponding to the product type. Add the version_number values separated by commas.

MODE "usage_request_mode";

where usage_request_mode specifies the mode in which Offline Mediation Controller sends usage requests to ECE. Set the parameter to one of the following values:

  • CUMULATIVE: Specifies that the balance impact in ECE is cumulative.

  • INCREMENTAL: Specifies that the balance impact in ECE is incremental.

TIME_ZONE "time_zone";

where time_zone specifies the time zone used by the ECE DC to send the session start time and the session end time to ECE. The default is UTC. The time zone is set at record level or at cartridge level:

  • Record level: If the NPL output record block contains the timeZone field, the time zone is set at record level. For record level time zone, each call detail record (CDR) can have a different time zone defined by the timeZone field in the CDR.

  • Cartridge level: If the configuration block contains TIME_ZONE field, the time zone is set at cartridge level. All the CDRs processed by the cartridge will contain the same time zone as defined by the TIME_ZONE field.

Note:

If the time zone is defined at record level and at cartridge level, the record level time zone is used.

DATE_FORMAT "date_format";

where date_format specifies the date format used by the ECE DC to send the session start time and the session end time to ECE. The default is yyyy-MM-dd HH:mm:ss.

USAGE_REQUEST_BUILDER "request_format";

where request_format defines the usage request builders. This parameter is used to create the builders for the corresponding product type, event, and version.

REQUEST_MODE_TYPE "usage_request_type";

where usage_request_type specifies the type of usage request the Offline Mediation Controller sends to ECE. Set the parameter to one of the following values:

  • ONLINE: Specifies that the online usage request is sent to ECE.

  • OFFLINE: Specifies that the offline usage request is sent to ECE.

For example:

Config {
PRODUCTTYPES "VOICE,DATA,SMS";
PAYLOAD "VOICE_USAGE_Terminate_PAYLOAD,VOICE_USAGE_Update_PAYLOAD,
VOICE_USAGE_Debit_unit_PAYLOAD,VOICE_USAGE_Refund_unit_PAYLOAD,
VOICE_USAGE_Refund_amount_PAYLOAD,VOICE_USAGE_Debit_amount_PAYLOAD,
DATA_DATA_USAGE_Terminate_PAYLOAD,DATA_DATA_USAGE_Update_PAYLOAD,
DATA_DATA_USAGE_Debit_unit_PAYLOAD,DATA_DATA_USAGE_Refund_unit_PAYLOAD,
DATA_DATA_USAGE_Refund_amount_PAYLOAD,DATA_USAGE_Debit_amount_PAYLOAD,
SMS_SMS_USAGE_Terminate_PAYLOAD,SMS_SMS_USAGE_Debit_unit_PAYLOAD,
SMS_SMS_USAGE_Refund_unit_PAYLOAD,SMS_SMS_USAGE_Refund_amount_PAYLOAD,
SMS_SMS_USAGE_Debit_amount_PAYLOAD";
PAYLOADDATATYPE "PAYLOADDATATYPE";
USAGEOBJECTS "USAGEBUILDER";
EVENT "USAGE,DATA_USAGE,SMS_USAGE";
VERSION "1.0";
MODE "CUMULATIVE";
TIME_ZONE "UTC";
DATE_FORMAT "yyyy-MM-dd HH:mm:ss";
USAGE_REQUEST_BUILDER "VOICE@USAGE@1.0,DATA@DATA_USAGE@1.0,SMS@SMS_USAGE@1.0";
REQUEST_MODE_TYPE "ONLINE";
}

Input Record Block

An input record block defines the fields in the input data record passed into the node.

Syntax

InputRec {
datatype parameter;
} in;

where:

datatype is the data type of the input field; for example, String.

parameter is the input field name.

For example:

InputRec {
                String calling_number;
                Integer seq_no;
                Integer duration;
                String start_time;
                String product_type;
                String session_id;
                String CalledId;
                String end_time;
                String cell_id;
                String requestedInputVolume;
                String requestedOutputVolume;
                String requestedTotalVolume;
                String usedUnitsInputVolume;
                String usedUnitsOutputVolume;
                String usedUitsTotalVolume;
                String operationType;
                String correlation_identifier;
                String balance_element_id;
                String amount;    
              //  String timeZone;  
} in;

Output Record Block

An output record block is used to define the format of an output data record of the node.

Syntax

OutputRec {
datatype parameter;
} out;

where:

datatype is the data type of the output field; for example, String.

parameter is the output field name.

For example:

OutputRec {
                String calling_number;
                Integer seq_no;
                String duration;
                String start_time;
                String end_time;
                String product_type;
                String session_id;
                String CalledId;
                String npl_type;
                String cdr_service;
                String cell_id;
                String requestedInputVolume;
                String requestedOutputVolume;
                String requestedTotalVolume;
                String usedUnitsInputVolume;
                String usedUnitsOutputVolume;
                String usedUitsTotalVolume;
                Integer usedUnitsSpecificUnit;
                String eventType;
                String version;
                String operationType;
                String correlation_identifier;
                Integer balance_element_id;
                Double amount;
                //  String timeZone;
} out;

Expose Block for PAYLOAD

For every payload type in the configuration block, define an Expose block. In the Expose block, map the NPL fields to the ECE Payload fields defined in the ECE request specifications.

For example:

Expose for VOICE_PAYLOAD{out.CalledId "CALLED_ID";out.duration "REQUESTED_UNITS[0].DURATION";}
Expose for DATA_PAYLOAD{out.cell_id "CELL_ID";
out.requestedInputVolume "REQUESTED_UNITS[0].INPUT_VOLUME";
out.requestedOutputVolume "REQUESTED_UNITS[0].OUTPUT_VOLUME";
out.requestedTotalVolume "REQUESTED_UNITS[0].TOTAL_VOLUME";
out.usedUnitsInputVolume "USED_UNITS[0].INPUT_VOLUME";
out.usedUnitsOutputVolume "USED_UNITS[0].OUTPUT_VOLUME";
out.usedUitsTotalVolume "USED_UNITS[0].TOTAL_VOLUME";}

Expose Block for Usage Object

For every usage object type in the configuration block, define an Expose block. In the Expose block, map the NPL fields that are sent as parameters in the create usage objects method.

For example:

Expose for USAGEBUILDER{
out.calling_number "PARAM1";
out.session_id "PARAM2";
out.start_time "PARAM3";
out.end_time "PARAM4";
out.seq_no "PARAM5";
}

Expose Block for Payload Data Type

For every payload data type in the configuration block, define an Expose block. In the Expose block, define the data type for the fields that are passed in payload data type.

For example:

Expose for PAYLOADDATATYPE{out.duration "SECONDS";
out.requestedInputVolume "VOLUME";
out.requestedOutputVolume "VOLUME";
out.requestedTotalVolume "VOLUME";
out.usedUnitsInputVolume "VOLUME";
out.usedUnitsOutputVolume "VOLUME";
out.usedUitsTotalVolume "VOLUME";}

Mapping the Input Record Attribute to the Output Record Attribute

When mapping the input record attribute to the output record attribute, set the following output fields based on the specific product type for which the CDR is received:

  • cdr_service: Set this field to the product types for each CDR record.

  • eventType: Set this field to the event type for each CDR record corresponding to the product type.

  • version: Set this field to the version for each CDR record corresponding to the product type.

  • operationType: Set this field to the usage type for each CDR record corresponding to the product type.

    See the sample mapping for the ECE cartridge pack in Offline Mediation Controller Cartridge Development Kit NPL Reference Guide for more information about the supported usage types.

For example:

out.cdr_service="VOICE"out.eventType="USAGE"out.version="1.0"out.operationType= "Terminate"

Retrieving the usageResponseWrapper Object

You can use a Java hook to retrieve the usageResponseObject from the output NAR file of the ECE DC node. The following is a sample of a Java hook that retrieves the usageResponseWrapper object:

public interface InterfaceName extends IDCMethodHandler {
public UsageResponseWrapper methodName(ObjectField obj);
}
public class className implements InterfaceName {
@Override
public UsageResponseWrapper methodName(ObjectField obj){
UsageResponseWrapper usageResponseWrapper= new UsageResponseWrapper();
usageResponseWrapper.setOnlineusageResponseObj((OnlineUsageResponse)obj);
return usageResponseWrapper;
}

For more information on using Java hooks with NPL, see the discussion on Java hooks in Offline Mediation Controller Cartridge Development Kit NPL Reference Guide.