Class CDRModel

java.lang.Object
com.highdeal.bart.hci.CDRModel
All Implemented Interfaces:
XMLMarshallable, Comparable<CDRModel>

public class CDRModel extends Object implements XMLMarshallable, Comparable<CDRModel>
A Consumption Detail Record (CDR) represents a customer service usage; This information data record includes the characteristics of the service consumption by an end customer of the service provider. The system uses this information to monetize (rate and charge) each usage of customer service.

Note

In Telecommunications Industry, a CDR stands for Call Detail Record. It relates to a telephone call.

Structure

Each CDR stored in the BART Database has:

  • a unique ID (OID) set by the SAP CC BART Server system during the CDR acquisition processing
  • a CDR status

The original CDR includes the following information:

  • User Service ID (USID) - the technical identifier of the end customer who consumed a customer service
  • Service ID (SID) - the technical identifier of customer service
  • Consumption date of the customer service
  • Various service usage characteristics included in a chargeable item as custom properties
    • Acquisition date, and rating date
    • Batch rating group ID define in SAP CC
    • Subscription ID (or provider contract ID) recorded during the CDR consolidation
    • Partition ID of the customer master data (subscriber account, provider contract, subscription)
    • chargeID in the subscription (or provider contract)
    • Numerical error code and its description
    • Acquisition ID
    • Rating ID
    • Source
    • Magic number for deduplication function
    • PROPERTIES
    • SNAPSHOT_ID
    • CHARGE_TYPE

The CDR data model defines the content of a consumption detail record in SAP CC BART Server and its back-end database (see the CDR table). CDR models keep dialing data such as consumption date and user accesses in database in order to batch charge them on SAP CC systems. CDRs are linked through all 3 BART processes: offline acquisition process, consolidation process and batch charging process.

Besides CDRs data, each CDR has a status that evolves during these processes.

CDR Status

Error Codes

Refer to the SAP Note 1775256 - CDR Error Codes documentation for detailed information about codes resulting from the batch charging processing. This documentation provides action plans to resolve the issues during the batch charging operations.

Implementation in Your Client Application

CDR Offline Acquisition

You develop the initial conversion of the transactional data available in your offline mediation system to the CDR format that SAP CC BART Server can manage during the acquisition process.

In your client application or system, you must set up the following CDR fields with the relevant dialing data:

  • Service consumption date
  • User service ID (USID) and service ID (SID), which correspond to an access data stored in SAP CC; This access relates to a provider contract or to a subscription.
  • Source, which is an optional data and inform the source of the CDRs (e.g.: filename)
  • Chargeable item, with the name of one the CDR family, defined in configuration
  • Other dialing data used for the rating should be put as property in the chargeable item

You implement the CDRModel(..) constructor.

On the server system side, acquisition process will filled following fields:
  • CDR ID, which corresponds to the CDR's unique identifier
  • Acquisition date
  • Acquisition ID, which corresponds to the acquisition session ID
  • Magic number, which identify a CDR among the others

CDR is then inserted in the SAP CC BART database, waiting for business operations: modification, batch charging. See AcquisitionSessionModel for information about the acquisition process.

Consolidation

During the acquisition process, a consolidation process is done

The consolidation process tries to fetch CDR's subscription information usable for the rating process. It fills the following fields:

  • Subscription ID, which corresponds to the identifier of the root subscription linked with the CDR
  • Batch rating group Id, which corresponds to the batch rating group Id of the subscription
  • Partition ID, which corresponds to the identifier of the partition of the subscription
  • Charge ID, which corresponds to the identifier of the activation charge linked with CDR's access
  • CDRs that have been successfully consolidated have the status STATUS_NEW.
  • If consolidation failed for these CDRs, their statuses became "no_provisioning" and the batch rating group became -"2".
  • If the consolidation is successful, but the CDR's subscription is only online type, the CDR status became "online subscription" and the CDR batch rating group became "-1". In those both cases, a manual consolidation is needed before to rate those CDRs. Use the SAP CC BART Tool user interface.

Batch Charging (Rating)

Finally the CDR is rated with the rating process. An application administrator triggers the batch charging operation with the BART Tool user interface.

The rating process selects every CDRs with:
  • A batch rating group identifier that corresponds to the rating process
  • A consumption date before the rating process's max consumption date
  • A CDR's status equals to STATUS_NEW or STATUS_ERROR
Other CDRs will be ignored by the rating process.
Result:

Following fields will be updated during this process:

  • Rating date
  • Rating ID, which corresponds to the batch charging (rating) session identifier
When the CDR rating is successful, the status becomes STATUS_RATED. When a batch charging (rating) error occured, the status becomes STATUS_ERROR and the following fields will be filled:
  • Error code, which corresponds to BART type of errors
  • Error description, which corresponds to the description of this particular errors
See also the RatingSessionModel for information about rating process.

Note

Refer to SAP CC Application Help for more information about the features and processes in SAP Convergent Charging.

Rerating

A CDR can be rerated through the rerating process in case or erroneous CDR, errors in pricing logic, or errors in invoices.

In this process, selected already rated and charged CDRs are rerated. This process is completely handled by the SAP CC Core Server system connected to the BART Server system. After the correction of the error, the rerating process includes the re-injection, re-charging, and re-invoicing processes.

CDRs selected for rerating have the status STATUS_TO_BE_RERATED.

XML API for HCI

The XML APIs specify the following XSD fragment:

XSD Fragment

<xs:element name="cdr">
  <xs:complexType>
    <xs:sequence>
      <xs:element ref="ci" minOccurs="1" maxOccurs="1"/>
    </xs:sequence>
    <xs:attribute name="cdrID" type="xs:string"/>
    <xs:attribute name="batchRatingGroupId" type="xs:int"/>
    <xs:attribute name="userID" type="xs:string" use="required"/>
    <xs:attribute name="serviceID" type="xs:string" use="required"/>
    <xs:attribute name="subscriptionID" type="xs:string"/>
    <xs:attribute name="consumptionDate" type="xs:dateTime" use="required"/>
    <xs:attribute name="status" type="cdrStatusType"/>
    <xs:attribute name="acquisitionDate" type="xs:dateTime"/>
    <xs:attribute name="acquisitionID" type="xs:string"/>
    <xs:attribute name="ratingDate" type="xs:dateTime"/>
    <xs:attribute name="ratingID" type="xs:string"/>
    <xs:attribute name="errorCode" type="xs:string"/>
    <xs:attribute name="errorDescription" type="xs:string"/>
    <xs:attribute name="source" type="xs:string"/>
    <xs:attribute name="magicNumber" type="xs:string"/>
    <xs:attribute name="snapshotID" type="xs:int"/>
  </xs:complexType>
 </xs:element>
<xs:simpleType name="cdrStatusType">
   <xs:restriction base="xs:string">
     <xs:enumeration value="new"/>
     <xs:enumeration value="error"/>
     <xs:enumeration value="rated"/>
     <xs:enumeration value="duplicate"/>
     <xs:enumeration value="ignored"/>
     <xs:enumeration value="to_be_rerated"/>
     <xs:enumeration value="no_provisioning"/>
     <xs:enumeration value="online_subscription"/>
   </xs:restriction>
 </xs:simpleType>

  • Field Details

    • STATUS_NEW

      public static final int STATUS_NEW
      0: This CDR status indicates that the CDR has been correctly acquired and consolidated. It is stored in the BART Database for further operations (mainly batch charging).
      See Also:
    • STATUS_ERROR

      public static final int STATUS_ERROR
      1: This CDR status indicates that an attempt of batch charging (rating) has been done but an error occured in the SAP Core Server system; See the numerical error code with the getErrorCode() method.
      See Also:
    • STATUS_RATED

      public static final int STATUS_RATED
      2: This CDR status indicates that the CDR has been successfully rated and charged by the SAP Core Server system responsible for processing the batch charging operations requested by the SAP CC BART Server system
      See Also:
    • STATUS_DUPLICATE

      public static final int STATUS_DUPLICATE
      3: This CDR status indicates that the CDR is a duplicate
      See Also:
    • STATUS_IGNORED

      public static final int STATUS_IGNORED
      4: This CDR status indicates that the CDR will be ignored by the next rating session. It has to be manually set
      See Also:
    • STATUS_TO_BE_RERATED

      public static final int STATUS_TO_BE_RERATED
      6: This CDR status indicates that the CDR is selected to be rerated through SAP CC rerating operation
      See Also:
    • STATUS_NO_PROVISIONING

      public static final int STATUS_NO_PROVISIONING
      7: This CDR status indicates that the CDR has been acquired but not consolidated
      See Also:
    • STATUS_ONLINE_SUBSCRIPTION

      public static final int STATUS_ONLINE_SUBSCRIPTION
      8: This CDR status indicates that the CDR is linked to an online subscription and not a offline one
      See Also:
    • BRGRP_ONLINE_SUBSCRIPTION

      public static final int BRGRP_ONLINE_SUBSCRIPTION
      INTERNAL USE ONLY - Reserved for internal used
      See Also:
    • BRGRP_NO_PROVISIONING

      public static final int BRGRP_NO_PROVISIONING
      INTERNAL USE ONLY - Reserved for internal used
      See Also:
    • NO_SUBSCRIPTION

      public static final long NO_SUBSCRIPTION
      INTERNAL USE ONLY - Reserved for internal used
      See Also:
    • NO_SUAC_ID

      public static final long NO_SUAC_ID
      See Also:
    • STATUS_RATING_IN_PROGRESS

      @Deprecated public static final int STATUS_RATING_IN_PROGRESS
      Deprecated.
      - Not use since Highdeal BART Release 1.2 software version - Revoked since version 1.0 of SAP CC
      See Also:
    • TAG_NAME

      public static final String TAG_NAME
      The XML tag name of this data model: "cdr"
      See Also:
  • Constructor Details

    • CDRModel

      public CDRModel()
      Builds an empty CDR model
    • CDRModel

      public CDRModel(com.highdeal.pnr.hci.ChargeableItem item, String userID, String serviceID, Date consumptionDate, String source)
      Builds a CDR with a chargeable item (see here), source, and access information; This constructor should be used to implement the acquisition process in your client application via the Message TCP technical interface (see the AcquireCDROp class) or the HTTP Communication Interface (HCI) technical interface (see the CDRServiceClient class).
      Parameters:
      item - The chargeable item
      userID - The user service ID (USID) - a technical key that identifies the end customer of the service
      serviceID - The customer service ID (SID) - a technical key that identifies the customer service or a subservice
      consumptionDate - The service usage date
      source - The source information (network element identifier, ...)
      See Also:
    • CDRModel

      @Deprecated public CDRModel(Long OID, Integer batchRatingGroupId, com.highdeal.pnr.hci.ChargeableItem item, String userID, String serviceID, Long subscriptionID, Short partitionID, Long chargeID, Date consumptionDate, Date acquisitionDate, Date ratingDate, int errorCode, String errorDescription, int status, Long acquisitionID, Long ratingID, String source, String magicNumber)
      Deprecated.
      INTERNAL USE ONLY - Builds a CDR model with full information.
      This constructor should be reserved for internal use.
    • CDRModel

      public CDRModel(Long OID, Integer batchRatingGroupId, com.highdeal.pnr.hci.ChargeableItem item, String userID, String serviceID, Long subscriptionID, Short partitionID, long suacID, Long chargeID, Date consumptionDate, Date acquisitionDate, Date ratingDate, int errorCode, String errorDescription, int status, Long acquisitionID, Long ratingID, String source, String magicNumber)
      INTERNAL USE ONLY - Builds a CDR model with full information.
      This constructor should be reserved for internal use.
    • CDRModel

      @Deprecated public CDRModel(Long OID, com.highdeal.pnr.hci.ChargeableItem item, String userID, String serviceID, Integer batchRatingGroupId, Long subscriptionID, Short partitionID, Long chargeID, Date consumptionDate, int status)
      Deprecated.
      INTERNAL USE ONLY - Builds a CDR model with rating information.
      This constructor should be reserved for internal use.
    • CDRModel

      public CDRModel(Long OID, com.highdeal.pnr.hci.ChargeableItem item, String userID, String serviceID, Integer batchRatingGroupId, Long subscriptionID, Short partitionID, long suacID, Long chargeID, Date consumptionDate, int status)
      INTERNAL USE ONLY - Builds a CDR model with rating information.
      This constructor should be reserved for internal use.
  • Method Details

    • duplicate

      public CDRModel duplicate()
      Duplicates a CDR model; The result is a new object with same values, even the CDR ID.
      Returns:
      CDRModel The duplicated CDR model
    • setCDRIgnored

      public void setCDRIgnored()
      Sets the CDR to the status "ignored".
    • setCDRNew

      public void setCDRNew()
      Sets the CDR to the status "new".
    • getAcquisitionDate

      public Date getAcquisitionDate()
      Gets the acquisition date of the CDR model.
      Returns:
      The acquisition date of the CDR model
    • _setAcquisitionDate

      public void _setAcquisitionDate(Date acqDate)
      Sets the acquisition date of the CDR model.
      Parameters:
      acqDate - The acquisition date
    • getAcquisitionID

      public Long getAcquisitionID()
      Gets the acquisition session identifier.
      Returns:
      the acquisition session identifier.
    • _setAcquisitionID

      public void _setAcquisitionID(Long acqID)
      Sets the acquisition session identifier.
      Parameters:
      acqID - the acquisition session identifier
    • getRatingID

      public Long getRatingID()
      Gets the rating session identifier.
      Returns:
      the rating session identifier.
    • _setRatingID

      public void _setRatingID(Long ratID)
      Sets the rating session identifier.
      Parameters:
      ratID - the rating session identifier
    • getConsumptionDate

      public Date getConsumptionDate()
      Gets the consumption date of the CDR model.
      Returns:
      the consumption date of the CDR model.
    • setConsumptionDate

      public void setConsumptionDate(Date consumptionDate)
      Sets the consumption date of the CDR model.
      Parameters:
      consumptionDate - the consumption date of the CDR model
    • getBatchRatingGroupId

      public Integer getBatchRatingGroupId()
      Gets the batch rating group identifier.
      Returns:
      the batch rating group identifier.
    • _setBatchRatingGroupId

      public void _setBatchRatingGroupId(Integer bgrp)
      Sets the batch rating group identifier
      Parameters:
      bgrp - the batch rating group identifier
    • getMagicNumber

      public String getMagicNumber()
      Gets the magic number of the CDR model.
      Returns:
      the magic number of the CDR model.
    • get32MagicNumber

      public String get32MagicNumber()
      Gets the magic number of the CDR model.
      Returns:
      the magic number of the CDR model.
    • _getDatabaseMagicNumber

      public String _getDatabaseMagicNumber()
    • _setMagicNumber

      public void _setMagicNumber(String mNumber)
      Sets the magic number of the CDR model.
      Parameters:
      mNumber - the magic number
    • getName

      public String getName()
      Gets the CDR name.
      Returns:
      the CDR name.
    • setName

      public void setName(String name)
      Sets CDR name by setting item name
      Parameters:
      name - new CDR name
      See Also:
      • ChargeableItem.setName(String name)
    • getChargeableItem

      public com.highdeal.pnr.hci.ChargeableItem getChargeableItem()
      Gets the chargeable item of the CDR model.
      Returns:
      the chargeable item of the CDR model.
    • setChargeableItem

      public void setChargeableItem(com.highdeal.pnr.hci.ChargeableItem item)
      Sets the chargeable item of the CDR model.
      Parameters:
      item - the chargeable item
    • _getOID

      public Long _getOID()
      Gets the CDR model identifier.
      Returns:
      the CDR model identifier.
    • _setOID

      public void _setOID(Long oid)
      Sets the CDR model identifier.
      Parameters:
      oid - the CDR model identifier
    • getRatingDate

      public Date getRatingDate()
      Gets CDR model rating date.
      Returns:
      the CDR model rating date.
    • _setRatingDate

      public void _setRatingDate(Date ratDate)
      Sets the CDR model rating date.
      Parameters:
      ratDate - The rating date
    • getErrorCode

      public int getErrorCode()
      Gets the error code.
      Returns:
      The error code
      See Also:
    • _getOriginalErrorCode

      public int _getOriginalErrorCode()
    • _setErrorCode

      public void _setErrorCode(int ratingError)
      SAP CC BART Server sets up the error code received from SAP CC Core Server.
      Parameters:
      ratingError - The rating error
    • _setOriginalErrorCode

      public void _setOriginalErrorCode(int ratingError)
    • getErrorDescription

      public String getErrorDescription()
      Gets the error description.
      Returns:
      The error description
    • _getOriginalErrorDescription

      public String _getOriginalErrorDescription()
    • _setErrorDescription

      public void _setErrorDescription(String description)
      SAP CC BART Server sets up the error description.
      Parameters:
      description - The error description
    • _setOriginalErrorDescription

      public void _setOriginalErrorDescription(String description)
    • getServiceID

      public String getServiceID()
      Gets the technical ID of the customer service.
      Returns:
      The service ID
    • setServiceID

      public void setServiceID(String serviceID)
      Sets the service ID.
      Parameters:
      serviceID - The service ID
    • getSource

      public String getSource()
      Gets the CDR source.
      Returns:
      The currently defined CDR source
    • setSource

      public void setSource(String source)
      Sets the CDR source.
      Parameters:
      source - The CDR source
    • getStatus

      public int getStatus()
      Gets the CDR status.
      Returns:
      The current CDR status
    • _setStatus

      public void _setStatus(int s)
      Sets the CDR status.
      Parameters:
      s - The new status
    • _getOriginalStatus

      public int _getOriginalStatus()
    • getUserID

      public String getUserID()
      Gets the user ID.
      Returns:
      the user ID.
    • setUserID

      public void setUserID(String userID)
      Sets the user ID.
      Parameters:
      userID - The user ID
    • getSubscriptionID

      public Long getSubscriptionID()
      Gets the subscription identifier.
      Returns:
      The subscription identifier
    • _setSubscriptionID

      public void _setSubscriptionID(Long subID)
      Sets the subscription identifier.
      Parameters:
      subID - The subscription identifier
    • getPartitionID

      public Short getPartitionID()
      Gets the partition identifier.
      Returns:
      The partition identifier
    • setPartitionID

      public void setPartitionID(Short partitionID)
      Sets the partition identifier.
      Parameters:
      partitionID - The partition identifier
    • getSuacID

      public Long getSuacID()
      Gets the subscriber account identifier
      Returns:
      The subscriber account identifier
    • setSuacID

      public void setSuacID(long suacID)
      Sets the partition identifier.
      Parameters:
      partitionID - The partition identifier
    • _setSnapshotID

      public void _setSnapshotID(int snapshotID)
      Sets the snapshot identifier used to rate event.
      Parameters:
      snapshotID - The snapshot identifier that uses format YYYYMMDD
    • getSnapshotID

      public int getSnapshotID()
      Gets the snapshot identifier used to rate event.
      Returns:
      The snapshot identifier that uses format YYYYMMDD
    • getChargeID

      public Long getChargeID()
      Gets the charge identifier.
      Returns:
      The charge identifier
    • setChargeID

      public void setChargeID(Long chargeID)
      Sets the charge identifier.
      Parameters:
      chargeID - The charge identifier
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • setAttributes

      public void setAttributes(XMLAttributes atts)
      Description copied from interface: XMLMarshallable
      Sets the attributes of the XML representation of the element being processed.
      Specified by:
      setAttributes in interface XMLMarshallable
      Parameters:
      atts - The XML attributes of the current element
    • addChild

      public void addChild(String tagName, XMLMarshallable child)
      Description copied from interface: XMLMarshallable
      Adds a child to the object, the child representing the marshallable object which must be added to the element.
      Specified by:
      addChild in interface XMLMarshallable
      Parameters:
      tagName - The name of tag for the child
      child - The child to be added
    • addCharacterData

      public void addCharacterData(String cData)
      Description copied from interface: XMLMarshallable
      Adds character data to the content element.
      Specified by:
      addCharacterData in interface XMLMarshallable
      Parameters:
      cData - The character data to be added
    • marshal

      public void marshal(XMLOutputter output)
      Description copied from interface: XMLMarshallable
      Gives an XML representation of this object, including its children.
      Specified by:
      marshal in interface XMLMarshallable
      Parameters:
      output - The XML output to marshal the object into
    • compareTo

      public int compareTo(CDRModel that)
      Specified by:
      compareTo in interface Comparable<CDRModel>
    • compareKey

      public Long compareKey()
    • _setCompareKey

      public void _setCompareKey(Long compareKey)
    • _setAccessibleChargeType

      public void _setAccessibleChargeType(com.highdeal.pnr.hci.AccessibleChargeType accessibleChargeType)
    • _getAccessibleChargeType

      public com.highdeal.pnr.hci.AccessibleChargeType _getAccessibleChargeType()