Showing posts with label Event. Show all posts
Showing posts with label Event. Show all posts

(WID/WPS) Configuring EventHandler for an Escalation (WPS)

If an escalation occurs during the execution of a human task, you may want to notify an event handler within the application environment.
To configure an event and add it to your business application model, follow these instructions.

Declare a notification event handler for your task as described here:
  • In the human task editor click the Details tab. 
  • In the Event handler name field, enter a name for your notification event handler. {This name is not the name of the implementation class.}
  • Click Save. 
Add your plugin to your application:
  • Switch to the Resource perspective. 
  • In the Navigator, expand your business integration project. 
  • In the META-INF folder, create a new folder services. 
  • Right-click the services folder and select New > File . 
  • In the File name field of the New File wizard, , enter com.ibm.task.spi.EventHandlerNameNotificationEventHandlerPlugin Where EventHandlerName is the event handler name you have specified for your task. 
  • Click Finish. 
  • In the above file, write the fully qualified name of the event handler class.(For example : bpc.samples.plugin.EscalationNotificationPlugin)
Implementing the Event Handler Class:

EscalationNotificationPlugin.java

package bpc.samples.plugin;
import com.ibm.task.api.Escalation;
import com.ibm.task.api.TKIID;
import com.ibm.task.api.Task;
import com.ibm.task.spi.NotificationEventHandlerPlugin;

public class EscalationNotificationPlugin implements
NotificationEventHandlerPlugin {

public void escalationNotification(Task task, Escalation escalation) {
System.out.println("Entering method");
if(task != null && escalation != null)
{
System.out.println("Task template name: " + task.getTaskTemplateName());
System.out.println("Task name: " + task.getName());
System.out.println("Task state: " + task.getState());
System.out.println("Event handler name: " + task.getEventHandlerName());
System.out.println("Is escalated: " + task.isEscalated());
System.out.println("Escalation name: " + escalation.getName());
TKIID tkId = task.getID();
System.out.println("Task Id : " + tkId);
}

}

}

Specify an escalation with a notification type Event:
  • Switch to the Business Integration perspective and open your task in the human task editor. 
  • In the Escalation settings section, select the escalation. 
  • Click the Details tab. 
  • Configure the escalation as needed. For Notification type, choose Event from the list of available options. 
  • Save your work. 

(WID/WPS) CEI & CBE ?


The common event infrastructure or CEI is one of the SOA core components that are a part of WPS. 
CEI is available to all the supporting services and service components that are running in the process server environment.All of these supporting services and service components have the ability to generate events that can be handled by CEI and then handled by various clients such as those provided by Tivoli® and WebSphere Business Monitor. 


The event definition is being standardized through the OASIS standards body  so that other companies as well as customers can use the same infrastructure to monitor through-out their environments.                                                                                                                                                                                                                                                                                                                                                                  
It provides facilities for the runtime environment to persistently store and retrieve events from different programming environments. This post briefly introduces the basic event-related concepts:
  • Common Event Infrastructure (CEI)
  • Common Base Events (CBE)

Common Event Infrastructure
In WESB, the CEI is used to provide basic event management services, such as event generation, transmission, persistence, and consumption. CEI was developed to address industry-wide problems in exchanging events between incompatible systems, many of which employed different event infrastructures, event formats, and data stores.

Common Base Event
Although CEI provides an infrastructure for event management, it does not define the format of events. This is defined by the Common Base Event specification, which provides a standard XML-based format for business events, system events, and performance information. Application developers and administrators can use the Common Base Event specification for structuring and developing event types.