com.pega.pegarules.pub.context
Interface ProcessingStatus


public interface ProcessingStatus

Activities can record and query their status through a ProcessingStatus object.

Version:
$Revision: 31 $ $Date: 2009-06-24 09:38:04 -0400 (Wed, 24 Jun 2009) $
Author:
Gabe Ernst-Edwards

Field Summary
static java.lang.String COPYRIGHT
           
static int SEVERITY_DONOTRECORD
          Indicates that this status should never be recorded in a ProcessingStatus object.
static int SEVERITY_FAIL
          A severity level of Fail.
static int SEVERITY_GOOD
          Indicates that this status is good and there have been no problems.
static int SEVERITY_INFO
          A severity level of Informational.
static int SEVERITY_WARN
          A severity level of Warning.
static java.lang.String VERSION
           
 
Method Summary
 boolean add(int aSeverity, java.lang.String aMessageName, java.lang.String aMessageParms)
          Adds a new status event to this one.
 boolean add(ProcessingStatus aProcessingStatus)
          Adds a new status event to this one.
 void backoutWorst()
          Removes the most severe status message from this instance.
 void clear()
          Clears all status information from this instance.
 java.lang.String getLatestMessage()
          Get the latest status message added to this instance.
 java.lang.String getLatestMessageName()
          Get the name of the latest message added to this status.
 java.lang.String getLatestMessageParms()
          Get the latest message parameters added to this status.
 int getLatestSeverity()
          Get the severity of the latest status added to this instance.
 java.lang.String getLatestSeverityText()
          Text description of the latest severity status.
 PRThread getThread()
          Get the Thread being used by this status object.
 java.lang.String getWorstMessage()
          Get the status message from this instance.
 java.lang.String getWorstMessageName()
          Get the name of the message from this status's message ID.
 java.lang.String getWorstMessageParms()
          Get the message parameters for this status.
 int getWorstSeverity()
          Get the severity of this instance.
 boolean isLessSevereThan(int aSeverity)
          Compare a severity level with that of this instance.
 boolean logMissingMessages()
          Check if missing messages will be logged to Log-Message during getWorstMessage() and getLatestMessage() calls.
 void set(int aSeverity, java.lang.String aMessageName, java.lang.String aMessageParms)
          Sets the current status of this instance with a new status and message.
 void set(ProcessingStatus aProcessingStatus)
          Sets the current status of this instance with a new status.
 void setLogMissingMessages(boolean aLogMissingMessages)
          Activates or deactivate logging of missing messages to Log-Message during getWorstMessage() and getLatestMessage() calls.
 void updateMethodStatus()
          Updates contents of pxThread.pxMethodStatus property.
 

Field Detail

COPYRIGHT

static final java.lang.String COPYRIGHT
See Also:
Constant Field Values

VERSION

static final java.lang.String VERSION
See Also:
Constant Field Values

SEVERITY_GOOD

static final int SEVERITY_GOOD
Indicates that this status is good and there have been no problems.

See Also:
Constant Field Values

SEVERITY_DONOTRECORD

static final int SEVERITY_DONOTRECORD
Indicates that this status should never be recorded in a ProcessingStatus object.

See Also:
Constant Field Values

SEVERITY_INFO

static final int SEVERITY_INFO
A severity level of Informational. This level indicates that something of potential interest has occurred, but it is not necessarily an error condition.

See Also:
Constant Field Values

SEVERITY_WARN

static final int SEVERITY_WARN
A severity level of Warning. This level indicates that an event has occurred which warrants further investigation, but the activity will probably continue.

See Also:
Constant Field Values

SEVERITY_FAIL

static final int SEVERITY_FAIL
A severity level of Fail. This level indicates that an event has occurred which will stop the current activity.

See Also:
Constant Field Values
Method Detail

add

boolean add(ProcessingStatus aProcessingStatus)
Adds a new status event to this one. Different implementations of ProcessingStatus may add the new status to a list or compare it to the existing status and keep only the more severe one.

Parameters:
aProcessingStatus - the new status to add
Returns:
true if this object is updated as a result of this call

add

boolean add(int aSeverity,
            java.lang.String aMessageName,
            java.lang.String aMessageParms)
Adds a new status event to this one. Different implementations of ProcessingStatus may add the new status to a list or compare it to the existing status and keep only the more severe one.

Parameters:
aSeverity - the new severity
aMessageName - the new message identifier (a key to Rule-Message)
aMessageParms - the new message parameters (may be null)
Returns:
true if this object is updated as a result of this call

backoutWorst

void backoutWorst()
Removes the most severe status message from this instance. If possible, it is replaced with the previous most severe status. This method is useful in situations where the caller decides that a status message needs to be removed or a different message substituted for it.


clear

void clear()
Clears all status information from this instance.


getLatestMessage

java.lang.String getLatestMessage()
Get the latest status message added to this instance. This may involve looking up a message identifier in Rule-Message. If the message is not found, a message containing the identifier is generated. An error will be registered in Log-Message if logMissingMessages() has been previously called. Note that the latest status will differ from the worst status if the latest is of an equal or lower severity.

Returns:
the status message

getLatestMessageParms

java.lang.String getLatestMessageParms()
Get the latest message parameters added to this status. It will be the same value that was originally passed in via set() or add(). Note that the latest status will differ from the worst status if the latest is of an equal or lower severity.

Returns:
the message parameters

getLatestMessageName

java.lang.String getLatestMessageName()
Get the name of the latest message added to this status. The message name is the part of the ID before the first tab character (or the entire ID if there is no tab). The name is used as the value of the pyMessageName key property to the Rule-Message object. Note that the latest status will differ from the worst status if the latest is of an equal or lower severity.

Returns:
message name

getLatestSeverity

int getLatestSeverity()
Get the severity of the latest status added to this instance. Note that the latest status will differ from the worst status if the latest is of an equal or lower severity.

Returns:
the severity

getLatestSeverityText

java.lang.String getLatestSeverityText()
Text description of the latest severity status.

Returns:
the severity as text

getWorstMessage

java.lang.String getWorstMessage()
Get the status message from this instance. This may involve looking up a message identifier in Rule-Message. If the message is not found, a message containing the identifier is generated. An error will be registered in Log-Message if logMissingMessages() has been previously called.

Returns:
the status message

getWorstMessageParms

java.lang.String getWorstMessageParms()
Get the message parameters for this status. It will be the same value that was originally passed in via set() or add().

Returns:
the message parameters

getWorstMessageName

java.lang.String getWorstMessageName()
Get the name of the message from this status's message ID. The message name is the part of the ID before the first tab character (or the entire ID if there is no tab). The name is used as the value of the pyMessageName key property to the Rule-Message object.

Returns:
message name

getWorstSeverity

int getWorstSeverity()
Get the severity of this instance.

Returns:
the severity

getThread

PRThread getThread()
Get the Thread being used by this status object.

Returns:
the thread

isLessSevereThan

boolean isLessSevereThan(int aSeverity)
Compare a severity level with that of this instance.

Parameters:
aSeverity - a severity to compare against this instance
Returns:
true if this instance is less severe than aSeverity

logMissingMessages

boolean logMissingMessages()
Check if missing messages will be logged to Log-Message during getWorstMessage() and getLatestMessage() calls.

Returns:
true if missing messages are being logged

set

void set(int aSeverity,
         java.lang.String aMessageName,
         java.lang.String aMessageParms)
Sets the current status of this instance with a new status and message. Any previous status information is deleted.

Parameters:
aSeverity - the new severity
aMessageName - the new message identifier (a key to Rule-Message)
aMessageParms - the new message parameters (may be null)

set

void set(ProcessingStatus aProcessingStatus)
Sets the current status of this instance with a new status. Any previous status information is deleted.

Parameters:
aProcessingStatus - the new status

setLogMissingMessages

void setLogMissingMessages(boolean aLogMissingMessages)
Activates or deactivate logging of missing messages to Log-Message during getWorstMessage() and getLatestMessage() calls.

Parameters:
aLogMissingMessages -

updateMethodStatus

void updateMethodStatus()
Updates contents of pxThread.pxMethodStatus property. This is typically done automatically during activity processing.



Copyright © 2012 Pegasystems Inc. All Rights Reserved.