Wednesday, August 02, 2006

Building Billing Processes with BPEL for Telecom Web Services


  This is the last prototype project I did before I left Oracle. The goal is to explore a general approach for building flexible business processes to control Telecom Service Delivery by integrating Oracle BPEL PM with Oracle Web Services Manager (OWSM). So, Oracle BPEL Process Manager and Oracle Web Services Manager (OWSM) can be used as foundation platform to build Telecom Service Gateway.

  The sample Telecom Service we used is a Parlay X Send SMS Web Service built on top of Oracle Application Server Wireless Messaging. The whole Service Delivery Platform environment I set up is shown in the following diagram:
  For this project, one key thinking is that, in the governed SOA world, exposed Web Services or Business Services should be protected by certain Control Policies and we can orchestrate at least some type of Control Policy, such as Orchestrate Pre-Paid Billing Policy, Using BPEL.

  In general, we can see at least two types of control policies in the real world: declarative policy and process-driven policy. “Only the users with manager role can access Approving-PO Web Service” is a typical example of declarative policy. Process-driven policy usually involves a list of process steps to enforce the policy before and after service invocation. “Billing Policy” used in Telecom Industry, especially “Pre-Paid Billing Policy” is a typical example of process-driven policy.

  To use a service enforced by Pre-Paid Billing Policy, the service consumer will usually pay certain a mount of money as credit before he can start to use the service. Later, every time he/she uses the service his/her credit will be deducted based on the usage. Once the credit is used up, he/she will not allowed to use the service anymore unless he/she put new money in. Actually, it can be described as a list of processing steps as the following:
  1. A Service Request come in and the User has been authenticated
  2. User will be authorized if his account has enough credit for the service involved
  3. An adequate fund has been reserved from user account
  4. If the Service Request has been fulfilled successfully, the reserved fund will be transferred to service provider. If the service request failed due to network or server or other issues, the reserved fund should be returned to user's account as credit available
  Since Process-Driven Policy often invoke a list of pre-processing and/or post-processing steps, some of them might also be long-standing steps, BPEL actually is an ideal language/tool to describe and enforce it. The Pre-Paid Billing Policy described above can be easily implemented by orchestrated BPEL Processes.

  Assuming there is a BPEL Engine like Oracle BPEL PM running all the Pre-Paid Billing Policy Processes which integrated with existing external Billing System through exposed Web Service Interfaces, and there is a Service Execution and Enforcing Environment, such as Oracle Web Service Manager which will notify Billing Policy Process at different execution phases. The Pre-Paid Billing Policy can easily be orchestrated by multiple BPEL Processes as the following diagram shown:

  When the service request is received in the Service Execution Environment, the associated Policy Enforcement Point (PEP) will invoke the "Rating And Fund Reservation Billing Process" with collected Service Detail Record (SDR), which will check the user's credit at real time, reserve the fund if there is enough fund available and start "QoS And Charging Billing Process".

  "QoS And Charging Billing Process" will in turn start "Service Notification Process" waiting for the Asynchronous Service Notification.

  Then the Policy Enforcement Point (PEP) will notify "Service Notification Process" whether the Service Request is fulfilled, which will in turn notify the "QoS And Charging Billing Process", which will cancel the reserved fund if the request is failed to fulfill, otherwise, it will start "Post-Pay Confirmation Process" waiting for the final status notification once the final fulfillment is confirmed, which will finally let the "QoS And Charging Billing Process" deduct/transfer the reserved fund.

  In addition, "Service Notification Process" is also responsible to notify the "QoS And Charging Billing Process" in case that the Service Invocation is crushed without a chance to send out the notification.

  The Pre-Paid Billing Policy logic are mainly implemented in two orchestrated BPEL Processes:
  1. Rating and Fund Reservation Billing Process, its business process logic is straightforward as the following diagram shown, when the process receives the service invocation request containing the Service Detail Record (SDR), it will invoke the external "Authorize Pay Web Service" to check whether the user has enough fund for the service request, if it is true, it then will reserve the fund through external "Reserve Fund Web Service" and start "QoS and Charging Process" and return the status of “Success”, otherwise the status of "Failed" will be returned


  2. QoS And Charging Billing Process, as the following diagram shown, when it get started, it will immediately start "Service Notification Process" waiting for the Service Notification, if the "service fulfilled" status is received, the "Post-Pay Confirmation Process" will be started waiting for the final delivery status to invoke the external "Transfer Fund Web Service" and finish the whole Pre-Paid Billing Policy Processing. In case of failure, "QoS And Charging Billing Process" will invoke the external "Cancel Reserved Fund Web Service" to return the fund back to the customer's account.


  As demostrated, using BPEL to build process-driven policies make these policies not only naturally executable but also easily integrated with both internal and external enterprise software systems

Friday, April 14, 2006

Using Maven2 to Build J2EE Application in a Corporate Environment

Maven2 is a great building tool, but using Maven2 is not easy since the lack of document make it not user friendly, Timothy M. O'Brien, who co-wrote the book Maven: A Developer's Book, just wrote a blog entry Maven Project Info Reports Considered Dangerous talking about some difficulties a developer will encounter when trying to use Maven2.

Right now, as developer, I'm trying to set up a new build process using Maven2 for our development group in the coming projects. I'll try to document and share some tips, work-arounds and maybe the issues related to Maven2.

In general, to make Maven2 successfull in a Corporate Environment, we need some guidelines or best practices in the following areas:
  1. Building and Managing a Internal Remote Repository shared among developers
    (Note: The two very useful documents I saw on the Internet are Corporate https maven2 repositories and Using Maven in a corporate environment)

  2. Optionally set up a Maven-Proxy inside Firewall to ease the access to central Maven2 Repository at Ibiblio

  3. Developing RAR, WAR, EJB Archetype or Project Templates for common J2EE Component Projects
    (Note: So far, the Maven2 ArcheTypes posted on Maven2 Repository and MyFaces ArcheType are all single project based ArcheTypes, which means that each archetype only generates one pom.xml)

  4. Write or customize Maven2 Plug-ins for your own building process

  5. A Typical J2EE Application Project Layout or Directory Structure

  6. Continuous Integration with Nightly Build and Reports

  7. Caveats and Workarounds:
    7.1 How to exclude Maven Property files such as pom.xml and pom.properties in the generated JAR, RAR, and EAR File

    7.2 How to set the RAR File name through the pom.xml

    7.3 Maven2 ArcheType Plug-in did not recognize internal remote repository
In the last three weeks, I already spent a lot of night time browsing through Maven Web site, articles, blog entries, Maven Mailing List to gain some knowledge in the above areas. I'll update this blog entry with more Maven2 related detail when I make progress with my project in these areas.

Friday, March 10, 2006

Sun Certified Developer for Java Web Services (SCDJWS)

I just passed Sun Certified Developer for Java Web Services Exam. I thought that combining Sun Certified Developer for Java Web Services (SCDJWS) with Certified BPEL Engineer (CBE) demonstrates my strong technical knowledge as a Senior/Principal Software Engineer working in SOA related Project/Product Development

Wednesday, January 04, 2006

Certified BPEL Engineer

I was very pleased to pass the actvieBPEL's Certified BPEL Engineer Exam with a 95% (57/60) score.

The following are my learning and working experience related to BPEL which help me pass through the Certified BPEL Engineer Exam:
Also, Antony Reynold's Blog is a very good resource for BPEL, especially Oracle BPEL PM