org.yawlfoundation.yawl.logging
Class YEventLogger

java.lang.Object
  extended by org.yawlfoundation.yawl.logging.YEventLogger

public class YEventLogger
extends Object

Handles all process logging of case, subnet, workitem and workitem data events. Log objects are instantiated and then written as a row to the appropriate table via hibernate. Some tables store 'definition' information, others instantiation information. All table rows are identified with auto-generated primary keys (not mentioned in the summaries below). The log objects are: - YLogSpecification: spec id, version, name, root net key - YLogNet: name, FK to YLogSpecification - YLogNetInstance: case id, FK to YLogNet, FK to YLogTaskInstance (only for sub-nets) - YLogTask: name, FK to YLogNet (parent), FK to YLogNet (child - only for sub-nets) - YLogTaskInstance: case id, FK to YLogTask, FK to YLogNetInstance, FK to YLogTaskInstance (parent - only for child workitems) - YEvent: descriptor, timestamp, FK to instance (YLogNetInstance OR YLogTaskInstance), FK to YLogService, FK to YLogNetInstance (root net) - YLogService: name, url - YLogDataItemInstance: descriptor, attribute, value, FK to YEvent, FK to YLogDataType - YLogDataType: definition

Author:
Michael Adams - completely refactored for v2.0 10/2007, and again for v2.1 04-12/2009, and again for v2.2 11/2010

Field Summary
static String CASE_CANCEL
           
static String CASE_COMPLETE
           
static String CASE_START
           
static String NET_CANCEL
           
static String NET_COMPLETE
           
static String NET_START
           
static String NET_UNFOLD
           
 
Constructor Summary
YEventLogger()
           
 
Method Summary
 void disable()
           
 void enable()
           
 String getDataSchema(YSpecificationID specID, String dataTypeName)
           
static YEventLogger getInstance()
           
static YEventLogger getInstance(YEngine engine)
          Get a reference to the event logger object.
 void logCaseCancelled(YPersistenceManager pmgr, YIdentifier caseID, YLogDataItemList datalist, String serviceRef)
          Logs a case cancellation.
 void logCaseCreated(YPersistenceManager pmgr, YSpecificationID ySpecID, YIdentifier caseID, YLogDataItemList datalist, String serviceRef)
          Logs the launching of a new process instance.
 void logDataEvent(YPersistenceManager pmgr, YWorkItem workitem, String descriptor, YLogDataItemList datalist)
          Logs data variables and values when mapped between net and workitem
 void logNetCancelled(YPersistenceManager pmgr, YSpecificationID ySpecID, YNetRunner runner, String engineTaskID, YLogDataItemList datalist)
           
 void logNetCompleted(YPersistenceManager pmgr, YIdentifier engineNetID, YLogDataItemList datalist)
          Logs the normal completion of a net.
 void logSubNetCreated(YPersistenceManager pmgr, YSpecificationID ySpecID, YNetRunner runner, String engineTaskID, YLogDataItemList datalist)
          Logs the launching of a sub-net (ie.
 void logWorkItemEvent(YPersistenceManager pmgr, YWorkItem workItem, String eventName, YLogDataItemList datalist)
          Logs a workitem event (change of status).
 void logWorkItemEvent(YPersistenceManager pmgr, YWorkItem workItem, YWorkItemStatus event, YLogDataItemList datalist)
          Logs a workitem event (change of status).
 void removeSpecificationFromCache(YSpecificationID specID)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CASE_START

public static final String CASE_START
See Also:
Constant Field Values

CASE_COMPLETE

public static final String CASE_COMPLETE
See Also:
Constant Field Values

CASE_CANCEL

public static final String CASE_CANCEL
See Also:
Constant Field Values

NET_UNFOLD

public static final String NET_UNFOLD
See Also:
Constant Field Values

NET_START

public static final String NET_START
See Also:
Constant Field Values

NET_COMPLETE

public static final String NET_COMPLETE
See Also:
Constant Field Values

NET_CANCEL

public static final String NET_CANCEL
See Also:
Constant Field Values
Constructor Detail

YEventLogger

public YEventLogger()
Method Detail

getInstance

public static YEventLogger getInstance(YEngine engine)
Get a reference to the event logger object. This one is called by the engine on startup.

Parameters:
engine - a reference to the running engine
Returns:
an instantiated event logger

getInstance

public static YEventLogger getInstance()
Returns:
an instantiated event logger

enable

public void enable()

disable

public void disable()

getDataSchema

public String getDataSchema(YSpecificationID specID,
                            String dataTypeName)

removeSpecificationFromCache

public void removeSpecificationFromCache(YSpecificationID specID)

logCaseCreated

public void logCaseCreated(YPersistenceManager pmgr,
                           YSpecificationID ySpecID,
                           YIdentifier caseID,
                           YLogDataItemList datalist,
                           String serviceRef)
Logs the launching of a new process instance.

Parameters:
pmgr - the active persistence manager object
ySpecID - the id of the process specification
caseID - the id of the case
datalist - a list of data entries to log with this event
serviceRef - a reference to the client service that launched the case

logSubNetCreated

public void logSubNetCreated(YPersistenceManager pmgr,
                             YSpecificationID ySpecID,
                             YNetRunner runner,
                             String engineTaskID,
                             YLogDataItemList datalist)
Logs the launching of a sub-net (ie. the enablement of a composite task).

Parameters:
pmgr - the active persistence manager object
ySpecID - the id of the process specification
runner - the net runner launching this sub-net
engineTaskID - the task id assigned by the engine
datalist - a list of data entries to log with this event

logCaseCancelled

public void logCaseCancelled(YPersistenceManager pmgr,
                             YIdentifier caseID,
                             YLogDataItemList datalist,
                             String serviceRef)
Logs a case cancellation.

Parameters:
pmgr - the active persistence manager object
caseID - the id of the case
datalist - a list of data entries to log with this event
serviceRef - a reference to the client service that launched the case

logNetCompleted

public void logNetCompleted(YPersistenceManager pmgr,
                            YIdentifier engineNetID,
                            YLogDataItemList datalist)
Logs the normal completion of a net. If the net is a root net, it means the case has completed.

Parameters:
pmgr - the active persistence manager object
engineNetID - the id of the net
datalist - a list of data entries to log with this event

logNetCancelled

public void logNetCancelled(YPersistenceManager pmgr,
                            YSpecificationID ySpecID,
                            YNetRunner runner,
                            String engineTaskID,
                            YLogDataItemList datalist)

logWorkItemEvent

public void logWorkItemEvent(YPersistenceManager pmgr,
                             YWorkItem workItem,
                             String eventName,
                             YLogDataItemList datalist)
Logs a workitem event (change of status).

Parameters:
pmgr - the active persistence manager object
workItem - the workitem that triggered the event
eventName - the event that has occurred
datalist - a list of data entries to log with this event

logWorkItemEvent

public void logWorkItemEvent(YPersistenceManager pmgr,
                             YWorkItem workItem,
                             YWorkItemStatus event,
                             YLogDataItemList datalist)
Logs a workitem event (change of status).

Parameters:
pmgr - the active persistence manager object
workItem - the workitem that triggered the event
event - the event that has occurred
datalist - a list of data entries to log with this event

logDataEvent

public void logDataEvent(YPersistenceManager pmgr,
                         YWorkItem workitem,
                         String descriptor,
                         YLogDataItemList datalist)
Logs data variables and values when mapped between net and workitem

Parameters:
pmgr - the active persistence manager object
workitem - the workitem starting or completing
descriptor - a label for the kind of data it is
datalist - a list of data entries to log with this event


Copyright © 2004-2012 The YAWL Foundation.