19 Customizing Search Filter for Suspended Payments

This chapter describes how to customize the search filter to find suspended payments in Oracle Communications Billing Care.

About Suspended Payment Search Filter

Oracle Communications Billing and Revenue Management (BRM) automatically suspends subscriber payments that do not include sufficient information to associate the payment with an account. For example, BRM suspends payments made to unidentifiable accounts or incorrect bill numbers.

You can use the Payment filter to find suspended payments. To narrow your suspended payment search results, use the filters provided under Payment, Suspense, and Account groups. Each search group has a set of default search criteria. See the discussion about working with suspended payments in Oracle Communications Billing Care Online Help for more information on searching suspended payments.

Adding Search Criteria

Search filter includes groups and criteria. You can add custom criteria to the following groups to customize search filter:

  • Payment

  • Suspense

  • Account

To add search criteria to search groups:

  1. Create a template with new search criteria. See "Creating a CustompaymentSuspenseSearch.xml File" for more information.

  2. Create a java class file to add custom logic. See "Creating a CustomTemplatePaymentSuspenseWorker.java Class" for more information.

  3. Create a custom template module class file to override default search criteria. See "Creating CustomPCMTemplateModule.java Class" for information.

  4. Create a properties file to mention the custom Template Module class. See "Creating a customModule.properties File" for more information.

  5. Add an entry in the registry to override the out-of-the-box view and filter files. See "Updating Registry" for more information.

  6. Add new criteria for payment suspense search to the interface. See "Updating customPaymentSuspenseSearchView.html" for more information.

  7. Edit view model to handle new criteria. See "Updating View Model" for more information.

  8. Localize the new criteria to other languages. See "Localizing New Criteria into Other Languages" for more information.

  9. Create a deployment plan for your customizations. See "Creating Deployment Plan" for more information.

  10. Create a .war file to deploy your customizations. See "Creating .war File" for more information.

Creating a CustompaymentSuspenseSearch.xml File

Create a copy of the default template paymentSuspenseSearch.xml file and add new search criteria to the filter section of the file.

To create a custom payment suspense search template:

  1. Copy paymentSuspenseSearch.xml file from SDK_home/BillingCareSDK/references/paymentsuspensetemplates directory to myproject/projectname/src/java/custom/paymentsuspensetemplates directory,

    where:

    • SDK_home is the Billing Care SDK installation directory

    • myproject is the folder containing your NetBeans IDE project

    • projectname is the name of your custom project. For example, SuspenseSearchFilter.

  2. Rename the copied XML file to CustompaymentSuspenseSearch.xml.

  3. Edit CustompaymentSuspenseSearch.xml and add the new search criteria in the filter section of the XML file. Example 19-1 shows an example of adding bank account criteria to the filter.

  4. Save the file in your NetBeans IDE project.

Example 19-1 Sample Search Criteria in CustompaymentSuspenseSearch.xml

<filter>
………
………
………
<criteria name="bankAccountNo">
            <inputType>Text</inputType>
            <fieldKey>checkInfo.bankAccountNo</fieldKey>
            <storableClass>/event/billing/payment</storableClass> 
        </criteria>……..
…….. ……
</filter>

Note:

Ensure the storable class for new criteria is base class. In this example, base class is /event/billing/payment. Do not add the subclass directly, such as /event/billing/payment/check.

Creating a CustomTemplatePaymentSuspenseWorker.java Class

Create a custom template worker class containing logic to search suspense payments based on new criteria. A sample CustomTemplatePaymentSuspenseWorker.java file is provided in the SDK_home/BillingCareSDK/samples/PaymentSuspenseSearchFilter /src/java/custom/com/rest/sdk directory.

To create a custom payment suspense worker class:

  1. Create a CustomTemplatePaymentSuspenseWorker.java file in myproject/projectname/src/java/com/rest/sdk.

  2. Override buildPaymentSuspenseInputFList and constructFilterForInputFlist as shown in the sample CustomTemplatePaymentSuspenseWorker.java file.

  3. Add the custom storable classes for the payment based on the new payment criteria subclass. Example 19-2 shows an example of adding bank account criteria to the filter.

    Example 19-2 Sample Custom Payment Suspense Storable Class

    if (strKey.contains("cashInfo")) {
                            if (!storableClass.equals("") && !storableClass.equals("/cash")) {
                                return null;
                            }
                            storableClass = "/cash";
    
  4. Save the file in your NetBeans IDE project.

Creating CustomPCMTemplateModule.java Class

Create a custom template module class and override the getRecordsForTemplate() method.

To create a custom template module class:

  1. Create CustomPCMTemplateModule.java file in myproject/projectname//src/java/com/rest/sdk.

  2. Override the getRecordsForTemplate() method as shown in Example 19-3.

    Example 19-3 Override getRecordsForTemplate()

    @Override    public List<ColumnarRecord> getRecordsForTemplate(String templateType, String id, String secondaryId, int offset, int limit, SearchCriterias searchCriteria, List<GenericTemplate.SortbyFields> sortByFields) {        PortalContext ctx = null;        try {            BaseOps baseOps = getBaseOps();            if (baseOps instanceof PCMBaseOps) {                ctx = BRMUtility.getConnection();                ((PCMBaseOps) baseOps).setContext(ctx);            }
    
  3. Call CustomTemplatePaymentSuspenseWorker.java class as shown in Example 19-4.

    Example 19-4

    if (templateType.equalsIgnoreCase("paymentsuspensesearch")) {
                    templateWorker = new CustomTemplatePaymentSuspenseWorker();
                }
    
  4. Save the file in your NetBeans IDE project.

Creating a customModule.properties File

Create a custom module property file to override the default module logic with your customizations.

To create a custom module property file:

  1. Create customModule.properties file in myproject/projectname/src/java/custom.

  2. Add the following entry:

    billingcare.rest.template.module = com.rest.sdk.CustomPCMTemplateModule
    
  3. Save the file in your NetBeans IDE project.

Updating Registry

After creating the required custom view model, add a custom module entry in the customRegistry.js file to include the new criteria to the filter. Use the correct registry key to add the custom module in the customRegistry.js file.

The available registry keys are:

  • paymentFilter

  • suspenseFilter

  • accountFilter

To add an entry in the customRegistry.js file:

  1. Edit the customRegistry.js file in myproject/projectname/web/custom.

  2. Add an entry as shown in Example 19-5. In this example, the customRegistry contains accountFilter registry key because the new criteria is added to account group of filter section.

    Example 19-5 Sample Custom Payment Suspense Module Registry Entry to Filter Accounts

    var CustomRegistry = {    paymentSuspenseSearch: {
          view: 'text!../custom/templates/paymentSuspense/customPaymentSuspenseSearchView.html',
          accountFilter:  'custom/viewmodels/paymentSuspense/customPaymentSuspenseSearchAccountFilterViewModel.js'
       }
    };
    
  3. Save the file in your NetBeans IDE project.

Updating customPaymentSuspenseSearchView.html

Customize customPaymentSuspenseSearchView.html to add a new criteria for payment suspense search.

To add new criteria for payment suspense search in the customPaymentSuspenseSearchView.html file:

  1. Edit the customPaymentSuspenseSearchView.html file in myproject/projectname/web/custom/templates/paymentSuspense.

  2. Add new criteria for payment suspense search as shown in Example 19-6.

  3. Save the file in your NetBeans IDE project.

Example 19-6 Sample Custom Payment Suspense Search View Criteria

<div class="oj-row filter-header">
                    <div class="oj-col oj-lg-12">
                        <label id="payment-filter-bank-account-number-label" data-bind="text: bankAccountNoHeading, attr: {'for': 'selected-bill-account-number'}" class="payment-suspense-search-filter-label"></label>
                    </div>
                </div>
                <div class="oj-row">
                    <div class="oj-col oj-lg-12">
                        <div id="selected-bank-account-number" class="items-wrapper" data-bind="foreach: bankAccountNo">
                            <div class="token-item">
                                <span data-bind="text: $data, attr: {title: $data}"></span>
                                <i class="icon" tabindex="0" data-bind="click: $parent.removeBankAccountNo, event: { keyup : $parent.removeBankAccountNoOnEnterOrSpace} "></i>
                            </div>
                        </div>
                    </div>
                </div>

Updating View Model

Update the view model to handle new criteria. For example, update CustomPaymentSuspenseSearchAccountFilterViewModel.js to handle new criteria in account group. If a criteria is added to suspense or payment group then update the corresponding custom view model.

The available filter view models are:

  • PaymentSuspenseSearchPaymentFilterViewModel

  • PaymentSuspenseSearchSuspenseFilterViewModel

  • PaymentSuspenseSearchAccountFilterViewModel

To update a view model:

  1. Go to myproject/projectname/web/custom/viewmodels/paymentSuspense.

  2. Edit view model to handle new criteria as shown in Example 19-7:

    Example 19-7 Sample Custom Payment Suspense Search Account Filter View Model

    define(['jquery', 'knockout',
       'viewmodels/paymentSuspense/PaymentSuspenseSearchAccountFilterViewModel'
    ],
            function ($, ko,PaymentSuspenseSearchAccountFilterViewModel) {
                function customPaymentSuspenseSearchAccountFilterViewModel() {
                    PaymentSuspenseSearchAccountFilterViewModel.apply(this, arguments); 
    ….
    ..}
    
  3. Save the file in your NetBeans IDE project.

Note:

The reset and sync functions should be available in all view models. Entries present in each function are dependent on the search criteria. You can change the name of the function and entries as per search criteria.

Localizing New Criteria into Other Languages

Localize the new criteria headings and label into other languages. See "Customizing the Resource Bundle" for more information.

Creating Deployment Plan

Create a production deployment plan named plan.xml for your production Billing Care deployment. See "Packaging and Deploying Customizations" for more information.

Creating .war File

Create a .war file containing your customizations to deploy to multiple Billing Care instances. See "Packaging and Deploying Customizations" for more information.