This chapter provides an overview of customizing the Oracle Communications Billing Care to set the maximum adjustment limit based on the currency resources used for event adjustments.
Typically, customer service representatives (CSRs) perform the adjustments by providing the adjustment amount to be applied for the customer. You can set an adjustment limit for a CSR to control the adjustment amount entered by the CSR. For event adjustments, you can customize Billing Care to set the maximum adjustment limit allowed for a CSR based on the currency resources used for the adjustments. For example, you can set an adjustment limit of $10 for USD and 5 euro for EUR for a CSR to perform event adjustments.
To set the event adjustment limit for a CSR:
If not already created, create a custom ResourceType and Resource (for example, AdjustmentResourceType, AdjustmentResource) with the adjustment action in the OES Server and add the ResourceType to the CustomConfigurations.xml file. See "Creating a Custom Configuration File" for more information.
Add an obligation (for example, Maximum Adjustment Limit) in the custom adjustment resource with a string (for example, 840, the currency code for US dollars) for a policy using OES. For more information on adding obligations, see Oracle Fusion Middleware Administrator's Guide for Oracle Entitlements Server.
Set the maximum adjustment limit you want to allow for the CSR for a currency resource as the obligation value in the OES Server. For example, $10 for USD.
Create a custom REST resource to validate the adjustment amount entered in the Event Adjustment dialog box. See "Creating customAdjustmentResource.java Class" for more information.
Create or update the customEventAdjustmentViewModel.js class file to override the default event adjustment flow. See "Creating the Custom Event Adjustment View Model" for more information.
Configure the custom view model entry in the customRegistry.js file to use the custom view model that you created or updated. See "Configuring the Custom Event Adjustment View Model in the Registry" for more information.
Deploy your customizations using one of the methods described in "Using an Exploded Archive during Customization" or "Packaging and Deploying Customizations".
Verify the changes in Billing Care by doing the following:
Log into Billing Care as a CSR who has adjustments action granted and maximum adjustment limit set.
In the Events dialog box, select events and click Adjust.
The Event Adjustment dialog box appears.
Select an adjustment option and enter the adjustment amount you want to adjust.
If the amount entered is less than the obligation value, the specified amount is adjusted. If the amount entered is more than the obligation value, an error message is displayed. For example, "For this currency you have exceed Max adjustment limit."
You can override the existing event adjustment flow with your customization by using REST resources. Create a custom resource Java class to validate the event adjustment amount against the obligation value.
To create a customAdjustmentResource.java Class:
Create the customAdjustmentResource.java class file in myproject/projectname/src/java/com/oracle/communications/brm/cc/ws/account, where myproject is your NetBeans IDE Billing Care customizations project and projectname is the name of your custom project.
Add the following code in the customAdjustmentResource.java class file using a text editor:
//Create a custom REST with class named as "customAdjustmentResource" // Add method "adjustEvent" which takes parameter "AdjustmentEvent" //This custom REST validates entered amount to adjust with the obligation and then calls the OOTB REST resource. @Path("customadjustment") public class CustomAdjustmentResource { @Context HttpServletRequest servletRequest; @Path("/event") @POST @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) public void eventAdjustment(AdjustmentEvent adjustEvent) throws JSONException, IOException { UIRequestValue maxAdjustmentLimit = new UIRequestValue(adjustEvent.getResourceId().toString(), adjustEvent.getAmount(), ConstraintOperator.GREATER_THAN, new EnforcementError(40010,"For this currency you have exceed Max adjustment limit.")); //Checks if user is not super csr and UI value is greater than OES obligation value and throws error "For this currency you have exceed Max limit." if (!EnforcementUtil.isResourceGranted(servletRequest, subject, "BillingCare", EnforcementConstants.SUPERUSER_RESOURCE)) { EnforcementUtil.checkAccess(subject, "BillingCare", "adjustment", "AdjustmentResourceType","AdjustmentResource", new EnforcementError(20000, "You do not have permission to perform an adjustment."), maxAdjustmentLimit); } } /* *After validating maximum validity end month criteria invoke out of the box code to perform adjustment. */ }
Save the file in your NetBeans IDE project.
Billing Care uses view model to define the display of the screens in Billing Care. You must create or update the custom view model, CustomEventAdjustmentViewModel, containing the details to set the adjustment limit for CSRs performing event adjustments.
See "About View Models" for more information about Billing Care view models.
To create the custom event adjustment view model:
Create or update 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(['knockout', 'jquery', 'underscore', Registry.accountCreation.wizardBase, 'viewmodels/ARActions/adjustments/EventAdjustmentViewModel'], function (ko, $, _, WizardBaseViewModel, EventAdjustmentViewModel) { customEventAdjustmentViewModel.prototype = new WizardBaseViewModel(); function customEventAdjustmentViewModel() { EventAdjustmentViewModel.apply(this, arguments); var self = this; self.persistData = function (eventAdjustmentObj) { var ajaxDef = $.ajax({ type: "POST", url: baseURL + "/customadjustment/event/", data: ko.toJSON(eventAdjustmentObj), contentType: "application/json; charset=utf-8", dataType: "json", processData: false }); ajaxDef.done(function (completeResponse) { }); ajaxDef.fail(function (errorThrown) { alert(errorThrown.responseJSON.errorMessage); }); return ajaxDef; }; } return customEventAdjustmentViewModel; });
Save the file in your NetBeans IDE project.
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:
Create a customRegistry.js file in myproject/web/custom/ directory.
Define the custom event adjustment view model entry in this file. For example:
eventAdjustment: { viewmodel: 'custom/viewmodels/customEventAdjustmentViewModel.js' }
Save the file in your NetBeans IDE project.