5 Processing Events in Rerate Jobs

Learn how Oracle Communications Billing and Revenue Management (BRM) rerates the events in your jobs when you run the pin_rerate utility in processing mode.

Topics in this document:

About the Rerating Process

After a rerate job is created, BRM, ECE, and the pin_rerate utility work together to process the job as follows:

  1. When you run pin_rerate, it finds all rerate jobs with a NEW status, sends a prepare-to-rerate message to ECE, and then updates the job's status to WAITING_ACCOUNT_LOCK.

  2. ECE sends the rated events in the job to the BRM database to synchronize balances. When done, ECE sends an acknowledgment to pin_rerate.

  3. The pin_rerate utility suspends rating for the accounts associated with the job and updates the job's status to ACCOUNT_LOCKED.

    BRM also begins storing subscription events that occur in the BRM system. After rerating, BRM rates the subscription events and sends any relevant results to ECE. For example, BRM sends balance updates and changes to the purchased offers.

  4. The pin_rerate utility sends the events to rerate to ECE and updates the job's status to RERATED.

  5. ECE rerates the events. ECE performs any necessary balance updates and backouts, and synchronizes the balances for accounts in the rerating requests.

    ECE moves any failed rerating requests to the Suspense queue.

  6. ECE sends the charging results to the BRM database. When done, ECE sends an acknowledgment to the utility.

  7. The pin_rerate utility resumes processing the accounts being rerated and sets the job's status to READY_TO_RECYCLE.

  8. The pin_rerate utility recycles all events suspended during the rerating process and updates the job's status to COMPLETE.

Note:

If ECE cannot rerate events for an account, ECE sends a notification to BRM. In turn, BRM uses the information to create a new rerate job for the account.

During the rerating process, ECE continues rating usage and applying top-ups, but waits until rating completes to send the rated results to the BRM database.

About Processing Rerate Jobs

You process the rerate jobs in the queue by running the pin_rerate utility. You can use the utility to do the following:

While running rerating, you can also specify the order in which to process multiple rerate jobs. See "Specifying the Order to Process Rerate Jobs".

Steps for Processing Rerate Jobs

You rerate the events in your rerate jobs by running the pin_rerate commands in the order shown below. You can run the commands manually or through a cron job.

Note:

Do not move accounts to another database schema while rerating events for those accounts.

To process rerate jobs in the queue, run these commands in order:

pin_rerate -process jobs
pin_rerate -process queue
pin_rerate -rerate
pin_rerate -process queue
pin_rerate -process recycle

For a description of how the utility processes jobs, see "About the Rerating Process".

For more information about the utility's syntax and parameters, see "pin_rerate".

Generating Reports During Rerating

You can specify to generate a report during the rerating process. To do so, include the -l parameter when you run the pin_rerate -rerate command:

pin_rerate -rerate -l[d|s|sd|n]

When you include the -l parameter, the utility generates both a summary report (pin_rerate.summary) and a detailed report (pin_rerate.detail). You can specify the type of report to create by doing the following:

  • To generate only a detailed report, use the -ld parameter:

    pin_rerate -rerate -ld
  • To generate only a summary report, use the -ls parameter:

    pin_rerate -rerate -ls
  • To generate both a detailed report and a summary report, use the -lsd parameter:

    pin_rerate -rerate -lsd
  • To not generate any report, use the -ln parameter:

    pin_rerate -rerate -ln

The following shows the series of commands to run for processing rerate jobs and generating summary and detailed reports:

pin_rerate -process jobs
pin_rerate -process queue
pin_rerate -rerate -l
pin_rerate -process queue
pin_rerate -process recycle

Recycling Records Suspended During Rerating

Temporarily suspended records are loaded into the BRM database by the Suspended Event (SE) Loader. The suspended records are stored in the database until they are recycled.

Note:

Before you can recycle suspended records, they must be loaded into the BRM database by SE Loader. You typically schedule SE Loader to run automatically when you set up standard recycling.

To recycle the records suspended during the rerating process, run pin_rerate with the -process recycle parameter.

Note:

Suspended records are typically recycled by running the pin_recycle utility. However, pin_rerate calls the standard recycling opcode directly so you do not use pin_recycle when using pin_rerate.

The pin_rerate utility finds all rerate jobs with a status of READY_FOR_RECYCLE and calls the standard recycling opcodes to recycle the associated records. Standard recycling uses the recycle key value in the record to identify and retrieve records suspended during the rerating process.

After the records are recycled, pin_rerate changes the status of the jobs from READY_FOR_RECYCLE to COMPLETE.

Note:

  • In a multischema environment, you must run pin_rerate separately on each database schema.

  • If no records were suspended for the accounts being rerated, the job's status is still changed to COMPLETE.

  • If an error occurs while recycling records, the job's status is not changed. It retains the status of READY_FOR_RECYCLE.

Processing Failed Account Events in Rerate Jobs

If rerating fails for one or more accounts in a job, the pin_rerate utility automatically creates a report that includes the account numbers and start times for each failer. The report file is named pin_rerate.status_report and is saved in the directory from where you ran the utility. When the rerating process is complete for the job, pin_rerate creates a new rerate job consisting of events for only the accounts that failed.

To process rerate jobs for accounts that failed, you run the same commands for processing any rerate jobs:

pin_rerate -process jobs 
pin_rerate -process queue
pin_rerate -rerate
pin_rerate -process queue
pin_rerate -process recycle

Note:

This processes all rerate jobs in the queue, and not just failed rerate jobs.

Purging Rerate Jobs

To purge all rerate jobs with a status of COMPLETE or UNSUCCESSFUL from the queue, you use the following syntax:

pin_rerate -purge

You can purge rerate jobs that occurred before a specified date and time by also including the -t parameter:

pin_rerate -purge -t timestamp

where timestamp is the timestamp in [ss/mm/hh/]MM/DD/YYYY format.

For example, this command purges all processed and failed rerate jobs created before 1 May 2023:

pin_rerate -purge -t 05/01/2023

Specifying the Order to Process Rerate Jobs

You may sometimes need to process rerating jobs in a specific order. For example, a job including events that impact future rating, such as quantity-based discounting, must be rerated first.

To specify the order in which to process rerate jobs:

  1. Assign reason codes to your rerate jobs.

  2. Run the pin_rerate utility multiple times, assigning a reason code each time.

To process rerate jobs according to reason codes in a particular order, you must run rerating separately for each reason code. For example, to process a rerate job with reason code 100 first, a job with reason code 101 second, and a job with reason code 102 third, you would do the following:

  1. Run the rerating process for the rerate job with reason code 100:

    pin_rerate -process jobs -reason 100
    pin_rerate -process queue
    pin_rerate -rerate 
    pin_rerate -process queue
    pin_rerate -process recycle
  2. Run the rerating process for the rerate job with reason code 101:

    pin_rerate -process jobs -reason 101
    pin_rerate -process queue
    pin_rerate -rerate 
    pin_rerate -process queue
    pin_rerate -process recycle
  3. Run the rerating process for the rerate job with reason code 102:

    pin_rerate -process jobs -reason 102
    pin_rerate -process queue
    pin_rerate -rerate 
    pin_rerate -process queue
    pin_rerate -process recycle

You can optionally list multiple reason codes at the command line, but the utility will process the jobs randomly. They are not processed in the order you list them at the command line, nor are they processed in increasing or decreasing numeric order. For example, if you run the following command, the utility would process the three jobs in random order:

pin_rerate -process jobs -reason 103,104,105