wt.workflow.engine
Class WfEventHelper

java.lang.Object
  extended bywt.workflow.engine.WfEventHelper
All Implemented Interfaces:
Externalizable, Serializable

public class WfEventHelper
extends Object
implements Externalizable

Creates and stores workflow events. Used by the workflow engine service StandardWfEngineService.

Supported API: false

Extendable: false

See Also:
Serialized Form

Nested Class Summary
(package private) static class WfEventHelper.SaveEventAudit
          Runnable class that implements the saving of event audits.
 
Field Summary
private static String CLASSNAME
           
static long EXTERNALIZATION_VERSION_UID
           
private static int MAX_ERROR_MESSAGE
           
private static int MAX_LENGTH
           
protected static long OLD_FORMAT_VERSION_UID
           
private static String RESOURCE
           
(package private) static long serialVersionUID
           
private static boolean VERBOSE
           
 
Constructor Summary
WfEventHelper()
           
 
Method Summary
static void createAssignmentEvent(WfEventAuditType event_type, WfExecutionObject exec_obj, WTPrincipal new_assignee, WTPrincipal old_assignee, Role role)
          Creates and stores WfAssignmentEventAudit objects.
static void createDataEvent(WfEventAuditType event_type, WfExecutionObject exec_obj, ProcessData old_data, Role role, String instructions)
          Creates and stores WfDataEventAudit objects.
static void createExceptionEvent(WfEventAuditType event_type, WfExecutionObject exec_obj, Exception exception)
          Creates and stores WfExceptionEventAudit objects.
static void createProcessEvent(WfEventAuditType event_type, WfProcess process)
          Creates and stores WfAssignmentEventAudit objects.
static void createStateEvent(WfEventAuditType event_type, WfExecutionObject exec_obj, WfState old_state, Vector events)
          Creates and stores WfAssignmentEventAudit objects.
static void createVotingEvent(WfEventAuditType event_type, WfExecutionObject exec_obj, Role role, WTPrincipalReference assignee_ref, String comment, Vector event_list, boolean is_signed, boolean is_required)
          Creates and stores WfVotingEventAudit objects.
private static String getErrorMessage(Exception e)
          Capture an exception's stack trace and message in a single String
 void readExternal(ObjectInput input)
          Reads the non-transient fields of this class from an external source.
private  boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source, which is not the current version.
protected  boolean readVersion(WfEventHelper thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
private static void setIdentificationAttributes(WfEventAudit event_audit, WfExecutionObject exec_obj)
          Sets identication attribute values in the event.
private static void startEventAuditRecording(WfEventAudit event_audit)
          Saves an audit event.
private static String truncate(String name)
           
 void writeExternal(ObjectOutput output)
          Writes the non-transient fields of this class to an external source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

EXTERNALIZATION_VERSION_UID

public static final long EXTERNALIZATION_VERSION_UID
See Also:
Constant Field Values

OLD_FORMAT_VERSION_UID

protected static final long OLD_FORMAT_VERSION_UID
See Also:
Constant Field Values

MAX_LENGTH

private static final int MAX_LENGTH
See Also:
Constant Field Values

VERBOSE

private static final boolean VERBOSE

MAX_ERROR_MESSAGE

private static final int MAX_ERROR_MESSAGE
Constructor Detail

WfEventHelper

public WfEventHelper()
Method Detail

writeExternal

public void writeExternal(ObjectOutput output)
                   throws IOException
Writes the non-transient fields of this class to an external source.

Supported API: false

Specified by:
writeExternal in interface Externalizable
Parameters:
output -
Throws:
IOException

readExternal

public void readExternal(ObjectInput input)
                  throws IOException,
                         ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Specified by:
readExternal in interface Externalizable
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

protected boolean readVersion(WfEventHelper thisObject,
                              ObjectInput input,
                              long readSerialVersionUID,
                              boolean passThrough,
                              boolean superDone)
                       throws IOException,
                              ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Parameters:
thisObject -
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

readOldVersion

private boolean readOldVersion(ObjectInput input,
                               long readSerialVersionUID,
                               boolean passThrough,
                               boolean superDone)
                        throws IOException,
                               ClassNotFoundException
Reads the non-transient fields of this class from an external source, which is not the current version.

Parameters:
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

createStateEvent

public static void createStateEvent(WfEventAuditType event_type,
                                    WfExecutionObject exec_obj,
                                    WfState old_state,
                                    Vector events)
                             throws WTException
Creates and stores WfAssignmentEventAudit objects.

Supported API: false

Parameters:
event_type -
exec_obj -
old_state -
events -
Throws:
WTException

createProcessEvent

public static void createProcessEvent(WfEventAuditType event_type,
                                      WfProcess process)
                               throws WTException
Creates and stores WfAssignmentEventAudit objects.

Supported API: false

Parameters:
event_type -
process -
Throws:
WTException

createVotingEvent

public static void createVotingEvent(WfEventAuditType event_type,
                                     WfExecutionObject exec_obj,
                                     Role role,
                                     WTPrincipalReference assignee_ref,
                                     String comment,
                                     Vector event_list,
                                     boolean is_signed,
                                     boolean is_required)
                              throws WTException
Creates and stores WfVotingEventAudit objects.

Supported API: false

Parameters:
event_type -
exec_obj -
role -
assignee_ref -
comment -
event_list -
is_signed -
is_required -
Throws:
WTException

createExceptionEvent

public static void createExceptionEvent(WfEventAuditType event_type,
                                        WfExecutionObject exec_obj,
                                        Exception exception)
                                 throws WTException
Creates and stores WfExceptionEventAudit objects.

Supported API: false

Parameters:
event_type -
exec_obj -
exception -
Throws:
WTException

createDataEvent

public static void createDataEvent(WfEventAuditType event_type,
                                   WfExecutionObject exec_obj,
                                   ProcessData old_data,
                                   Role role,
                                   String instructions)
                            throws WTException
Creates and stores WfDataEventAudit objects.

Supported API: false

Parameters:
event_type -
exec_obj -
old_data -
role -
instructions -
Throws:
WTException

createAssignmentEvent

public static void createAssignmentEvent(WfEventAuditType event_type,
                                         WfExecutionObject exec_obj,
                                         WTPrincipal new_assignee,
                                         WTPrincipal old_assignee,
                                         Role role)
                                  throws WTException
Creates and stores WfAssignmentEventAudit objects.

Supported API: false

Parameters:
event_type -
exec_obj -
new_assignee -
old_assignee -
role -
Throws:
WTException

setIdentificationAttributes

private static void setIdentificationAttributes(WfEventAudit event_audit,
                                                WfExecutionObject exec_obj)
                                         throws WTException
Sets identication attribute values in the event. These values are obtained from the execution object passed as parameter.

Parameters:
event_audit - - event to receive attributes
exec_obj - - execution object from which attributes are retrieved
Throws:
WTException

startEventAuditRecording

private static void startEventAuditRecording(WfEventAudit event_audit)
                                      throws WTException
Saves an audit event. Impersonates the administrator so as not to be hindered by access control. Needs to be in a different thread so it is not affected by rollbacks.

Parameters:
event_audit - - event to be saved
Throws:
WTException

truncate

private static String truncate(String name)

getErrorMessage

private static String getErrorMessage(Exception e)
Capture an exception's stack trace and message in a single String