Configuring and Managing Advanced Registration Flows

     Previous  Next    Open TOC in new window    View as PDF - New Window  Get Adobe Reader - New Window
Content starts here

Extending the Event Manager for Web Service Endpoints

This section contains information on the following subjects:

 


Overview

This document explains how to develop a new Web Service endpoint to consume the events that are emitted by the Event Manager and also explains how to extend the Event Manager to use other notifier plug-ins.

For information about configuring the Event Manager, see Configuring the ALER Event Manager.

 


Developing a Web Service Endpoint

The following figure shows how a Web Service endpoint can be plugged-in to receive the Events emitted by the ALER Event Manager.

Figure 8-1 Web Service Endpoint Plug-in

Web Service Endpoint Plug-in

Following these steps to create a new Web Service endpoint and start getting events.

  1. Pick up the WSDL contract defined by the Event Manager. This is bundled with the eventNotifier.jar located in the <aler Webapp path>/WEB-INF/lib directory.
  2. Open the jar file and locate a WSDL named "EventListener.WSDL" and extract the WSDL to the file system. This WSDL is the abstract contract defined by the Event Manager and the new Web Service endpoint needs to implement the operation defined in the WSDL.
  3. Here is a snapshot of the WSDL file

    Figure 8-2 Sample WSDL File


    Sample WSDL File

  4. Complete the Web Service endpoint development using the tool or technology, as per the requirement. For example, you could develop a Proxy Service using AquaLogic Service Bus, which provides a feature where you can create a Web Service-based proxy service by pointing to a WSDL file. Make the Web Service running by completing the development of the Web Service.
  5. Configure the Event Manager so that the Web Service endpoint's host, port, and URI, etc., are entered in the Subscription Manager file. For more information about configuring the Event Manager, see Configuring the ALER Event Manager.
  6. Start ALER and trigger events using the Asset Editor and the Web Service endpoint will start getting the Events.
  7. You can use the Event Monitoring tool that is bundled with ALER for debugging and monitoring the Events that are generated by the Event Manager.

 


Web Service Operations

This section describes the available operation for a new Web Service endpoint, and how to specify operations in the Event Manager.

Available Web Service Operations

The ALER Event Manager supports the following operations.

newEventRequestResponse

This operation takes the event object that is defined in the XML schema section as an input and returns the status as the output. The status is defined as string type. Additionally, if the status string starts with Failure, then the Event Manager will throw an exception and will try to re-deliver the event until it succeeds. If not, it will log the response and will deliver the next event unless there is a transport exception.

newEventRequestResponseString

This operation takes the event data in string form as an input and returns the status as the output. The status is defined as string type. Additionally, if the status string starts with Failure, then the Event Manager will throw an exception and will try to re-deliver the event until it succeeds. If not, it will log the response and will deliver the next event unless there is a transport exception.

newEventRequest

This operation takes the event object that is defined in the XML schema section as an input and is defined as a one-way operation.

newEventRequestString

This operation takes the event data in string form as an input and is defined as a one-way operation.

newEvent

This operation should be used only if the Process Engine is ALBPM. This operation internally invokes the startSession operation to start session to authenticate with ALBPM. It will also call discardSession after the invocation.

Selecting a Web Service Operation

The preferred Web Service operation can be selected by configuring the Event Manager's Subscription Manager the following way, as specified in the operationName element.

<sub:EventSubscriptionData xmlns:sub="http://www.bea.com/infra/events/subscription" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<sub:eventSubscription>
<sub:endPoint name="ALBPMEndpoint3">
<sub:host>localhostt>
<sub:port>9000</sub:port>
<sub:uri>fuegoServices/ws/StatusChangeEnpointServiceListener</sub:uri>
<sub:targetNamespace>http://www.bea.com/infra/events</sub:targetNamespace>
<sub:operationName>newEvent</sub:operationName>
<sub:authenticationData>
<sub:basicAuthentication>
<sub:username>admin</sub:username>
<sub:username>admin</sub:username>
</sub:basicAuthentication>
</sub:authenticationData>
</sub:endPoint>
<sub:notifierClass>com.bea.infra.event.notifier.plugin.http.DefaultHTTPEventNotifier </sub:notifierClass>
<sub:expression></sub:expression>
</sub:eventSubscription>
</sub:EventSubscriptionData>

 


Developing a Notifier Plug-in

The ALER Event Manager includes a default SOAP/HTTP notifier. A new plug-in can be developed and plugged in if there are additional requirements, as illustrated here.

Figure 8-3 Notifier Plug-in

Notifier Plug-in

Follow these steps to make the new plug-in work with the Event Manager.

  1. Develop a new Notifier Plug-in by extending the Java Class AbstractEventNotifier that is bundled with the ALER Event Manager. This class is bundled with the eventNotifier.jar located in the <aler Webapp path>/WEB-INF/lib directory. The init() and sendNotification() methods need to be overridden. Refer to the Javadoc for more information about these methods. The handle() method passes the event data in an XML Beans format, which can be used to send it to an external Web Service.
  2. Configure the Subscription Manager file to point to the developed class. Modify the notifierClass element as follows:
  3. <sub:EventSubscriptionData xmlns:sub="http://www.bea.com/infra/events/subscription" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <sub:eventSubscription>
    <sub:endPoint name="ALBPMEndpoint3">
    <sub:host>localhost</sub:host>
    <sub:port>9000</sub:port>
    <sub:uri>fuegoServices/ws/StatusChangeEnpointServiceListener</sub:uri>
    <sub:targetNamespace>StuatusChangeEndpoint</sub:targetNamespace>
    <sub:operationName>newEvent</sub:operationName>
    <sub:authenticationData>
    <sub:basicAuthentication>
    <sub:username>admin</sub:username>
    <sub:username>admin</sub:username>
    </sub:basicAuthentication>
    </sub:authenticationData>
    </sub:endPoint>
    <sub:notifierClass>com.bea.infra.event.notifier.plugin.http.DefaultHTTPEventNotifier</sub:notifierClass>
    <sub:expression>id &gt; 500</sub:expression>
    </sub:eventSubscription>
    </sub:EventSubscriptionData>
  4. Bundle the classes in a JAR file and copy it to <aler Webapp path>/WEB-INF/lib directory so that it is picked up by the classpath.
  5. Restart the Event Manager and trigger an event using the Asset Editor.
  6. The Event Manager will call the init() and handle() methods of the new notifier plug-in.

 


Developing an Endpoint With an Incompatible Contract

It is possible that there may be an endpoint with an Interface or Contract that is not compatible with ALER Event Manager. This is because the tool that is used to develop the endpoint may have restrictions to use the WSDL provided by ALER Event Manager, or there may be other inter-operability issues. The following approach can be used under those circumstances:


  Back to Top       Previous  Next