org.yawlfoundation.yawl.worklet.support
Class WorkletEventListener

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.yawlfoundation.yawl.worklet.support.WorkletEventListener
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
Direct Known Subclasses:
TestWorkletListener

public abstract class WorkletEventListener
extends javax.servlet.http.HttpServlet

An abstract class to be extend by classes that wish to be notified of worklet service events. A class must first be registered as a listener (see WorkletGatewayClient#addListener) to receive events via this class.

Author:
Michael Adams
See Also:
Serialized Form
Created/Last Date:
27/03/12

Constructor Summary
WorkletEventListener()
           
 
Method Summary
abstract  void caseLevelExceptionEvent(String caseID, org.jdom.Element caseData, RdrNode node, RuleType ruleType)
          Receives notification of a case level exception being raised by the worklet service
abstract  void constraintSuccessEvent(String caseID, WorkItemRecord wir, org.jdom.Element caseData, RuleType ruleType)
          Receives notification of a case or workitem that has passed pre or post constraints
 void destroy()
           
 void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Replies to browsers with a simple message
 void doPost(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Receives event notifications from the Worklet Service and passes them on to extending classes via the appropriate method calls
abstract  void itemLevelExceptionEvent(WorkItemRecord wir, org.jdom.Element caseData, RdrNode node, RuleType ruleType)
          Receives notification of a item level exception being raised by the worklet service
abstract  void selectionEvent(WorkItemRecord wir, Map<String,String> caseMap, RdrNode node)
          Receives notification of a selection (substitution) by the worklet service
abstract  void shutdown()
          Receives notification that the worklet service is shutting down
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WorkletEventListener

public WorkletEventListener()
Method Detail

destroy

public void destroy()
Specified by:
destroy in interface javax.servlet.Servlet
Overrides:
destroy in class javax.servlet.GenericServlet

doPost

public void doPost(javax.servlet.http.HttpServletRequest req,
                   javax.servlet.http.HttpServletResponse res)
            throws IOException,
                   javax.servlet.ServletException
Receives event notifications from the Worklet Service and passes them on to extending classes via the appropriate method calls

Overrides:
doPost in class javax.servlet.http.HttpServlet
Parameters:
req - the http request
res - the http response
Throws:
IOException
javax.servlet.ServletException

doGet

public void doGet(javax.servlet.http.HttpServletRequest req,
                  javax.servlet.http.HttpServletResponse res)
           throws IOException,
                  javax.servlet.ServletException
Replies to browsers with a simple message

Overrides:
doGet in class javax.servlet.http.HttpServlet
Parameters:
req - the http request
res - the http response
Throws:
IOException
javax.servlet.ServletException

selectionEvent

public abstract void selectionEvent(WorkItemRecord wir,
                                    Map<String,String> caseMap,
                                    RdrNode node)
Receives notification of a selection (substitution) by the worklet service

Parameters:
wir - the workitem that has been replaced by a worklet
caseMap - a map of [caseID, worklet name] pairs, each one representing a a worklet case launched for the workitem (one for single-instance tasks, several for multiple-instance tasks)
node - the RdrNode that evaluated to true

constraintSuccessEvent

public abstract void constraintSuccessEvent(String caseID,
                                            WorkItemRecord wir,
                                            org.jdom.Element caseData,
                                            RuleType ruleType)
Receives notification of a case or workitem that has passed pre or post constraints

Parameters:
caseID - the case that passed constraints.
wir - the workitem that passed constraints. Will be null for case level constraints.
caseData - the current caseData, used for evaluation
ruleType - the type of constraint rule passed

caseLevelExceptionEvent

public abstract void caseLevelExceptionEvent(String caseID,
                                             org.jdom.Element caseData,
                                             RdrNode node,
                                             RuleType ruleType)
Receives notification of a case level exception being raised by the worklet service

Parameters:
caseID - the case on which the exception has been raised
caseData - the current caseData, used to evaluate the exception
node - the RdrNode that evaluated to true
ruleType - the type of exception raised

itemLevelExceptionEvent

public abstract void itemLevelExceptionEvent(WorkItemRecord wir,
                                             org.jdom.Element caseData,
                                             RdrNode node,
                                             RuleType ruleType)
Receives notification of a item level exception being raised by the worklet service

Parameters:
wir - the workitem for which the exception has been raised
caseData - the current caseData, used to evaluate the exception
node - the RdrNode that evaluated to true
ruleType - the type of exception raised

shutdown

public abstract void shutdown()
Receives notification that the worklet service is shutting down



Copyright © 2004-2012 The YAWL Foundation.