com.pega.pegarules.pub.runtime
Interface PublicAPI

All Known Subinterfaces:
StreamBuilderToolKit

public interface PublicAPI

The PublicAPI interface identifies the basic functionality available to all Java generated from defining Rule- instances. It maintains an execution context, associated with a particular PRThread, which varies during the course of processing.

Version:
$Revision: 35658 $ $Date: 2012-10-01 09:31:45 -0400 (Mon, 01 Oct 2012) $
Author:
John van der Meer

Field Summary
static java.lang.String COPYRIGHT
           
static java.lang.String VERSION
           
 
Method Summary
 void applyCollection(StringMap aCollectionKeys, ClipboardPage aPage, ParameterPage aParams)
          Applies a Collection to an instance.
 void applyModel(ClipboardPage aClipboardPage, ParameterPage aNewParamPage, java.lang.String aModelName)
          Apply a model to the specified clipboard page.
 void applyModel(ClipboardPage aClipboardPage, StringMap aKeys, ParameterPage aNewParamPage)
          Apply a model to the specified clipboard page.
 boolean checkCachingHeaders(long aLastModifiedDate, long aFileLength)
          Validate the headers submitted as part of the request match the inputs provided.
 void closeHTMLDoc()
          This must be called after getting a stream that is a top-level document.
 ClipboardPage createPage(java.lang.String aClassName, java.lang.String aPageName)
          Create a new page of the specified class.
 void doAction(StringMap aKeys, ClipboardPage aNewStepPage, ParameterPage aNewParam)
          Executes the identified (typically custom) rule which uses the activity access interface by implementing com.pega.pegarules.pub.runtime.Activity.
 void doActivity(StringMap aKeys, ClipboardPage aNewPrimaryPage, ParameterPage aNewParam)
          Executes the identified processing, which is typically defined by class Rule-Obj-Activity.
 void editInput(ClipboardProperty aTarget, java.lang.String aValue, java.lang.String aEditName)
          Applies Rule-Edit-Input processing (if any) to the specified value before assigning it to the specified (scalar) property.
 boolean editValidate(ClipboardProperty aTarget, java.lang.String aValidateName)
          Evaluates the named Rule-Edit-Validate for the specified (scalar) property.
 java.lang.String entryHandle2Reference(java.lang.String aEntryHandle)
          Convert an entry handle back into its corresponding reference.
 boolean eTagMatches(long aLastModifiedDate)
          Deprecated.  
 boolean evaluateWhen(StringMap aKeys)
          Evaluates the identified conditional.
 ClipboardPage findPage(java.lang.String aPageReference)
          Locates the specified page, which can be either top-level or embedded..
 ClipboardPage findPage(java.lang.String aPageReference, boolean aIfPresent)
          Locates the specified page, which can be either top-level or embedded..
 ClipboardPage findPageByHandle(java.lang.String aInsKey)
          Locates the specified page, which must be top-level, by instance handle.
 ClipboardPage findPageWithException(java.lang.String aPageReference)
          Locates the specified page, which can be either top-level or embedded.
 java.lang.String formatMessage(java.lang.String aKey, Database aDb)
          Return localized value for Text.
 ClipboardPage generateAgentDataPage(ClipboardPage aRuleAgentQueue)
          Create a Data-Agent-Queue page, based on the specified Rule-Agent-Queue instance.
 java.lang.String getActivityClassName()
          Returns a string representing the Java class file name of the currently executing activity.
 ProcessingStatus getActivityStatus()
          Returns the cumulative ProcessingStatus instance to which the current instance will be added.
 AgentUtils getAgentUtils()
          Returns an instance of the AgentUtils class.
 java.lang.Object getAliasValue(ClipboardPage aPage, ImmutablePropertyAliasInfo aPropertyAliasInfo)
          Resolve the identified property alias, by evaluating the alias on the specified clipboard page.
 java.lang.Object getAliasValue(ClipboardPage aPage, java.lang.String aClassName, java.lang.String aAliasName)
          Resolve the identified property alias, by evaluating the alias on the specified clipboard page.
 java.lang.Object getAliasValue(java.lang.String aClassName, java.lang.String aAliasName)
          Resolve the identified property alias, by evaluating the alias on the step page.
 PRAuthorization getAuthorizationHandle()
          Get PRAuthorization instance handle.
 Database getDatabase()
          Identifies a Database instance that can be used for this processing.
 DateTimeUtils getDateTimeUtils()
          Returns the DateTime utility object for this Node.
 Dictionary getDictionary()
          Provides the Dictionary instance associated with this Thread.
 EFormUtils getEFormUtils()
          Returns an instance of the EFormUtils class.
 ClipboardProperty getIfPresent(java.lang.String aReference)
          Provides the ClipboardProperty instance identified by the specified reference, using the current Step Page as the default.
 GeneratedJava getImplementation(StringMap aKeys)
          Deprecated. use one of the specific interface methods such as doAction(com.pega.pegarules.pub.util.StringMap, com.pega.pegarules.pub.clipboard.ClipboardPage, com.pega.pegarules.pub.runtime.ParameterPage)
 com.pega.pegarules.priv.InfEngUtils getInfEngUtils()
          Returns an instance of the InfEngUtils class.
 java.lang.String getLocalizedText(java.lang.String aRef)
          Get the localized text for the property named by the given reference
 java.lang.String getLocalizedTextForString(java.lang.String aRef, java.lang.String aString)
          Get the localized version of the given string, using the localization information from the given property.
 java.lang.String getLocalizedTextForString(java.lang.String aRef, java.lang.String aString, byte aMode)
          Get the localized version of the given string, using the localization information from the given property.
 java.util.Map getMetadata(StringMap aKeys, ClipboardPage aPrimaryPage)
          Returns metadata if available from the rule instance.
 PAL getPAL()
          Returns an instance of the PAL class.
 com.pega.ibm.icu.math.BigDecimal getParamAsBigDecimal(char aType, java.lang.String aName)
          Returns the value, if any, of the named parameter on the current ParameterPage.
 boolean getParamAsBoolean(char aType, java.lang.String aName)
          Returns the value, if any, of the named parameter on the current ParameterPage.
 java.util.Date getParamAsDate(char aType, java.lang.String aName)
          Returns the value, if any, of the named parameter on the current ParameterPage.
 double getParamAsDouble(char aType, java.lang.String aName)
          Returns the value, if any, of the named parameter on the current ParameterPage.
 int getParamAsInteger(char aType, java.lang.String aName)
          Returns the value, if any, of the named parameter on the current ParameterPage.
 java.lang.String getParamCSF(java.lang.String aSource)
          Applies StringUtils.crossScriptingFilter() to tools.getParamValue(aSource) and returns filtered value
 ParameterPage getParameterPage()
          Identifies the current ParameterPage.
 java.lang.String getParamValue(java.lang.String aName)
          Returns the value, if any, of the named parameter on the current ParameterPage.
 ParseState getParseState(java.io.InputStream stream)
          Returns a new instance of ParseState on an InputStream.
 ParseState getParseState(java.io.Reader reader)
          Returns a new instance of ParseState on a Reader.
 ParseUtils getParseUtils()
          Returns an instance of the ParseUtils class.
 PDFUtils getPDFUtils()
          Returns an instance of PDFUtils class
 IPRCrypto getPRCrypto()
          Returns an instance of PegaRules cryptography interface
 ClipboardPage getPrimaryPage()
          Identifies the current Primary Page.
 ClipboardProperty getProperty(java.lang.String aReference)
          Provides the ClipboardProperty instance identified by the specified reference, using the current Step Page as the default.
 PRRequestor getRequestor()
          Identifies the Requestor that 'owns' the current processing.
 java.lang.String getRuleMessage(java.lang.String aMsgDescr)
          Given a Rule-Message descriptor (which consists of a Rule-Message key and a list of tab-separated parameters), produce a verbose message.
 ServiceUtils getServiceUtils()
          Returns an instance of the ServiceUtils class.
 PRStackFrame getStackFrame()
          Identifies the current (top) PRStackFrame instance.
 ClipboardPage getStepPage()
          Identifies the current Step Page.
 ProcessingStatus getStepStatus()
          Returns the ProcessingStatus associated with the current stack frame.
 java.lang.String getStream(StringMap aKeys, ClipboardPage aNewPrimary)
          Builds the stream identified by a set of keys.
 java.lang.String getStream(StringMap aKeys, ClipboardPage aNewPrimary, long aMode)
          Builds the stream identified by a set of keys.
 StructuredUtils getStructuredUtils()
          Returns an instance of the StructuredUtils class.
 PRSystemSettings getSystemSettings()
          Returns the SystemSettings interface
 PRThread getThread()
          Identifies the Thread that 'owns' the current processing.
 TracerUserWatchList getTracerUserWatchList()
          Get the TracerUserWatchList instance.
 XMLUtils getXMLUtils()
          Returns an instance of the XMLUtils class.
 boolean hasIfNoneMatch()
          Did the request that came in have an If-None-Match request header?
 boolean hasImplicitPrivilege(com.pega.pegarules.priv.tracer.RuleTraceInfo aRuleInUse)
          Check user executing the rule has implicit privilege
 boolean interpretBoolean(java.lang.String aBooleanString)
          Interpret a string as a either boolean true or false.
 boolean isFirstActivity()
          Check if current activity is first activity in the execution stack
 boolean isNotModifiedSet()
           
 void openHTMLDoc()
          This must be called before getting a stream that is a top-level document.
 void preventStaleHTTPRequestProcessing(java.lang.String aFrameName)
          Prevent the outgoing HTML frame from being resubmitted by the client after initial submission.
 void putParamValue(java.lang.String aName, boolean aValue)
          Assigns the specified value to the named parameter, on the current ParameterPage.
 void putParamValue(java.lang.String aName, char aType, com.pega.ibm.icu.math.BigDecimal aValue)
          Assigns the specified value to the named parameter, on the current ParameterPage.
 void putParamValue(java.lang.String aName, char aType, boolean aValue)
          Assigns the specified value to the named parameter, on the current ParameterPage.
 void putParamValue(java.lang.String aName, char aType, java.util.Date aValue)
          Assigns the specified value to the named parameter, on the current ParameterPage.
 void putParamValue(java.lang.String aName, char aType, double aValue)
          Assigns the specified value to the named parameter, on the current ParameterPage.
 void putParamValue(java.lang.String aName, char aType, int aValue)
          Assigns the specified value to the named parameter, on the current ParameterPage.
 void putParamValue(java.lang.String aName, char aType, java.lang.Object aValue)
          Assigns the specified value to the named parameter, on the current ParameterPage.
 void putParamValue(java.lang.String aName, char aType, java.lang.String aValue)
          Assigns the specified value to the named parameter, on the current ParameterPage.
 void putParamValue(java.lang.String aName, ClipboardProperty aValue)
          Assigns the specified value (by reference) to the named parameter, on the current ParameterPage.
 void putParamValue(java.lang.String aName, double aValue)
          Assigns the specified value to the named parameter, on the current ParameterPage.
 void putParamValue(java.lang.String aName, int aValue)
          Assigns the specified value to the named parameter, on the current ParameterPage.
 void putParamValue(java.lang.String aName, java.lang.Object aValue)
          Assigns the specified value to the named parameter, on the current ParameterPage.
 void putParamValue(java.lang.String aName, java.lang.String aValue)
          Assigns the specified value to the named parameter, on the current ParameterPage.
 void resetNotModified()
          Sets the clears the result code (if set) for the servlet to 200.
 java.lang.String sendFile(byte[] aFileData, java.lang.String aFileName, boolean aPersistFileToServiceExport, StringMap aHttpHeaders, boolean aSendForDownload)
          Send file data in aFileData.
 java.lang.String sendFile(ClipboardPage aInstancePage, java.lang.String aFileSourceReference, boolean aIsBase64Encoded, java.lang.String aFileNameReference, java.lang.String aFileName, boolean aPersistFileToServiceExport, StringMap aHttpHeaders, boolean aSendForDownload)
          Send file data designated by aFileSourceReference in the clipboard page aInstancePage.
 java.lang.String sendFile(PRFile aFile, boolean aDeleteFile, StringMap aHttpHeaders, boolean aSendForDownload)
          Send file designated by aFile to the client.
 java.lang.String sendFile(StringMap aInstanceKeys, java.lang.String aFileSourceReference, boolean aIsBase64Encoded, java.lang.String aFileNameReference, java.lang.String aFileName, boolean aPersistFileToServiceExport, StringMap aHttpHeaders, boolean aSendForDownload)
          Send file data designated by aFileSourceReference in the instance keyed by aInstanceKeys.
 java.lang.String sendFile(java.lang.String aInstanceHandle, java.lang.String aFileSourceReference, boolean aIsBase64Encoded, java.lang.String aFileNameReference, java.lang.String aFileName, boolean aPersistFileToServiceExport, StringMap aHttpHeaders, boolean aSendForDownload)
          Send file data designated by aFileSourceReference in the instance keyed by aInstanceHandle.
 void sendHTTPRedirect(java.lang.String aLocation)
          Redirect a user to a new location (HTTP 303) This function is only meaningful in the context of a HTTP interaction.
 void setCachingHeaders(long aLastModifiedDate)
          Sets the ETag and Last-Modified headers to contain values appropriate for client side caching.
 void setETag(long aLastModifiedDate)
          Deprecated.  
 void setNotModified()
          Sets the result code for the servlet to 304.
 void setNotModified(boolean aModified)
          Sets the result code for the servlet to 304.
 

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
Method Detail

getActivityStatus

ProcessingStatus getActivityStatus()
Returns the cumulative ProcessingStatus instance to which the current instance will be added.

Returns:
cumulative ProcessingStatus instance that includes current processing

getAuthorizationHandle

PRAuthorization getAuthorizationHandle()
Get PRAuthorization instance handle.

Returns:
PRAutorization instance handle

getStepStatus

ProcessingStatus getStepStatus()
Returns the ProcessingStatus associated with the current stack frame.

Returns:
current ProcessingStatus

getStackFrame

PRStackFrame getStackFrame()
Identifies the current (top) PRStackFrame instance.

Returns:
latest active PRStackFrame for the current processing

getPrimaryPage

ClipboardPage getPrimaryPage()
Identifies the current Primary Page.

Returns:
current Primary Page

getStepPage

ClipboardPage getStepPage()
Identifies the current Step Page.

Returns:
current Step Page

getProperty

ClipboardProperty getProperty(java.lang.String aReference)
Provides the ClipboardProperty instance identified by the specified reference, using the current Step Page as the default.

Parameters:
aReference - property reference that either names its top-level page or is relative to the current Step Page
Returns:
identified ClipboardProperty instance

getIfPresent

ClipboardProperty getIfPresent(java.lang.String aReference)
Provides the ClipboardProperty instance identified by the specified reference, using the current Step Page as the default. If the property is not found, this method returns null.

Parameters:
aReference - property reference that either names its top-level page or is relative to the current Step Page
Returns:
identified ClipboardProperty instance, or null if not found.

getParameterPage

ParameterPage getParameterPage()
Identifies the current ParameterPage.

Returns:
current ParameterPage

getParamValue

java.lang.String getParamValue(java.lang.String aName)
Returns the value, if any, of the named parameter on the current ParameterPage.

Parameters:
aName - parameter whose value is to be returned
Returns:
value of the named parameter, or "" if this parameter is not defined

getParamCSF

java.lang.String getParamCSF(java.lang.String aSource)
Applies StringUtils.crossScriptingFilter() to tools.getParamValue(aSource) and returns filtered value

Parameters:
aSource - name of parameter whose value is to be filtered
Returns:
value of the parameterafter applying crossScriptingFilter

putParamValue

void putParamValue(java.lang.String aName,
                   java.lang.String aValue)
Assigns the specified value to the named parameter, on the current ParameterPage.

Parameters:
aName - parameter to receive the specified value
aValue - value to be assigned to the named parameter. An empty String will be used if the value is null.

putParamValue

void putParamValue(java.lang.String aName,
                   ClipboardProperty aValue)
Assigns the specified value (by reference) to the named parameter, on the current ParameterPage.

Parameters:
aName - parameter to receive the specified value
aValue - value (by reference) to be assigned to the named parameter.

putParamValue

void putParamValue(java.lang.String aName,
                   double aValue)
Assigns the specified value to the named parameter, on the current ParameterPage.

Parameters:
aName - parameter to receive the specified value
aValue - value to be assigned to the named parameter. An empty String will be used if the value is null.

putParamValue

void putParamValue(java.lang.String aName,
                   int aValue)
Assigns the specified value to the named parameter, on the current ParameterPage.

Parameters:
aName - parameter to receive the specified value
aValue - value to be assigned to the named parameter. An empty String will be used if the value is null.

putParamValue

void putParamValue(java.lang.String aName,
                   boolean aValue)
Assigns the specified value to the named parameter, on the current ParameterPage.

Parameters:
aName - parameter to receive the specified value
aValue - value to be assigned to the named parameter. An empty String will be used if the value is null.

putParamValue

void putParamValue(java.lang.String aName,
                   java.lang.Object aValue)
Assigns the specified value to the named parameter, on the current ParameterPage.

Parameters:
aName - parameter to receive the specified value
aValue - value to be assigned to the named parameter.

getRequestor

PRRequestor getRequestor()
Identifies the Requestor that 'owns' the current processing.

Returns:
PRRequestor instance associated with the current processing

getThread

PRThread getThread()
Identifies the Thread that 'owns' the current processing.

Returns:
PRThread instance associated with the current processing

createPage

ClipboardPage createPage(java.lang.String aClassName,
                         java.lang.String aPageName)
Create a new page of the specified class. If an existing page has the same name, the old page becomes anonymous. Pages with reserved names (starting with "px", "pz", etc.) cannot be created.

Parameters:
aClassName - object class
aPageName - name of page
Returns:
ClipboardPage

findPage

ClipboardPage findPage(java.lang.String aPageReference)
Locates the specified page, which can be either top-level or embedded..

Parameters:
aPageReference - name of a top-level page, or reference to an embedded page
Returns:
the specified ClipboardPage instance, or null if the referenced page is not known to this Thread

findPage

ClipboardPage findPage(java.lang.String aPageReference,
                       boolean aIfPresent)
Locates the specified page, which can be either top-level or embedded..

Parameters:
aPageReference - name of a top-level page, or reference to an embedded page.
aIfPresent - true if the page should only be returned if it is present, false if the page should be created and returned if it isn't already present
Returns:
the specified ClipboardPage instance or null if the referenced page could not be created (when aIfPresent is false), or if the page does not exist (when aIfPresent is true)

findPageWithException

ClipboardPage findPageWithException(java.lang.String aPageReference)
Locates the specified page, which can be either top-level or embedded.

Parameters:
aPageReference - name of a top-level page, or reference to an embedded page
Returns:
the specified ClipboardPage instance
Throws:
InvalidReferenceException - if the referenced page is not known to this Thread

getDatabase

Database getDatabase()
Identifies a Database instance that can be used for this processing.

Returns:
Database instance associated with current processing

getDictionary

Dictionary getDictionary()
Provides the Dictionary instance associated with this Thread.

Returns:
Dictionary for the class requested

getDateTimeUtils

DateTimeUtils getDateTimeUtils()
Returns the DateTime utility object for this Node. It is a singleton because of the cost of setting up DateTimeFormat objects.

Returns:
DateTimeUtils

getInfEngUtils

com.pega.pegarules.priv.InfEngUtils getInfEngUtils()
Returns an instance of the InfEngUtils class.

Returns:
InfEngUtils

getServiceUtils

ServiceUtils getServiceUtils()
Returns an instance of the ServiceUtils class.

Returns:
ServiceUtils

getTracerUserWatchList

TracerUserWatchList getTracerUserWatchList()
Get the TracerUserWatchList instance.

Returns:
TracerUserWatchList instance

getAgentUtils

AgentUtils getAgentUtils()
Returns an instance of the AgentUtils class.

Returns:
AgentUtils

getPRCrypto

IPRCrypto getPRCrypto()
Returns an instance of PegaRules cryptography interface

Returns:
IPRCrypto instance

getParseState

ParseState getParseState(java.io.InputStream stream)
Returns a new instance of ParseState on an InputStream.

Parameters:
stream - InputStream to use as source of data.
Returns:
a new ParseState instance

getParseState

ParseState getParseState(java.io.Reader reader)
Returns a new instance of ParseState on a Reader.

Parameters:
reader - Reader to use as source of data.
Returns:
a new ParseState instance

getParseUtils

ParseUtils getParseUtils()
Returns an instance of the ParseUtils class.

Returns:
ParseUtils

getEFormUtils

EFormUtils getEFormUtils()
Returns an instance of the EFormUtils class.

Returns:
EFormUtils

getStructuredUtils

StructuredUtils getStructuredUtils()
Returns an instance of the StructuredUtils class.

Returns:
StructuredUtils

getXMLUtils

XMLUtils getXMLUtils()
Returns an instance of the XMLUtils class.

Returns:
XMLUtils

getPAL

PAL getPAL()
Returns an instance of the PAL class.

Returns:
PAL

getSystemSettings

PRSystemSettings getSystemSettings()
Returns the SystemSettings interface

Returns:
PRSystemSettings

doAction

void doAction(StringMap aKeys,
              ClipboardPage aNewStepPage,
              ParameterPage aNewParam)
Executes the identified (typically custom) rule which uses the activity access interface by implementing com.pega.pegarules.pub.runtime.Activity.

Parameters:
aKeys - specifies the desired Rule- reference. A value must be specified for pxObjClass, which determines the other values that are used. If the named class is subject to class inheritance, a value specified for pyClassName must be consistent with the class of the Step Page, or pyClassName will be defaulted to the class of the Step Page.
aKeys is a StringMap which is implemented by HashStringMap and ClipboardPage.
aNewStepPage - new Step Page, or null to retain current one
aNewParam - new ParameterPage, or null to retain current one

doActivity

void doActivity(StringMap aKeys,
                ClipboardPage aNewPrimaryPage,
                ParameterPage aNewParam)
Executes the identified processing, which is typically defined by class Rule-Obj-Activity. This method resets the current Primary Page, so is intended only for use with Rule-Obj-Activity, and certain other classes that require this unusual behavior. Most generated Java classes that implement the Activity interface should be invoked using the doAction(com.pega.pegarules.pub.util.StringMap, com.pega.pegarules.pub.clipboard.ClipboardPage, com.pega.pegarules.pub.runtime.ParameterPage) method.

Parameters:
aKeys - specifies the desired Rule- reference. Recognized values are:
  • pxObjClass - (optional) name of defining class; defaults to Rule-Obj-Activity. The actual value used determines what other values might be significant.
  • pyClassName - (optional) explicit class of definition that is subject to class inheritance. The actual class of the Primary Page used (which is the default) must be an instance of any specified pyClassName.
  • - additional key properties will depend on the value of pxObjClass
  • . For the default case (Activity) one key property is required - pyActivityName, for other rules consult the rule class definition in Rule-Obj-Class.
aKeys is a StringMap which is implemented by HashStringMap and ClipboardPage.
aNewPrimaryPage - new Primary Page, or null to retain current one. NOTE: the current value of the Primary Page is used as the basis for evaluating circumstance, so care must be taken in determining when this value should be modified, hence when this method should be used.
aNewParam - new ParameterPage, or null to retain current one
Throws:
RuleGenerationException - An error that indicates there was a problem during generation of the activity.

getStream

java.lang.String getStream(StringMap aKeys,
                           ClipboardPage aNewPrimary)
Builds the stream identified by a set of keys. By default, the stream allows input.

The keys must be the key properties of a stream rule. (If the pxObjClass property is missing, then it is assumed to be Rule-Obj-HTML.)

In addition to the rule's key properties, the special pzInput property may be specified to indicate whether the stream should be displayed with input enabled. The value of this property may be set to StreamBuilder.sInputEnabled, which is the default, or StreamBuilder.sNoInput. If you this property, consider using the getStream(StringMap, ClipboardPage, long) method instead.

Parameters:
aKeys - specifies the desired stream
aNewPrimary - new Primary Page, or null to retain current one
Returns:
the generated stream

getStream

java.lang.String getStream(StringMap aKeys,
                           ClipboardPage aNewPrimary,
                           long aMode)
Builds the stream identified by a set of keys. The stream will be displayed in the specified mode.

The keys must be the key properties of a stream rule. (If the pxObjClass property is missing, then it is assumed to be Rule-Obj-HTML.)

Parameters:
aKeys - specifies the desired stream
aNewPrimary - new Primary Page, or null to retain current one
aMode - mode in which the stream should be displayed. This must be one or more of the MODE_ constants specified in StreamBuilder, or'd together.
Returns:
the generated stream

evaluateWhen

boolean evaluateWhen(StringMap aKeys)
Evaluates the identified conditional.

Parameters:
aKeys - specifies the desired conditional. Recognized values are:
  • pxObjClass - (optional) name of when-block definition class, which must be an instance of Rule-Obj-When (which is the default)
  • pyClassName - (optional) explicit class of when-block definition. The actual class of the Primary Page used (which is the default) must be an instance of any specified pyClassName.
  • pyBlockName - (required) name of the conditional
  • - additional key properties are possible for alternate values of pxObjClass
Returns:
boolean result of the conditional
Throws:
IndeterminateConditionalException - if any processing error prevents reliable evaluation of the conditional

applyModel

void applyModel(ClipboardPage aClipboardPage,
                ParameterPage aNewParamPage,
                java.lang.String aModelName)
Apply a model to the specified clipboard page.

Parameters:
aClipboardPage - Reference to target clipboard page
aNewParamPage - New parameter page to use. null will use current parameter page.
aModelName - Name of a Rule-Obj-Model instance to execute

applyModel

void applyModel(ClipboardPage aClipboardPage,
                StringMap aKeys,
                ParameterPage aNewParamPage)
Apply a model to the specified clipboard page.

Parameters:
aClipboardPage - Reference to target clipboard page
aKeys - Specifies the desired model instance.
aNewParamPage - New parameter page to use. null will use current parameter page.

editInput

void editInput(ClipboardProperty aTarget,
               java.lang.String aValue,
               java.lang.String aEditName)
Applies Rule-Edit-Input processing (if any) to the specified value before assigning it to the specified (scalar) property. If no input editing is indicated, the value is assigned to the property as is.

Parameters:
aTarget - property to receive a new value
aValue - input String to be processed and assigned
aEditName - name of the Rule-Edit-Input to use, or null to use the one defined for this property
Throws:
InvalidParameterException - if the property is null
WrongModeException - if the property is not scalar

editValidate

boolean editValidate(ClipboardProperty aTarget,
                     java.lang.String aValidateName)
Evaluates the named Rule-Edit-Validate for the specified (scalar) property.

Parameters:
aTarget - property to be checked
aValidateName - name of the Rule-Edit-Validate to use
Returns:
true if validation successful
Throws:
InvalidParameterException - if the property is null or no Rule-Edit-Validate is named
WrongModeException - if the property is not scalar
IndeterminateConditionalException - if the named Rule-Edit-Validate cannot be processed

getMetadata

java.util.Map getMetadata(StringMap aKeys,
                          ClipboardPage aPrimaryPage)
Returns metadata if available from the rule instance. If no metadata is available or if the rule instance is not metadata aware, the method returns null.

Parameters:
aKeys - keys to the desired Rule- instance for which metadata is retrieved
aPrimaryPage - primary page on which the rule is being applied. Some rules (such as Rule-Obj-Validate) require that this page be a named page.
Returns:
Map of metadata from the rule instance

getImplementation

GeneratedJava getImplementation(StringMap aKeys)
                                throws FirstUseAssemblerException
Deprecated. use one of the specific interface methods such as doAction(com.pega.pegarules.pub.util.StringMap, com.pega.pegarules.pub.clipboard.ClipboardPage, com.pega.pegarules.pub.runtime.ParameterPage)

Returns an instance of the GeneratedJava implementation class, that implements the specified Rule- reference. This is the recommended method to use for custom rules that do not use the Activity access interface or are otherwise incompatible with the details of the defined methods therein.

Parameters:
aKeys - specifies the desired Rule- reference. A value must be specified for pxObjClass, which determines the other values that are used. If the named class is subject to class inheritance, a value specified for pyClassName must be consistent with the class of the Step Page, or pyClassName will be defaulted to the class of the Step Page.
Returns:
the requested instance
Throws:
FirstUseAssemblerException - when unable to provide the requested instance

generateAgentDataPage

ClipboardPage generateAgentDataPage(ClipboardPage aRuleAgentQueue)
Create a Data-Agent-Queue page, based on the specified Rule-Agent-Queue instance.

Parameters:
aRuleAgentQueue - The Rule-Agent-Queue instance to use
Returns:
ClipboardPage The resulting Data-Agent-Queue page

interpretBoolean

boolean interpretBoolean(java.lang.String aBooleanString)
Interpret a string as a either boolean true or false. If the string matches "1", "-1", "true", "on", "yes", "t", or "y", the return value is true. Otherwise, the return value is false.

Parameters:
aBooleanString - String to interpret
Returns:
boolean The intrepreted boolean value of the String

getActivityClassName

java.lang.String getActivityClassName()
Returns a string representing the Java class file name of the currently executing activity. Can be used by the activity as a synchronization key that gets passed to LockManager.lock() to ensure exclusive execution of the given activity across all running Requestors.

Returns:
String The Java class file name of the currently executing activity.

preventStaleHTTPRequestProcessing

void preventStaleHTTPRequestProcessing(java.lang.String aFrameName)
Prevent the outgoing HTML frame from being resubmitted by the client after initial submission. This method generates a synchronization token that is inserted into the outgoing HTML and analyzed by the server upon form submission to avoid duplicate request processing. This frame synchronization is useful in situations where form submission performs a database commit which must be done only once per interaction.

Parameters:
aFrameName - Name of frame, or null for current incoming frame, or "*" for all frames.

hasIfNoneMatch

boolean hasIfNoneMatch()
Did the request that came in have an If-None-Match request header?

Returns:
true if it was present, otherwise false
Engineering owner
clinb

eTagMatches

boolean eTagMatches(long aLastModifiedDate)
Deprecated. 

Returns true iff expiration date, processed into an eTag, matches the one supplied with the request. Side effect: If the etags don't match, add an etag to the response header.

Parameters:
aLastModifiedDate - date to use in computing the eTag
Returns:
true if the computeded eTag matched the one supplied with the request, otherwise false
Engineering owner
clinb

setCachingHeaders

void setCachingHeaders(long aLastModifiedDate)
Sets the ETag and Last-Modified headers to contain values appropriate for client side caching.

Parameters:
aLastModifiedDate - The last modified date/time of the target in question. Typically, this is a File.lastModified()
Engineering owner
gajnj

checkCachingHeaders

boolean checkCachingHeaders(long aLastModifiedDate,
                            long aFileLength)
Validate the headers submitted as part of the request match the inputs provided. This function will compare the If-None-Match/ETag and the If-Modified-Since/Last-Modified headers, to ensure that they match.

Parameters:
aLastModifiedDate - the last time the resource was modified, typically a File.lastModified()
aFileLength - size of the target in question, typically a File.length()
Returns:
true if headers match

setETag

void setETag(long aLastModifiedDate)
Deprecated. 

Sets the ETag and Last-Modified headers to contain values appropriate for client side caching.

Parameters:
aLastModifiedDate -
Engineering owner
clinb

setNotModified

void setNotModified()
Sets the result code for the servlet to 304.

Engineering owner
clinb

setNotModified

void setNotModified(boolean aModified)
Sets the result code for the servlet to 304.

Parameters:
aModified - true to send a 304, false otherwise.
Engineering owner
clinb

isNotModifiedSet

boolean isNotModifiedSet()
Returns:
true if the current processing is set to return an HTTP 304, otherwise false.
Engineering owner
clinb

resetNotModified

void resetNotModified()
Sets the clears the result code (if set) for the servlet to 200.

Engineering owner
clinb

formatMessage

java.lang.String formatMessage(java.lang.String aKey,
                               Database aDb)
Return localized value for Text.

Parameters:
aKey - Rule-Message key
aDb -
Returns:
String value of the Rule-Message, if Rule-Message is not found returns the key
Engineering owner
nayar

getRuleMessage

java.lang.String getRuleMessage(java.lang.String aMsgDescr)
Given a Rule-Message descriptor (which consists of a Rule-Message key and a list of tab-separated parameters), produce a verbose message. If the specified Rule-Message cannot be found, aMsgDescr is returned with "** " prepended.

Parameters:
aMsgDescr - a message descriptor. Consists of a Rule-Message key followed by optional parameters in the format of "\\tparam".
Returns:
the formatted message

getAliasValue

java.lang.Object getAliasValue(java.lang.String aClassName,
                               java.lang.String aAliasName)
Resolve the identified property alias, by evaluating the alias on the step page. The Rule-Obj-Property-Alias instance must exist within the class of the step page.

Parameters:
aClassName - the pyClassName of the desired alias instance.
aAliasName - the pyPropertyName of the desired alias instance.
Returns:
Object The computed value of the alias

getAliasValue

java.lang.Object getAliasValue(ClipboardPage aPage,
                               java.lang.String aClassName,
                               java.lang.String aAliasName)
Resolve the identified property alias, by evaluating the alias on the specified clipboard page. The Rule-Obj-Property-Alias instance must exist within the class of the specified page.

Parameters:
aPage - Clipboard page used to evaluate the alias, or null to use current step page.
aClassName - the pyClassName of the desired alias instance.
aAliasName - the pyPropertyName of the desired alias instance.
Returns:
Object The computed value of the alias

getAliasValue

java.lang.Object getAliasValue(ClipboardPage aPage,
                               ImmutablePropertyAliasInfo aPropertyAliasInfo)
Resolve the identified property alias, by evaluating the alias on the specified clipboard page. The Rule-Obj-Property-Alias instance must exist within the class of the specified page.

Parameters:
aPage - Clipboard page used to evaluate the alias, or null to use current step page.
aPropertyAliasInfo - An ImmutablePropertyAliasInfo instance representing the alias to use.
Returns:
Object The computed value of the alias

getLocalizedText

java.lang.String getLocalizedText(java.lang.String aRef)
Get the localized text for the property named by the given reference

Parameters:
aRef - A reference to the property
Returns:
The property as a localized String. No HTML encoding is performed.

getLocalizedTextForString

java.lang.String getLocalizedTextForString(java.lang.String aRef,
                                           java.lang.String aString)
Get the localized version of the given string, using the localization information from the given property.

Parameters:
aRef - A reference to the property
aString - The string to localize
Returns:
The string localized as an instance of the property. No HTML encoding is performed.

getLocalizedTextForString

java.lang.String getLocalizedTextForString(java.lang.String aRef,
                                           java.lang.String aString,
                                           byte aMode)
Get the localized version of the given string, using the localization information from the given property. The stream is encoded according to the specified mode.

Parameters:
aRef - A reference to the property
aString - The string to localize
aMode - if StreamBuilder.FMT_NORMAL, then the stream is encoded for HTML. If StreamBuilder.FMT_LITERAL, then no encoding is performed.
Returns:
The string localized as an instance of the property

getParamAsBigDecimal

com.pega.ibm.icu.math.BigDecimal getParamAsBigDecimal(char aType,
                                                      java.lang.String aName)
Returns the value, if any, of the named parameter on the current ParameterPage.

Parameters:
aType - declared PropertyInfo type code for parameter. See ImmutablePropertyInfo documentation for valid types.
aName - parameter whose value is to be returned
Returns:
value of the named parameter, or BigDecimal.ZERO if this parameter is not defined
Throws:
java.lang.NullPointerException - if there is no current ParameterPage

getParamAsBoolean

boolean getParamAsBoolean(char aType,
                          java.lang.String aName)
Returns the value, if any, of the named parameter on the current ParameterPage.

Parameters:
aType - declared PropertyInfo type code for parameter. See ImmutablePropertyInfo documentation for valid types.
aName - parameter whose value is to be returned
Returns:
value of the named parameter, or false if this parameter is not defined
Throws:
java.lang.NullPointerException - if there is no current ParameterPage

getParamAsDate

java.util.Date getParamAsDate(char aType,
                              java.lang.String aName)
Returns the value, if any, of the named parameter on the current ParameterPage.

Parameters:
aType - declared PropertyInfo type code for parameter. See ImmutablePropertyInfo documentation for valid types.
aName - parameter whose value is to be returned
Returns:
value of the named parameter, or Date(0) if this parameter is not defined
Throws:
java.lang.NullPointerException - if there is no current ParameterPage

getParamAsDouble

double getParamAsDouble(char aType,
                        java.lang.String aName)
Returns the value, if any, of the named parameter on the current ParameterPage.

Parameters:
aType - declared PropertyInfo type code for parameter. See ImmutablePropertyInfo documentation for valid types.
aName - parameter whose value is to be returned
Returns:
value of the named parameter, or 0.0 if this parameter is not defined
Throws:
java.lang.NullPointerException - if there is no current ParameterPage

getParamAsInteger

int getParamAsInteger(char aType,
                      java.lang.String aName)
Returns the value, if any, of the named parameter on the current ParameterPage.

Parameters:
aType - declared PropertyInfo type code for parameter. See ImmutablePropertyInfo documentation for valid types.
aName - parameter whose value is to be returned
Returns:
value of the named parameter, or 0 if this parameter is not defined
Throws:
java.lang.NullPointerException - if there is no current ParameterPage

putParamValue

void putParamValue(java.lang.String aName,
                   char aType,
                   com.pega.ibm.icu.math.BigDecimal aValue)
Assigns the specified value to the named parameter, on the current ParameterPage.

Parameters:
aName - parameter to receive the specified value
aType - declared PropertyInfo type code for the parameter. See ImmutablePropertyInfo documentation for valid types.
aValue - value to be assigned to the named parameter.
Throws:
java.lang.NullPointerException - if there is no current ParameterPage

putParamValue

void putParamValue(java.lang.String aName,
                   char aType,
                   boolean aValue)
Assigns the specified value to the named parameter, on the current ParameterPage.

Parameters:
aName - parameter to receive the specified value
aType - declared PropertyInfo type code for the parameter. See ImmutablePropertyInfo documentation for valid types.
aValue - value to be assigned to the named parameter.
Throws:
java.lang.NullPointerException - if there is no current ParameterPage

putParamValue

void putParamValue(java.lang.String aName,
                   char aType,
                   java.util.Date aValue)
Assigns the specified value to the named parameter, on the current ParameterPage.

Parameters:
aName - parameter to receive the specified value
aType - declared PropertyInfo type code for the parameter. See ImmutablePropertyInfo documentation for valid types.
aValue - value to be assigned to the named parameter.
Throws:
java.lang.NullPointerException - if there is no current ParameterPage

putParamValue

void putParamValue(java.lang.String aName,
                   char aType,
                   double aValue)
Assigns the specified value to the named parameter, on the current ParameterPage.

Parameters:
aName - parameter to receive the specified value
aType - declared PropertyInfo type code for the parameter. See ImmutablePropertyInfo documentation for valid types.
aValue - value to be assigned to the named parameter.
Throws:
java.lang.NullPointerException - if there is no current ParameterPage

putParamValue

void putParamValue(java.lang.String aName,
                   char aType,
                   int aValue)
Assigns the specified value to the named parameter, on the current ParameterPage.

Parameters:
aName - parameter to receive the specified value
aType - declared PropertyInfo type code for the parameter. See ImmutablePropertyInfo documentation for valid types.
aValue - value to be assigned to the named parameter.
Throws:
java.lang.NullPointerException - if there is no current ParameterPage

putParamValue

void putParamValue(java.lang.String aName,
                   char aType,
                   java.lang.Object aValue)
Assigns the specified value to the named parameter, on the current ParameterPage.

Parameters:
aName - parameter to receive the specified value
aType - declared PropertyInfo type code for the parameter (ignored). See ImmutablePropertyInfo documentation for valid types.
aValue - value to be assigned to the named parameter.
Throws:
java.lang.NullPointerException - if there is no current ParameterPage

putParamValue

void putParamValue(java.lang.String aName,
                   char aType,
                   java.lang.String aValue)
Assigns the specified value to the named parameter, on the current ParameterPage.

Parameters:
aName - parameter to receive the specified value
aType - declared PropertyInfo type code for the parameter (ignored). See ImmutablePropertyInfo documentation for valid types.
aValue - value to be assigned to the named parameter. An empty String will be used if the value is null.
Throws:
java.lang.NullPointerException - if there is no current ParameterPage

sendHTTPRedirect

void sendHTTPRedirect(java.lang.String aLocation)
Redirect a user to a new location (HTTP 303) This function is only meaningful in the context of a HTTP interaction.

Parameters:
aLocation - the query string part of the redirect, or null if the engine should recalculate based off of the incoming URL based off of the one that spawned this operation

openHTMLDoc

void openHTMLDoc()
This must be called before getting a stream that is a top-level document.


closeHTMLDoc

void closeHTMLDoc()
This must be called after getting a stream that is a top-level document.


applyCollection

void applyCollection(StringMap aCollectionKeys,
                     ClipboardPage aPage,
                     ParameterPage aParams)
Applies a Collection to an instance.

Parameters:
aCollectionKeys - the keys to the Collection Rule to apply
aPage - the instance
aParams - the parameter page to use, or null if the same one should be used

findPageByHandle

ClipboardPage findPageByHandle(java.lang.String aInsKey)
Locates the specified page, which must be top-level, by instance handle.

Parameters:
aInsKey - Instance handle of a top-level page.
Returns:
the specified ClipboardPage instance, or null if the referenced page is not known to this Thread.

getPDFUtils

PDFUtils getPDFUtils()
Returns an instance of PDFUtils class

Returns:
PDFUtils instance

sendFile

java.lang.String sendFile(PRFile aFile,
                          boolean aDeleteFile,
                          StringMap aHttpHeaders,
                          boolean aSendForDownload)
Send file designated by aFile to the client.

Parameters:
aFile - the file abstract pathname
aDeleteFile - should this file be deleted after it gets sent to the client. set to true to avoid to have to cleanup after, and set it to false if the file will be accessed multiple times.
aHttpHeaders - specifies custom http headers to use when sending this file data (overrides aSendForDownload).
aSendForDownload - should this file be sent for download (if true, appropriate HTTP headers get added).
Returns:
null if successful, otherwise check returned string for error messages.

sendFile

java.lang.String sendFile(byte[] aFileData,
                          java.lang.String aFileName,
                          boolean aPersistFileToServiceExport,
                          StringMap aHttpHeaders,
                          boolean aSendForDownload)
Send file data in aFileData.

Parameters:
aFileData - file data to be sent to client.
aFileName - file name to use when sending or writing to server's ServiceExport directory the file data.
aPersistFileToServiceExport - should this file be written to server's ServiceExport directory. set this to true only if the file will be accessed multiple times.
aHttpHeaders - specifies custom http headers to use when sending this file data (overrides aSendForDownload).
aSendForDownload - should this file be sent for download (if true, appropriate HTTP headers get added).
Returns:
null if successful, otherwise check returned string for error messages.

sendFile

java.lang.String sendFile(StringMap aInstanceKeys,
                          java.lang.String aFileSourceReference,
                          boolean aIsBase64Encoded,
                          java.lang.String aFileNameReference,
                          java.lang.String aFileName,
                          boolean aPersistFileToServiceExport,
                          StringMap aHttpHeaders,
                          boolean aSendForDownload)
Send file data designated by aFileSourceReference in the instance keyed by aInstanceKeys. This method will open the instance designated by aInstanceKeys and looks up the property that hold file data using aFileSourceReference.

Parameters:
aInstanceKeys - keys of the instance to be opened.
aFileSourceReference - property reference name to data file in the instance.
aIsBase64Encoded - was the file data in the instance to opened encoded using base64 encoding.
aFileNameReference - property reference name to file name in the instance.
aFileName - file name to use when sending or writing to server's ServiceExport directory the file data. if set to null, content of the clipboad property referenced by aFileNameReference will get used instead.
aPersistFileToServiceExport - should this file be written to server's ServiceExport directory. set this to true only if the file will be accessed multiple times.
aHttpHeaders - specifies custom http headers to use when sending this file data (overrides aSendForDownload).
aSendForDownload - should this file be sent for download (if true, appropriate HTTP headers get added.)
Returns:
null if successful, otherwise check returned string for error messages.

sendFile

java.lang.String sendFile(java.lang.String aInstanceHandle,
                          java.lang.String aFileSourceReference,
                          boolean aIsBase64Encoded,
                          java.lang.String aFileNameReference,
                          java.lang.String aFileName,
                          boolean aPersistFileToServiceExport,
                          StringMap aHttpHeaders,
                          boolean aSendForDownload)
Send file data designated by aFileSourceReference in the instance keyed by aInstanceHandle. This method will open the instance designated by aInstanceHandle and looks up the property that holds file data using aFileSourceReference.

Parameters:
aInstanceHandle - aInstanceHandle key handle of the instance to be opened.
aFileSourceReference - property reference name to file data in the instance.
aIsBase64Encoded - was the file data in the instance to be opened encoded using base64 encoding.
aFileNameReference - property reference name to file name in the instance.
aFileName - file name to use when sending or writing to server's ServiceExport directory the file data. if set to null, content of the clipboad property referenced by aFileNameReference will get used instead.
aPersistFileToServiceExport - should this file be written to server's ServiceExport directory. set this to true only if the file will be accessed multiple times
aHttpHeaders - specifies custom http headers to use when sending this file data (overrides aSendForDownload).
aSendForDownload - should this file be sent for download (if true, appropriate HTTP headers get added).
Returns:
null if successful, otherwise check returned string for error messages.

sendFile

java.lang.String sendFile(ClipboardPage aInstancePage,
                          java.lang.String aFileSourceReference,
                          boolean aIsBase64Encoded,
                          java.lang.String aFileNameReference,
                          java.lang.String aFileName,
                          boolean aPersistFileToServiceExport,
                          StringMap aHttpHeaders,
                          boolean aSendForDownload)
Send file data designated by aFileSourceReference in the clipboard page aInstancePage.

Parameters:
aInstancePage - reference to instnace clipboard page that contains file data.
aFileSourceReference - property reference name to file data in the instance.
aIsBase64Encoded - was the file data in the instance to be opened encoded using base64 encoding.
aFileNameReference - property reference name to file name in the instance.
aFileName - file name to use when sending or writing to server's ServiceExport directory the file data. if set to null, content of the clipboad property referenced by aFileNameReference will get used instead.
aPersistFileToServiceExport - should this file be written to server's ServiceExport directory. set this to true only if the file will be accessed multiple times
aHttpHeaders - specifies custom http headers to use when sending this file data (overrides aSendForDownload).
aSendForDownload - should this file be sent for download (if true, appropriate HTTP headers get added).
Returns:
null if successful, otherwise check returned string for error messages.

entryHandle2Reference

java.lang.String entryHandle2Reference(java.lang.String aEntryHandle)
Convert an entry handle back into its corresponding reference.

Parameters:
aEntryHandle - The entry handle to convert
Returns:
String Corresponding Reference

isFirstActivity

boolean isFirstActivity()
Check if current activity is first activity in the execution stack

Returns:
boolean value

hasImplicitPrivilege

boolean hasImplicitPrivilege(com.pega.pegarules.priv.tracer.RuleTraceInfo aRuleInUse)
Check user executing the rule has implicit privilege

Parameters:
aRuleInUse - RuleTraceInfo for the rule
Returns:
boolean value


Copyright © 2012 Pegasystems Inc. All Rights Reserved.