42 Extending and Creating Billing Care REST Resources

This chapter provides an overview of extending the Oracle Communications Billing Care REST framework and creating new REST resources for use with Billing Care.

About Extending and Creating Billing Care REST Resources

Billing Care supports extending the REST framework and creating new REST resources as required by your business needs. The following customizations are supported:

  • Manipulating Workflow

    For example, customizing Billing Care to invoke different Oracle Communications Billing and Revenue Management (BRM) opcodes, either for data retrieval or persistence. A typical scenario is a customer who has created a custom opcode similar to one provided by Oracle but with alternate business logic that cannot not otherwise be provided through the associated policy opcode. An alternate scenario might involve invocation of an API from an application other than BRM.

  • Payload Manipulation

    For example, manipulating or inspecting the payload before invocation of an opcode. An example scenario involves a web service that returns an error condition after validating the payload, before invoking the opcode. Another scenario might involve custom logic applied to the data before submission of a payload to BRM.

  • Creating a new REST resource

    For example, a new REST resource used by a customized module to retrieve additional data for display.

About Billing Care Sample SDK REST Customizations

The Billing Care SDK contains the following example REST customizations located in the SDK_home/BillingCare_SDK/samples/REST_Scenarios/src/com/rest/sdk where SDK_home is the directory where you installed the SDK:

  • To call a new opcode in a customized module, refer to CustomNewOpCodeBillUnitModule.java and CustomBillUnitWorker.java.

  • To modify data sent to BRM, refer to CustomPaymentModule.java.

  • To alter the application logic or support subclassing ready to use module classes, refer to CustomExtendAdjustmentModule.java.

For more information on invoking BRM opcodes through the Java API, see "About the PCM API" in Oracle Communications Billing and Revenue Management Developer's Guide and Oracle Communications Billing Care Java API Reference.

Extending REST Services

To extend REST services:

  1. Create the Java classes and necessary resources (views, view models, CSS, validations) in the appropriate myproject/src/package directory for your implementation (for example, myproject/src/com/company/billingcare where company is the name of your company).

    You can implement new functionality, override existing functionality, or add functionality by extending the Billing Care classes (from the jars added to classpath).

    Note:

    Any REST resources/services you create for Billing Care must be placed within the com.oracle.communications.brm.cc.ws package (myproject/src/com/oracle/communications/brm/cc/ws). This will ensure your REST resource/service can be deployed within the customizations shared library.
  2. Compile the new Java classes.

  3. Create a customModules.properties file in your myproject/web/WEB-INF/classes/custom/ directory, where myproject is your NetBeans IDE project containing your Billing Care customizations. This file will contain a reference to the location of the custom Java classes you create. See "About the customModules.properties File" for more information about specifying module overrides with customModules.properties.

  4. Copy the default registry.js file from SDK_HOME/BillingCare_SDK/references to a custom registry file named customRegistry.js in your myproject/web/custom directory, where myproject is your NetBeans IDE project containing your Billing Care customizations. This file contains the module definitions for your custom view models (JavaScript). See "About the Registry File" for more information on using a custom registry file.

  5. Add your customization files to your NetBeans IDE project (myproject):

    • Add any JavaScript to support your custom view models in the myproject/web/js directory.

  6. Right-click your NetBeans IDE project and select Clean and Build.

  7. Package and deploy your customizations to your Billing Care domain.

    For more information, see "Packaging and Deploying Customizations".

  8. Verify your changes in Billing Care.