20 Customizing Reason Codes List in Event Adjustments

Learn how to customize the Oracle Communications Billing Care Event Adjustments dialog box to display specific reason codes.

Topics in this document:

About Displaying Reason Codes

By default, all the reason codes configured for adjustments are displayed in the Event Adjustment dialog box. When you perform adjustments for events, you can select a reason code from this list to specify the reason for the adjustment.

Customizing Reason Codes List in Event Adjustments

You can customize the Event Adjustment dialog box using OPSS policies to display only specific reason codes in the list.

To customize the reason codes list displayed in the Event Adjustments dialog box:

  1. Create a custom ResourceType and Resource for reason codes in the OPSS Server. For example, ReasonCodeResourceType, ReasonCodeResource.
  2. Define the reason codes as corresponding actions for the ResourceType in the OPSS Server.

    You can specify Reason ID as the action name when you define the actions.

  3. Add the new ResourceType to the CustomConfigurations.xml file. For example:
    <keyvals> 
    <key>authorizationResourceTypes</key> 
    <value>ReasonCodeResourceType</value> 
    <desc>Add comma separated OPSS Resource Types(values) for authorization. 
    Also these resource types should be defined in OPSS. 
    Please note that the key should not be changed here. 
    </desc> 
    </keyvals>
  4. Create a custom view model to define the display of Event Adjustment dialog box. See "Creating the Custom Event Adjustment View Model" for more information.
  5. Create a customRegistry.js file to configure Billing Care to use the custom view model that you created. See "Configuring the Custom Event Adjustment View Model in the Registry" for more information.
  6. Deploy your custom event adjustment project to your application server. See "Deploying Customizations" for more information.

Creating the Custom Event Adjustment View Model

Billing Care uses view model to define the display of the screens in Billing Care. You must create the custom view model, CustomEventAdjustmentViewModel, containing the details to customize the display of reason codes in the Event Adjustment dialog box.

See "About View Models" for more information about Billing Care view models.

To create the custom event adjustment view model:

  1. Create the customEventAdjustmentViewModel.js file in myproject/web/custom/viewmodels directory, where myproject is the folder containing your NetBeans IDE project.
  2. Add the following code in the customEventAdjustmentViewModel.js file using a text editor:
    define(['jquery', 'knockout', 
        'viewmodels/ARActions/adjustments/EventAdjustmentViewModel' 
    ], 
            function($, ko, EventAdjustmentViewModel) { 
                function customEventAdjustmentViewModel() { 
                    EventAdjustmentViewModel.apply(this, arguments); 
                    self = this; 
                    self.notesReasonCodes = ko.computed(function() { 
                        if (self.domainId() !== null) { 
                            self.selectedReasonCode(""); 
                            reasonCodes = 
    Configurations.getReasonCodes(self.domainId()); 
                            filterReasonCodes = []; 
                            for (i = 0; i < reasonCodes.length; i++) { 
                                 
    if(util.isGrantedResourceAction(reasonCodes[i].ReasonID, 
    "ReasonCodeResource")){   //Use newly created resource here 
                                    filterReasonCodes.push(reasonCodes[i]); 
                                } 
                            } 
                        } 
                        return filterReasonCodes; 
                    }); 
                } 
                customEventAdjustmentViewModel.prototype = new EventAdjustmentViewModel(); 
                return  customEventAdjustmentViewModel; 
            });
  3. Save the file in your NetBeans IDE project.

Configuring the Custom Event Adjustment View Model in the Registry

After creating the required custom view model, create a custom event adjustment view model entry in the customRegistry.js file. Billing Care uses the custom event adjustment view model instead of the default event adjustment view model during adjustments and renders the Event Adjustment dialog box containing your customization.

To create the custom event adjustment view model entry in the registry:

  1. Create a customRegistry.js file in myproject/web/custom/ directory.
  2. Define the custom event adjustment view model in this file. For example:
    eventAdjustment: { 
           viewmodel: 'custom/viewmodels/customEventAdjustmentViewModel.js' 
       } 
  3. Save the file in your NetBeans IDE project.

Deploying Customizations

Package and deploy your customizations using one of the methods described in "Using an Exploded Archive during Customization" or "Packaging and Deploying Customizations".