Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
utsav_chobe
Explorer

OData enablement is a subject of significance, especially, considering pressing needs of requirement by frameworks that facilitate state-of-the-art user interfaces. It also becomes important by another high-demand requirement that is multichannel access to services and solutions.

It is evident that OData is endorsed in SAP world. In fact, the ABAP stack has a pretty mature Out-Of-the-Box availability of OData enablement.

The blog - What's new in Process Orchestration 7.31 SP09/7.4 SP04 , provides introduction of BPM OData services. It’s not only pleasing to realize the availability of OData service for BPM, but reflects importance of 'OData exposure for technologies'.

In the light of realization of the significance of OData enablement, there are a few use cases which still stand devoid of OData enablement – a situation that we recently came across in our team. They were :

  • Need for exposure of not only BPM but CAF (Composite Application Framework) services as well in form of OData services.
    • Existing CAF based solutions with WebDynpro and VC as front end might want to move to UI5 based state-of-the-art solutions, to be also able to have multiple device access enablement. The wish here would be that this should be possible with minimal effort. We should be able to draw advantage of the layered architecture. Thus utilizing most of the existing solution.

  • Exposure of BPM for PO versions before 7.31 SP 09, with minimal effort for achieving OData enablement.

Ahead, in the article I will present  the approach used to enable OData enablement from point of view of components involved (and step-wise description, perhaps later, if needed).

The OData enablement is done for two scenarios :

  1. Exposing CAF service as an OData Endpoint. (CAF services then, may or may not, initiate a BPM process)
  2. Exposing BPM as an OData endpoint

Prerequisite:

  • We used odata4j library as dependency for OData capabilities. The odata4j library download information may be accessed at this link.
  • For creation of OData request we used :
    • ¨ datajs library
    • ¨ SAP UI5
    • ¨ odata4j consumer library for JAVA based request creation.
    • ¨ other JS frameworks come with the same capability and also of almost same ease (download information available at this link).

So, here is a synopsis of the steps we followed :

Exposing CAF service as OData Endpoint


    1. Create and fire an OData request, from OData consumer (may or may not be a web module for composing the OData request to act as an OData consumer)
    2. Façade DC invokes CAF Service - Query parameters are extracted from OData request and used to invoke CAF services through JNDI invocation.

Few points about this Façade Development Component :

      1. Request is received at one of the exposed end-points ( from within a web module, separately deployable as an enterprise DC).
      2. This web module performs an ejb invocation to CAF operation (which can then invoke BPM service).
      3. The web module has dependencies on a DC created as type of 'External Library' which consists of jar files from odata4j library. Also, the web module has created namespace for OData request and registered resource, as well.
      4. Query parameters are extracted from the request payload.
      5. Make the actual ejb invocation for CAF service from the creatEntity endpoint, to initiate a BPM process.

  3.  The BPM service is invoked from within a CAF service, through a web service.

  4.  BPM Process Instance ID is returned.

  5.  BPM Process instance id is further returned to OData producer.

  6.  OData response entity is created and returned to the OData Consumer

Exposing BPM as an OData endpoint

Depending on the NW version you have, you will be faced which of the solutions below to follow :

For versions 7.31 SP9 and above :

These versions come with default OData enablement of BPM and so they may be directly consumed.

For versions 7.31 SP8 and below :

For these versions there is no default OData support available and so we will do façade creation as follows:


  1. Create and fire an OData request, from OData consumer (may or may not be a web module for composing the OData request to act as OData consumer)
  2. Façade DC initiates BPM – Query  parameters are extracted from OData request and used to initiate BPM process.

Few points about this Façade Development Component :

    1. Request is received at one of the exposed end-points (from within a web module, separately deployable as an enterprise DC).
    2. The web module has dependencies on the DC created as type of ‘External Library’, which consists of jar files from odata4j libarary. Also, the web module has created a namespace for OData request and also registered resource.
    3. Query parameters are extracted from the request payload.
    4. This web module initiates the BPM process, with help of BPM JAVA APIs.

   3.  The response is sent to OData producer.

   4.  OData response entity is created and returned to the OData Consumer.

Some additional points to be taken care of while making the solution work, could be with respect to cross origin request handling and authentication.

Conclusion :

Having performed the above steps creates a short, quick and yet a proper (hopefully!) solution to give OData enablement to your PO stack’s BPM & CAF, which then gives you the capability to consume services by any technology like javaScript, JAVA, dotNet etc.

2 Comments
Labels in this area