This chapter provides an overview of customizing the Oracle Communications Billing Care Event Adjustments dialog box to display specific 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.
You can customize the Event Adjustment dialog box using Oracle Entitlements Server (OES) to display only specific reason codes in the list.
To customize the reason codes list displayed in the Event Adjustments dialog box:
Define a new ResourceType and Resource for reason codes in the OES Server. For example, ReasonCodeResourceType, ReasonCodeResource.
Define the reason codes as corresponding actions for the ResourceType in the OES Server.
You can specify Reason ID as the action name when you define the actions.
Add the new ResourceType to the CustomConfigurations.xml file. For example:
<keyvals> <key>authorizationResourceTypes</key> <value>ReasonCodeResourceType</value> <desc>Add comma separated OES Resource Types(values) for authorization. Also these resource types should be defined in OES. Please note that the key should not be changed here. </desc> </keyvals>
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.
Create a customRegistry.js file to configure Billing Care to use the custom view model that you created in step 4. See "Configuring the Custom Event Adjustment View Model in the Registry" for more information.
Deploy your custom payment type projects to your application server. See "Deploying Customizations" for more information.
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:
Create the customEventAdjustmentViewModel.js file in myproject/web/custom/viewmodels directory, where myproject is the folder containing your NetBeans IDE project.
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; });
Save the file in your NetBeans IDE project.
After creating the required custom view model, create a custom 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:
Create a customRegistry.js file in myproject/web/custom/ directory.
Define the custom event adjustment view model in this file. For example:
eventAdjustment: { viewmodel: 'custom/viewmodels/customEventAdjustmentViewModel.js' }
Save the file in your NetBeans IDE project.
Package and deploy your customizations using one of the methods described in "Using an Exploded Archive during Customization" or "Packaging and Deploying Customizations".