com.pega.pegarules.pub.database
Interface Database


public interface Database

Manages database access. Each Thread has an instance of this class, that it can use to access the database.

Many methods take a parameter indicating whether security checks should be performed. If true, then the methods verify that the current operator (whose information is stored in the requestor context) can perform the operation, and throw an exception if the operator can not.

When this document talks about "deferring" a database operation, it means that the database operation is performed when the commit() method is next called (or cancelled when rollback() is called).

Version:
$Revision: 31081 $ $Date: 2012-07-12 19:41:27 -0400 (Thu, 12 Jul 2012) $
Author:
Jamie Gentry

Field Summary
static java.lang.String COPYRIGHT
           
static java.lang.String VERSION
           
 
Method Summary
 void addToUpdatesCache(java.lang.String aClearType, ClipboardPage aInstancePage, java.lang.String aParameters, boolean aPerformOnThisNode, boolean aPerformOnAllSystems)
          Cause a rule instance to be updated on all nodes during their system pulse.
 void addToUpdatesCache(java.lang.String aClearType, java.lang.String aObjClass, java.lang.String aInsKey, java.lang.String aParameters, boolean aPerformOnThisNode, boolean aPerformOnAllSystems)
          Cause a rule instance to be updated on all nodes during their system pulse.
 void cancelDeferredUpdate(ClipboardPage aInstancePage)
          Cancels the deferred addition, deletion, or update of a page.
 void clearCache()
          Clears all entries from the database cache.
 void commit()
          Commits the current PegaRULES Transaction (applies all deferred database changes).
 void convertListCriteria(ClipboardPage aListPage)
          Converts an old-style (version 2) list criteriapage to a current list criteria page.
 boolean delete(ClipboardPage aInstancePage, boolean aCheckSecurity)
          Immediately deletes a database instance from an object table.
 void deleteDeferred(ClipboardPage aInstancePage, boolean aCheckSecurity)
          Defers deleting a database instance from an object table.
 void deleteRDB(java.lang.String aObjectClass, java.lang.String aRequestType, java.lang.String aAccessMethod, boolean aCheckSecurity)
          Immediately deletes data from the database using an RDB rule.
 boolean doClassesBelongToSingleDb(boolean aUseReportDb, java.util.ArrayList aClasses)
          Figures out if all classes in a SQL statement use the same dtabase instance.
 boolean doesInstanceExist(java.lang.String aInstanceHandle)
          Indicates whether a particular instance exists in the database.
 void executeDBSchemaUpdates(java.util.List aSQL, java.lang.String aDBName, java.lang.String aUserName, java.lang.String aPassword)
          Executes SQL statements against a particular database, connecting with a specified user name.
 int executeRDB(java.lang.String aSQL, ClipboardPage aListPage)
          Executes a SQL statement.
 java.lang.String findHandle(StringMap aKeys)
          Finds the handle of the instance that would be opened given a set of keys.
 void flushUpdatesCache(int aDeltaMinutes)
          Flush out entries in pr_sys_updatescache older than given number of minutes
 ClassDefinition getClassDef(java.lang.String aClassName)
          Returns information about a class.
 java.util.Collection getClassesInTable(java.lang.String aDBName, java.lang.String aTableName)
          Deprecated. use getClassesInTable(java.lang.String, java.lang.String, java.lang.String, java.lang.String) instead
 java.util.Collection getClassesInTable(java.lang.String aDBName, java.lang.String aCatalog, java.lang.String aSchema, java.lang.String aTable)
          Gets all the classes that live in a particular database table.
 java.lang.String getColumnDataTypeForProperty(java.lang.String aClassName, java.lang.String aPropertyName)
          Returns the column data type for a property whether explicitly mapped or not.
 java.lang.String getColumnForProperty(java.lang.String aClassName, java.lang.String aPropertyName)
          Returns the column name for a property whether explicitly mapped or not.
 java.util.SortedSet getColumnsForTable(java.lang.String aDBName, java.lang.String aTableName)
          Deprecated. this method does not allow you to specify the catalog and schema of the table
 java.lang.String[] getConcreteDescendantsInCurrentApplication(java.lang.String aAncestorName)
          Returns the names of descendant classes of the given class that are concrete and are in the current Application's rule sets, in distance order, nearest first.
 java.lang.String getDataUniqueID(java.lang.String aOrganization, java.lang.String aPrefix, java.lang.String aSuffix)
          Obtain a unique ID value for items
 DatabaseInformation getDBInfo(java.lang.String aDBName)
          Returns low-level information about a database.
 java.util.List getDBSchemas(java.lang.String aDBName)
          Returns a array of strings that are the schema's available from this db connection.
 java.util.Collection getDBTables(java.lang.String aDBName, java.lang.String aCatalogName, java.lang.String aSchemaName, java.lang.String[] aTableTypes)
          Returns a Collection of com.pega.pegarules.pub.database.DatabaseTable objects that contain information about a database's tables.
 ClassDefinition getFirstRealPatternAncestor(java.lang.String aClassName)
          Goes through the pattern ancestors of this class, and returns the first one that names a real class.
 java.lang.String getHandle(StringMap aInstancePage)
          Calculates the handle of an instance.
 java.lang.String getInsIdFromInsName(java.lang.String aInstanceClass, java.lang.String aInstanceName)
          Gets the instance id using instance name
 java.lang.String getInstanceName(StringMap aInstancePage, ClassDefinition aClassDef)
          Get the instance name for a page.
 LockManager getLockManager()
          Retrieves the lock manager.
 java.util.Map getPropertyToColumnMap(java.lang.String aClassName)
          Returns the explicit map of properties to columns.
 RulesetContext getRulesetContext(ClipboardPage aRulePage)
          Returns rule editing tools associated with a particular page.
 RulesetContext getRulesetContext(ClipboardPage aRulePage, java.lang.String aRuleSetNameProperty, java.lang.String aRuleSetVersionProperty)
          Returns rule editing tools associated with a particular page when the page has non-standard RuleSet name and RuleSet version properties.
 java.util.List<java.lang.String> getRulesetsFromApplication(java.util.List aApplicationList, boolean aFollowDependencies, boolean aFollowByParent)
          Takes a list of Applications and returns the rulesets defined in those applications
 int list(ClipboardPage aListPage, boolean aCheckSecurity)
          Lists instances from an object table.
 int listRDB(ClipboardPage aListPage, java.lang.String aRequestType, java.lang.String aAccessMethod, boolean aCheckSecurity)
          Lists instances using an RDB rule.
 void noteConfigChangesInClassMap(java.util.Collection configSaves, java.util.Collection configDeletes)
          Used by the system pulse (Code-.SystemPulse) to notify the classMap of config changes
 ClipboardPage open(java.lang.String aInstanceHandle, boolean aCheckSecurity)
          Opens an instance from an object table by its handle.
 ClipboardPage open(java.lang.String aInstanceHandle, boolean aCheckSecurity, boolean aLock, boolean aUnlockOnCommit, StringMap aLockInfo)
          Opens an instance from an object table by its handle.
 ClipboardPage open(StringMap aInstancePage, boolean aCheckSecurity)
          Opens the instance with the given keys.
 ClipboardPage open(StringMap aInstancePage, boolean aCheckSecurity, boolean aLock, boolean aUnlockOnCommit, StringMap aLockInfo)
          Opens the instance with the given keys.
 ClipboardPage openDefault(StringMap aKeys, boolean aCheckSecurity)
          Opens the default version of the Rule with the given keys.
 java.util.Map openForAllCircumstanceVals(StringMap aInstancePage, RuleResolutionInformation aRuleInfo)
          Deprecated.  
 ClipboardPage openIfStale(ClipboardPage aInstancePage, boolean aCheckSecurity, boolean aLock, boolean aUnlockOnCommit, StringMap aLockInfo)
          Checks to see if an instance has been modfied; if it has, this function returns a ClipboardPage with the new definition, if not return a handle to the input page.
 ClipboardPage openRDB(java.lang.String aObjectClass, java.lang.String aRequestType, java.lang.String aAccessMethod, boolean aCheckSecurity)
          Reads an instance using an RDB rule.
 java.util.Map performSystemIndex()
          Synchronizes the PegaRULES index with changes from all the nodes on this system.
 java.util.Hashtable performSystemPulse()
          Synchronize self with rest of nodes on this system
 void recordAssembly(boolean aIsStart, java.lang.String aAssemblyClass, java.lang.String aForClass)
          Records the fact that rule assembly was started or stopped as a Database Trace event.
 void removeFromNodeCache(ClipboardPage aInstancePage)
          Remove a specific instance from the node's cache.
 void removeFromNodeCache(java.lang.String aObjClass, java.lang.String aInsKey)
          Remove a specific instance from the node's cache.
 void resolveResultsOnListPage(ClipboardPage aListPage)
          Filters a code-pega-list page so that it only contains the rule resolved classes.
 void rollback()
          Rolls back a PegaRULES Transaction (discards all deferred database changes).
 void save(ClipboardPage aInstancePage, boolean aOnlyIfNew, boolean aCheckSecurity)
          Immediately writes an instance to an object table.
 void save(ClipboardPage aInstancePage, boolean aOnlyIfNew, boolean aCheckSecurity, boolean aWithErrors)
          Immediately writes an instance to an object table.
 void saveDeferred(ClipboardPage aInstancePage, boolean aOnlyIfNew, boolean aCheckSecurity)
          Defers writing an instance to an object table.
 void saveDeferred(ClipboardPage aInstancePage, boolean aOnlyIfNew, boolean aCheckSecurity, boolean aWithErrors)
          Defers writing an instance to an object table.
 void saveRDB(java.lang.String aObjectClass, java.lang.String aRequestType, java.lang.String aAccessMethod, boolean aCheckSecurity)
          Immediately saves information to the database, using an RDB rule.
 void testConnection(java.lang.String aConnectMethod, java.lang.String aDBName, java.lang.String aDBUrl, java.lang.String aDBJndiName, java.lang.String aDBUserName, java.lang.String aDBPassword, com.pega.pegarules.priv.PegaAPI aPega)
          Tests to see if we can get a connection to a particular database.
 void writeIndexesForPage(ClipboardPage aPage)
           
 

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

commit

void commit()
            throws DatabaseException
Commits the current PegaRULES Transaction (applies all deferred database changes).

Throws:
CacheException - if the changes could not be committed due to a problem with the cache
ConfigurationException - if there is a configuration problem with classes and/or tables
BadInstanceDataException - if an instance could not be saved due to bad data
DatabaseException - if there is something wrong with the database
LockFailureException - if we cannot obtain a necessary lock

rollback

void rollback()
              throws DatabaseException
Rolls back a PegaRULES Transaction (discards all deferred database changes).

Throws:
DatabaseException - if something goes wrong

open

ClipboardPage open(StringMap aInstancePage,
                   boolean aCheckSecurity)
                   throws DatabaseException
Opens the instance with the given keys. If the instance belongs to a class that uses Rule Resolution, then Rule Resolution is used to find the instance.

Parameters:
aInstancePage - a page containing the instance's key parts
aCheckSecurity - should security checks be performed?
Returns:
the requested instance, or null if it does not exist
Throws:
BadClassDefinitionException - if the instance keys specify an invalid instance class (pxObjClass) or if the instance keys specify an instance that belongs to class that uses inheritance, and the keys specify a bad object class (pyClassName). The processing status is set to error and the message is Database-BadClassDef-BadObjectClass.
AuthorizationException - if the Requestor performing the open is not authorized to open the instance, and aCheckSecurity is true
ConfigurationException - if the database table configuration is bad
MultipleCircumstancePropertiesException - if, during Rule Resolution, Rules with conflicting Circumstance Properties or with conflicting Circumstance Date Properties were encountered
MultipleRuleVersionException - if the requested instance belongs to a class that uses Rule Resolution, and there is more than one version of the rule that may be considered the best version
NoRuleVersionWithoutCircumstanceException - if Rule Resolution was used to find the instance, and a default version of the Rule was expected but not found
BadInputException - if there is a problem with the key page. The processing status is set to the error Database-BadInput-ClassCannotHaveInstances. Examples of problems are:
  • The page belongs to a class with no defined key properties.
  • The page belongs to an abstract class.
  • The page belongs to a class that cannot have instances in the database, such as a class that descends from Code-.
BadInstanceDataException - if the database instance is corrupt
DatabaseException - if there is a problem with the database

open

ClipboardPage open(StringMap aInstancePage,
                   boolean aCheckSecurity,
                   boolean aLock,
                   boolean aUnlockOnCommit,
                   StringMap aLockInfo)
                   throws DatabaseException
Opens the instance with the given keys. If the instance belongs to a class that uses Rule Resolution, then Rule Resolution is used to find the instance.

Parameters:
aInstancePage - a page containing the instance's key parts
aCheckSecurity - should security checks be performed?
aLock - should the instance be locked?
aUnlockOnCommit - if aLock is true and aUnlockOnCommit is true, then the instance will be unlocked when the next Commit is performed
aLockInfo - if a lock is requested but the lock could not be obtained, then this is filled in with information about the attempt. The value of ErrorMessage is the name of a Rule-Message that describes the problem. In addition, these other keys might be set
  • pxOwnerId - The ID of the Requestor that currently owns the requested lock
  • pxExpireDateTime - The date and time that the requested lock expires
  • pxUpdateOperator - The ID of the operator that currently owns the requested lock
  • pxUpdateOpName - The name of the operator that currently owns the requested lock
  • pxLockHandle - The lock key that was requested
If this parameter is null, then this information is not returned.
Returns:
the requested instance, or null if it does not exist
Throws:
BadClassDefinitionException - if the instance keys specify an invalid instance class (pxObjClass) or if the instance keys specify an instance that belongs to class that uses inheritance, and the keys specify a bad object class (pyClassName). The processing status is set to error and the message is Database-BadClassDef-BadObjectClass.
AuthorizationException - if the Requestor performing the open is not authorized to open the instance, and aCheckSecurity is true
ConfigurationException - if the database table configuration is bad
MultipleCircumstancePropertiesException - if, during Rule Resolution, Rules with conflicting Circumstance Properties or with conflicting Circumstance Date Properties were encountered
MultipleRuleVersionException - if the requested instance belongs to a class that uses Rule Resolution, and there is more than one version of the rule that may be considered the best version
NoRuleVersionWithoutCircumstanceException - if Rule Resolution was used to find the instance, and a default version of the Rule was expected but not found
BadInputException - if there is a problem with the key page. The processing status is set to the error Database-BadInput-ClassCannotHaveInstances. Examples of problems are:
  • The page belongs to a class with no defined key properties.
  • The page belongs to an abstract class.
  • The page belongs to a class that cannot have instances in the database, such as a class that descends from Code-.
BadInstanceDataException - if the database instance is corrupt
DatabaseException - if there is a problem with the database

openIfStale

ClipboardPage openIfStale(ClipboardPage aInstancePage,
                          boolean aCheckSecurity,
                          boolean aLock,
                          boolean aUnlockOnCommit,
                          StringMap aLockInfo)
                          throws DatabaseException
Checks to see if an instance has been modfied; if it has, this function returns a ClipboardPage with the new definition, if not return a handle to the input page. Determination of a change is done by examining the pxUpdateDateTime property; ensure the property is updated correctly.

Parameters:
aInstancePage - a clipboard page instance
aCheckSecurity - should security checks be performed?
aLock - should the instance be locked?
aUnlockOnCommit - if aLock is true and aUnlockOnCommit is true, then the instance will be unlocked when the next Commit is performed
aLockInfo - if a lock is requested but the lock could not be obtained, then this is filled in with information about the attempt. The value of ErrorMessage is the name of a Rule-Message that describes the problem. In addition, these other keys might be set
  • pxOwnerId - The ID of the Requestor that currently owns the requested lock
  • pxExpireDateTime - The date and time that the requested lock expires
  • pxUpdateOperator - The ID of the operator that currently owns the requested lock
  • pxUpdateOpName - The name of the operator that currently owns the requested lock
  • pxLockHandle - The lock key that was requested
If this parameter is null, then this information is not returned.
Returns:
There are three possible outputs:
  1. openIfStale(aInstancePage) == aInstancePage: The instance has not been modified.
  2. openIfStale(aInstancePage) != aInstancePage: The instance has been modified; the return falue is the new instance page
  3. openIfStale(aInstancePage) == null: The instance cannot be found; it has been deleted.
Throws:
BadClassDefinitionException - if the instance keys specify an invalid instance class (pxObjClass) or if the instance keys specify an instance that belongs to class that uses inheritance, and the keys specify a bad object class (pyClassName). The processing status is set to error and the message is Database-BadClassDef-BadObjectClass.
ConfigurationException - if the database table configuration is bad
MultipleCircumstancePropertiesException - if, during Rule Resolution, Rules with conflicting Circumstance Properties or with conflicting Circumstance Date Properties were encountered
MultipleRuleVersionException - if the requested instance belongs to a class that uses Rule Resolution, and there is more than one version of the rule that may be considered the best version
NoRuleVersionWithoutCircumstanceException - if Rule Resolution was used to find the instance, and a default version of the Rule was expected but not found
AuthorizationException - if the Requestor performing the open is not authorized to open the instance, and aCheckSecurity is true
BadInputException - if there is a problem with the key page. The processing status is set to the error Database-BadInput-ClassCannotHaveInstances. Examples of problems are:
  • The page belongs to a class with no defined key properties.
  • The page belongs to an abstract class.
  • The page belongs to a class that cannot have instances in the database, such as a class that descends from Code-.
BadInstanceDataException - if the database instance is corrupt
DatabaseException - if there is a problem with the database

openDefault

ClipboardPage openDefault(StringMap aKeys,
                          boolean aCheckSecurity)
                          throws DatabaseException
Opens the default version of the Rule with the given keys. If the keys describe an instance that is not a Rule, then the instance is returned. No locking will be attempted.

Parameters:
aKeys - the instance's key parts
aCheckSecurity - should security checks be performed?
Returns:
the requested instance, or null if it does not exist
Throws:
BadClassDefinitionException - if the instance keys specify an invalid instance class (pxObjClass) or if the instance keys specify an instance that belongs to class that uses inheritance, and the keys specify a bad object class (pyClassName). The processing status is set to error and the message is Database-BadClassDef-BadObjectClass.
AuthorizationException - if the Requestor performing the open is not authorized to open the instance, and aCheckSecurity is true
ConfigurationException - if the database table configuration is bad
MultipleCircumstancePropertiesException - if, during Rule Resolution, Rules with conflicting Circumstance Properties or with conflicting Circumstance Date Properties were encountered
MultipleRuleVersionException - if the requested instance belongs to a class that uses Rule Resolution, and there is more than one version of the rule that may be considered the best version
NoRuleVersionWithoutCircumstanceException - if Rule Resolution was used to find the instance, and a default version of the Rule was expected but not found
BadInputException - if there is a problem with the key page. The processing status is set to the error Database-BadInput-ClassCannotHaveInstances. Examples of problems are:
  • The page belongs to a class with no defined key properties.
  • The page belongs to an abstract class.
  • The page belongs to a class that cannot have instances in the database, such as a class that descends from Code-.
BadInstanceDataException - if the database instance is corrupt
DatabaseException - if there is a problem with the database

openForAllCircumstanceVals

java.util.Map openForAllCircumstanceVals(StringMap aInstancePage,
                                         RuleResolutionInformation aRuleInfo)
                                         throws DatabaseException
Deprecated. 

Returns the rules with he requested keys; all the rule versions that could be chosen for all possible circumstances are returned. Both blocked and unblocked rule versions are returned.

This is useful when you want to resolve a rule, but you want to resolve it for all possible circumstance values. This is usually desired in rules that produce generated Java. Instead of generating a seperate Java class for each circumstance-qualified version of a rule, it is usually better to generate a Java class that takes into account rule versions for all possible circumstances. In these cases, the logic that selects a particular circumstance-qualified version to use is built into the generated Java. No locking will be attempted

Parameters:
aInstancePage - a page containing the instance's key parts
aRuleInfo - filled in with information about the returned rule
Returns:
a map of potential circumstance values to the results of performing rule resolution for each circumstance value. These results are expressed as instances of CircumstanceResult. If there is a default result (that is, a version that is to be used if none of the circumstance-qualified versions match), then it is stored in the map with a null key. (This map should not be updated--it might be read-only.)
Throws:
BadClassDefinitionException - if the instance keys specify an invalid instance class (pxObjClass) or if the instance keys specify an instance that belongs to class that uses inheritance, and the keys specify a bad object class (pyClassName). The processing status is set to error and the message is Database-BadClassDef-BadObjectClass.
ConfigurationException - if the database table configuration is bad
MultipleCircumstancePropertiesException - if more than one circumstance property is found
BadInputException - if there is a problem with the key page
BadInstanceDataException - if the database instance is corrupt
DatabaseException - if there is a problem with the database

open

ClipboardPage open(java.lang.String aInstanceHandle,
                   boolean aCheckSecurity)
                   throws DatabaseException
Opens an instance from an object table by its handle. No locking will be attempted.

Parameters:
aInstanceHandle - the handle of the instance to open
aCheckSecurity - should security checks be performed?
Returns:
the requested instance, or null if it does not exist
Throws:
BadClassDefinitionException - if aInstanceHandle has an invalid instance class, or if aInstanceHandle is the handle of a rule and the rule has an invalid object class. The processing status is set to error, message Database-BadClassDef-BadObjectClass.
AuthorizationException - if the Requestor performing the open is not authorized to open the instance, and aCheckSecurity is true
ConfigurationException - if the database table configuration is bad
BadInstanceDataException - if the database instance is corrupt
DatabaseException - if something goes wrong

open

ClipboardPage open(java.lang.String aInstanceHandle,
                   boolean aCheckSecurity,
                   boolean aLock,
                   boolean aUnlockOnCommit,
                   StringMap aLockInfo)
                   throws DatabaseException
Opens an instance from an object table by its handle.

Parameters:
aInstanceHandle - the handle of the instance to open
aCheckSecurity -
aLock - Should the instance be locked as well? If a lock cannot be obtained, the instance will be returned but the step status will be set to SEVERITY_FAIL
aUnlockOnCommit - if aLock is true and aUnlockOnCommit is true, then the instance will be unlocked when the next Commit is performed
aLockInfo - if a lock is requested but the lock could not be obtained, then this is filled in with information about the attempt. The value of ErrorMessage is the name of a Rule-Message that describes the problem. In addition, these other keys might be set
  • pxOwnerId - The ID of the Requestor that currently owns the requested lock
  • pxExpireDateTime - The date and time that the requested lock expires
  • pxUpdateOperator - The ID of the operator that currently owns the requested lock
  • pxUpdateOpName - The name of the operator that currently owns the requested lock
  • pxLockHandle - The lock key that was requested
If this parameter is null, then this information is not returned.
Returns:
the requested instance, or null if it does not exist
Throws:
BadClassDefinitionException - if aInstanceHandle has an invalid instance class, or if aInstanceHandle is the handle of a rule and the rule has an invalid object class. The processing status is set to error, message Database-BadClassDef-BadObjectClass.
AuthorizationException - if the Requestor performing the open is not authorized to open the instance, and aCheckSecurity is true
ConfigurationException - if the database table configuration is bad
BadInstanceDataException - if the database instance is corrupt
DatabaseException - if something goes wrong

openRDB

ClipboardPage openRDB(java.lang.String aObjectClass,
                      java.lang.String aRequestType,
                      java.lang.String aAccessMethod,
                      boolean aCheckSecurity)
                      throws DatabaseException
Reads an instance using an RDB rule.

Parameters:
aObjectClass - the class of the RDB rule to use
aRequestType - the request type of the RDB rule to use
aAccessMethod - the access method of the RDB rule to use
aCheckSecurity - should security checks be performed?
Returns:
the requested instance, or null if it does not exist
Throws:
DatabaseException - if something goes wrong

saveDeferred

void saveDeferred(ClipboardPage aInstancePage,
                  boolean aOnlyIfNew,
                  boolean aCheckSecurity)
                  throws DatabaseException
Defers writing an instance to an object table. When a commit is performed, the instance will be saved; if an instance with the same handle already exists, it will be overwritten.

Parameters:
aInstancePage - the page containing the instance to write. Its pzInsKey property is set.
aOnlyIfNew - If true, then this instance is saved only if there is not already an instance with the same handle in the database at the time of the next commit; if there is such an instance, then the commit() method fails, reports a processing status error, and throws a DatabaseException. If false, any previous instance in the database with the same handle is overwritten at commit time.
aCheckSecurity - should security checks be performed?
Throws:
DatabaseException
AuthorizationException - if the Requestor performing the open is not authorized to save the instance (including the case where the instance belongs to a locked RuleSet) and aCheckSecurity is true
BadInputException - if the instance is not one that may be saved for some reason. The processing status is set to error. Such reasons may include the following:
  • the page is read-only;
  • the page has errors;
  • the page belongs to a class whose instances may not be written (the processing status is set to Database-BadInput-ClassCannotHaveInstances); or
  • the page is a shortcut.
BadClassDefinitionException - if the page's class is undefined

saveDeferred

void saveDeferred(ClipboardPage aInstancePage,
                  boolean aOnlyIfNew,
                  boolean aCheckSecurity,
                  boolean aWithErrors)
                  throws DatabaseException
Defers writing an instance to an object table. When a commit is performed, the instance will be saved; if an instance with the same handle already exists, it will be overwritten.

Parameters:
aInstancePage - the page containing the instance to write. Its pzInsKey property is set.
aOnlyIfNew - If true, then this instance is saved only if there is not already an instance with the same handle in the database at the time of the next commit; if there is such an instance, then the commit() method fails, reports a processing status error, and throws a DatabaseException. If false, any previous instance in the database with the same handle is overwritten at commit time.
aCheckSecurity - should security checks be performed?
aWithErrors - should this instance be saved even if it has errors? If true, no validation is performed on the instance and it is saved regardless of any messages.
Throws:
DatabaseException
AuthorizationException - if the Requestor performing the open is not authorized to save the instance (including the case where the instance belongs to a locked RuleSet) and aCheckSecurity is true
BadInputException - if the instance is not one that may be saved for some reason. The processing status is set to error. Such reasons may include the following:
  • the page is read-only;
  • the page has errors;
  • the page belongs to a class whose instances may not be written (the processing status is set to Database-BadInput-ClassCannotHaveInstances); or
  • the page is a shortcut.
BadClassDefinitionException - if the page's class is undefined

save

void save(ClipboardPage aInstancePage,
          boolean aOnlyIfNew,
          boolean aCheckSecurity)
          throws DatabaseException
Immediately writes an instance to an object table.

Parameters:
aInstancePage - the page containing the instance to write. Its pzInsKey property (and other properties) are potentially updated. This should not be a read-only page.
aOnlyIfNew - If true, then this instance is saved only if there is not already an instance with the same handle in the database; if there is such an instance, then the instance is not saved, a processing status error is reported, and the method throws a DatabaseException. If false, any previous instance in the database with the same handle is overwritten.
aCheckSecurity - should security checks be performed? The security checks include tests for ability to access and change the indicated class(es) and for rules includes the test for a locked ruleset.
Throws:
AuthorizationException - if the Requestor performing the open is not authorized to save the instance (including the case where the instance belongs to a locked RuleSet) and aCheckSecurity is true
BadInputException - if the instance is not one that may be saved for some reason. The processing status is set to error. Such reasons may include the following:
  • the page is read-only;
  • the page has errors;
  • the page belongs to a class whose instances may not be written (the processing status is set to Database-BadInput-ClassCannotHaveInstances); or
  • the page is a shortcut.
BadClassDefinitionException - if the page's class is undefined
BadInstanceDataException - if an instance could not be saved due to bad data
BadTableMappingException - if the instance can not be saved because it is incompatible with the table it is being saved to
DatabaseException - when something goes wrong with the database. This exception is also thrown if saving an instance "only if new" and there is already an instance there.

save

void save(ClipboardPage aInstancePage,
          boolean aOnlyIfNew,
          boolean aCheckSecurity,
          boolean aWithErrors)
          throws DatabaseException
Immediately writes an instance to an object table.

Parameters:
aInstancePage - the page containing the instance to write. Its pzInsKey property (and other properties) are potentially updated. This should not be a read-only page.
aOnlyIfNew - If true, then this instance is saved only if there is not already an instance with the same handle in the database; if there is such an instance, then the instance is not saved, a processing status error is reported, and the method throws a DatabaseException. If false, any previous instance in the database with the same handle is overwritten.
aCheckSecurity - should security checks be performed? The security checks include tests for ability to access and change the indicated class(es) and for rules includes the test for a locked ruleset.
aWithErrors - should this instance be saved even if it has errors? If true, no validation is performed on the instance and it is saved regardless of any messages.
Throws:
AuthorizationException - if the Requestor performing the open is not authorized to save the instance (including the case where the instance belongs to a locked RuleSet) and aCheckSecurity is true
BadInputException - if the instance is not one that may be saved for some reason. The processing status is set to error. Such reasons may include the following:
  • the page is read-only;
  • the page has errors;
  • the page belongs to a class whose instances may not be written (the processing status is set to Database-BadInput-ClassCannotHaveInstances); or
  • the page is a shortcut.
BadClassDefinitionException - if the page's class is undefined
BadInstanceDataException - if an instance could not be saved due to bad data
BadTableMappingException - if the instance can not be saved because it is incompatible with the table it is being saved to
DatabaseException - when something goes wrong with the database. This exception is also thrown if saving an instance "only if new" and there is already an instance there.

saveRDB

void saveRDB(java.lang.String aObjectClass,
             java.lang.String aRequestType,
             java.lang.String aAccessMethod,
             boolean aCheckSecurity)
             throws DatabaseException
Immediately saves information to the database, using an RDB rule.

Parameters:
aObjectClass - the object class of the RDB rule to use
aRequestType - the request type of the RDB rule to use
aAccessMethod - the access method of the RDB rule to use
aCheckSecurity - should security checks be performed?
Throws:
DatabaseException - if something goes wrong

deleteDeferred

void deleteDeferred(ClipboardPage aInstancePage,
                    boolean aCheckSecurity)
                    throws DatabaseException
Defers deleting a database instance from an object table.

Parameters:
aInstancePage - the page containing the instance to delete. Its pzInsKey property is set. If it already has a pzInsKey property, then it is ignored--so the instance must have all the properties necessary to compute its handle
aCheckSecurity -
Throws:
BadClassDefinitionException - if the page's class is undefined
ConfigurationException - if a class or table is defined improperly
AuthorizationException - if the Requestor performing the open is not authorized to delete the instance (including the case where the instance belongs to a locked RuleSet) and aCheckSecurity is true
DatabaseException - if something goes wrong with the database

delete

boolean delete(ClipboardPage aInstancePage,
               boolean aCheckSecurity)
               throws DatabaseException
Immediately deletes a database instance from an object table.

Parameters:
aInstancePage - the page containing the instance to delete. Its pzInsKey property is set. If it already has a pzInsKey property, then it is ignored--so the instance must have all the properties necessary to compute its handle
aCheckSecurity - should security checks be performed?
Returns:
if the instance was there to delete, false otherwise
Throws:
BadClassDefinitionException - if the page to delete has a bad class
ConfigurationException - if there is a problem with table or class configuration
AuthorizationException - if the Requestor performing the open is not authorized to delete the instance (including the case where the instance belongs to a locked RuleSet) and aCheckSecurity is true
DatabaseException - if there is a problem with the database

deleteRDB

void deleteRDB(java.lang.String aObjectClass,
               java.lang.String aRequestType,
               java.lang.String aAccessMethod,
               boolean aCheckSecurity)
               throws DatabaseException
Immediately deletes data from the database using an RDB rule.

Parameters:
aObjectClass - the object class of the RDB rule to use
aRequestType - the request type of the RDB rule to use
aAccessMethod - the access method of the RDB rule to use
aCheckSecurity - should security checks be performed?
Throws:
DatabaseException - if something goes wrong

list

int list(ClipboardPage aListPage,
         boolean aCheckSecurity)
         throws DatabaseException
Lists instances from an object table.

Parameters:
aListPage - a Code-Pega-List page containing the list parameters. The list results are placed in this page. See the package documentation for details about this page.
aCheckSecurity - should security checks be performed?
Returns:
the number of instances found
Throws:
AuthorizationException - if the Requestor performing the open is not authorized to list the instances and aCheckSecurity is true
BadInputException - if there is a problem getting the list definition page or if the list page is invalid
BadClassDefinitionException - if the requested list is on a bad class
ConfigurationException - if this class's storage is not configured properly
DatabaseException - if there is a problem accessing the database to get storage information

listRDB

int listRDB(ClipboardPage aListPage,
            java.lang.String aRequestType,
            java.lang.String aAccessMethod,
            boolean aCheckSecurity)
            throws DatabaseException
Lists instances using an RDB rule.

Parameters:
aListPage - the page in which to place the results--the page must have class Code-Pega-List and contain the list parameters. The results of the list are placed on this page
aRequestType - the request type of the RDB rule to use
aAccessMethod - the access method of the RDB rule to use
aCheckSecurity - should security checks be performed?
Returns:
the number of instances found
Throws:
DatabaseException - if something goes wrong

executeRDB

int executeRDB(java.lang.String aSQL,
               ClipboardPage aListPage)
               throws DatabaseException
Executes a SQL statement.

Parameters:
aSQL - the SQL statement
aListPage - the results are put on this page
Returns:
the number of updated rows (for updates) or the number of results (for queries)
Throws:
BadInputException - if the SQL is invalid
ConfigurationException - if tables and/or classes are not configured correctly
BadInstanceDataException - if there is a problem with the result data
BadClassDefinitionException - if there is an undefined class
DatabaseException - if there is a database problem

cancelDeferredUpdate

void cancelDeferredUpdate(ClipboardPage aInstancePage)
                          throws DatabaseException
Cancels the deferred addition, deletion, or update of a page.

Parameters:
aInstancePage - the page containing the instance whose update should be cancelled; its handle is calculated and set
Throws:
DatabaseException
BadClassDefinitionException - if the class on the page is invalid

getRulesetContext

RulesetContext getRulesetContext(ClipboardPage aRulePage)
                                 throws DatabaseException
Returns rule editing tools associated with a particular page.

Parameters:
aRulePage - the page containing the rule to be edited
Returns:
a new ruleset context for that rule
Throws:
BadClassDefinitionException - if the class of the rule is undefined
BadInputException - if the "rule" has a class that is not a rule, or if the rule has a bad ruleset
BadInstanceDataException - if there is a problem with one of the ruleset instance streams
DatabaseException - if there is a database problem

getRulesetContext

RulesetContext getRulesetContext(ClipboardPage aRulePage,
                                 java.lang.String aRuleSetNameProperty,
                                 java.lang.String aRuleSetVersionProperty)
                                 throws DatabaseException
Returns rule editing tools associated with a particular page when the page has non-standard RuleSet name and RuleSet version properties.

This method is to be used with pages containing rules that have their RuleSet names and versions on non-standard properties. The standard properties are pyRuleSet and pyRuleSetVersion. But certain classes, such as Rule-Obj-Class, have their RuleSet name or version on a different property..

Parameters:
aRulePage - the page containing the rule to be edited
aRuleSetNameProperty - a reference to the property containing the RuleSet name for aRulePage
aRuleSetVersionProperty - a reference to the property containing the RuleSet version for aRulePage
Returns:
a new ruleset context for that rule
Throws:
BadClassDefinitionException - if the class of the rule is undefined
BadInputException - if the "rule" has a class that is not a rule, or if the rule has a bad ruleset
BadInstanceDataException - if there is a problem with one of the ruleset instance streams
DatabaseException - if there is a database problem

getLockManager

LockManager getLockManager()
Retrieves the lock manager.

Returns:
the lock manager

getHandle

java.lang.String getHandle(StringMap aInstancePage)
                           throws DatabaseException
Calculates the handle of an instance.

Parameters:
aInstancePage - the page containing the instance whose handle we want
Returns:
the new handle
Throws:
DatabaseException
BadInputException - if there is a problem with the page, or it is of a class whose instances may not be written
BadClassDefinitionException - if there is a problem with the page's class. If this happens, then a message with severity "inform" is added to the processing status.

getClassDef

ClassDefinition getClassDef(java.lang.String aClassName)
Returns information about a class.

Parameters:
aClassName - the name of the class
Returns:
information about the class, or null if the class does not exist. This method does not change the processing status.

getFirstRealPatternAncestor

ClassDefinition getFirstRealPatternAncestor(java.lang.String aClassName)
Goes through the pattern ancestors of this class, and returns the first one that names a real class.

Parameters:
aClassName - a class name--does not need to be a real defined class
Returns:
the pattern ancestor, or null if none

convertListCriteria

void convertListCriteria(ClipboardPage aListPage)
                         throws DatabaseException
Converts an old-style (version 2) list criteriapage to a current list criteria page.

Parameters:
aListPage - the old-style list criteria page; it is changed to a new-style page
Throws:
BadClassDefinitionException - if the list is for an undefined class
BadInputException - if there is something wrong with the list page
DatabaseException - if there is a database problem

getInstanceName

java.lang.String getInstanceName(StringMap aInstancePage,
                                 ClassDefinition aClassDef)
Get the instance name for a page.

Parameters:
aInstancePage - the instance page
aClassDef - the definition of the class of the instance page
Returns:
information about the class, or null if the class does not exist

getInsIdFromInsName

java.lang.String getInsIdFromInsName(java.lang.String aInstanceClass,
                                     java.lang.String aInstanceName)
                                     throws BadClassDefinitionException
Gets the instance id using instance name

Parameters:
aInstanceClass - name of the class to which the instance belongs
aInstanceName - an instance name
Returns:
instance Id or null if the class does not exist
Throws:
BadClassDefinitionException - if class aClass no longer exists

getClassesInTable

java.util.Collection getClassesInTable(java.lang.String aDBName,
                                       java.lang.String aTableName)
                                       throws DatabaseException
Deprecated. use getClassesInTable(java.lang.String, java.lang.String, java.lang.String, java.lang.String) instead

Gets all the classes that live in a particular database table.

Parameters:
aDBName - the database name
aTableName - the table name
Returns:
the classes that live in the table, as a collection of ClassDefinitions. Abstract classes are not returned. Concrete classes are returned, even if they are not writable (for example, even if they have no keys defined).
Throws:
DatabaseException

getClassesInTable

java.util.Collection getClassesInTable(java.lang.String aDBName,
                                       java.lang.String aCatalog,
                                       java.lang.String aSchema,
                                       java.lang.String aTable)
                                       throws DatabaseException
Gets all the classes that live in a particular database table.

Parameters:
aDBName - the database name
aCatalog - the table's catalog, or null if none
aSchema - the table's schema, or null if none
aTable - the name of the table
Returns:
the classes that live in the table, as a collection of ClassDefinitions. Abstract classes are not returned. Concrete classes are returned, even if they are not writable (for example, even if they have no keys defined).
Throws:
DatabaseException

getDataUniqueID

java.lang.String getDataUniqueID(java.lang.String aOrganization,
                                 java.lang.String aPrefix,
                                 java.lang.String aSuffix)
                                 throws DatabaseException
Obtain a unique ID value for items

Parameters:
aOrganization - The Organization Name
aPrefix - The prefix for the Unique ID
aSuffix - The suffix for the Unique ID
Returns:
A string either containing a unique ID (ex. "R-1234") or or an empty string if there is an error
Throws:
DatabaseException - if something goes wrong

flushUpdatesCache

void flushUpdatesCache(int aDeltaMinutes)
                       throws BadInputException,
                              DatabaseException
Flush out entries in pr_sys_updatescache older than given number of minutes

Parameters:
aDeltaMinutes - A positive integer indicating the number of minutes that we should go back, and delete all entried previous to
Throws:
BadInputException - if supplied delta is less than 0
DatabaseException - if error occurs while running stored procedure

findHandle

java.lang.String findHandle(StringMap aKeys)
                            throws DatabaseException
Finds the handle of the instance that would be opened given a set of keys. This method is less expensive than calling one of the open methods, as it does not read the storage stream from the database.

Parameters:
aKeys - the keys of the instance in question
Returns:
the pzInsKey of the instance that is named by those keys, or null if such an instance does not exist
Throws:
BadClassDefinitionException - if the instance keys specify an invalid instance class (pxObjClass) or if the instance keys specify an instance that belongs to class that uses inheritance, and the keys specify a bad object class (pyClassName). The processing status is set to error and the message is Database-BadClassDef-BadObjectClass.
MultipleCircumstancePropertiesException - if, during Rule Resolution, Rules with conflicting Circumstance Properties or with conflicting Circumstance Date Properties were encountered
MultipleRuleVersionException - if the requested instance belongs to a class that uses Rule Resolution, and there is more than one version of the rule that may be considered the best version
NoRuleVersionWithoutCircumstanceException - if Rule Resolution was used to find the instance, and a default version of the Rule was expected but not found
DatabaseException - if there is a problem with the database

performSystemPulse

java.util.Hashtable performSystemPulse()
                                       throws DatabaseException,
                                              NotSupportedException
Synchronize self with rest of nodes on this system

Returns:
A hashtable of ClipboardPages, containing data from the updates cache. Hash value starts at 0. Data returned does NOT include 'Index' entries
Throws:
DatabaseException - if error occurs while gathering data
NotSupportedException

performSystemIndex

java.util.Map performSystemIndex()
                                 throws DatabaseException,
                                        NotSupportedException
Synchronizes the PegaRULES index with changes from all the nodes on this system.

Returns:
A hashtable of ClipboardPages, containing data from the updates cache for 'Index' entries. Hash value starts at 0.
Throws:
DatabaseException
NotSupportedException

addToUpdatesCache

void addToUpdatesCache(java.lang.String aClearType,
                       ClipboardPage aInstancePage,
                       java.lang.String aParameters,
                       boolean aPerformOnThisNode,
                       boolean aPerformOnAllSystems)
                       throws DatabaseException
Cause a rule instance to be updated on all nodes during their system pulse.

Parameters:
aClearType - A string of at most 5 characters describing the clear type. If the length is greater than 5, only the first 5 are passed along
aInstancePage - Instance Page detailing a rule instance
aParameters - reserved You must insert an empty string ("").
aPerformOnThisNode - Set to true if you want the given update to apply to this node as well.
aPerformOnAllSystems - Set to true if you want the given update to apply to all PegaRULES systems using this database
Throws:
DatabaseException - if error occurs adding entry

addToUpdatesCache

void addToUpdatesCache(java.lang.String aClearType,
                       java.lang.String aObjClass,
                       java.lang.String aInsKey,
                       java.lang.String aParameters,
                       boolean aPerformOnThisNode,
                       boolean aPerformOnAllSystems)
                       throws DatabaseException
Cause a rule instance to be updated on all nodes during their system pulse.

Parameters:
aClearType - A string of at most 5 characters describing the clear type. If the length is greater than 5, only the first 5 are passed along
aObjClass - String containing the name of the instance's class
aInsKey - String containing the instance key
aParameters - reserved You must insert an empty string ("").
aPerformOnThisNode - Set to true if you want the given update to apply to this node as well.
aPerformOnAllSystems - Set to true if you want the given update to apply to all PegaRULES systems using this database
Throws:
DatabaseException - if error occurs adding entry

clearCache

void clearCache()
Clears all entries from the database cache.


removeFromNodeCache

void removeFromNodeCache(java.lang.String aObjClass,
                         java.lang.String aInsKey)
Remove a specific instance from the node's cache.

Parameters:
aObjClass - a string containing the object class type to be removed
aInsKey - a string containing the key of the instance to be removed from the local cache

removeFromNodeCache

void removeFromNodeCache(ClipboardPage aInstancePage)
Remove a specific instance from the node's cache.

Parameters:
aInstancePage - an Instance Page of the class to be removed from the cache

noteConfigChangesInClassMap

void noteConfigChangesInClassMap(java.util.Collection configSaves,
                                 java.util.Collection configDeletes)
                                 throws DatabaseException
Used by the system pulse (Code-.SystemPulse) to notify the classMap of config changes

Parameters:
configSaves - - Collection of clipboard pages that were saved (inserted or updated)
configDeletes - - Collection of clipboard pages that were deleted
Throws:
DatabaseException - - If class ancestor information cannot be written

executeDBSchemaUpdates

void executeDBSchemaUpdates(java.util.List aSQL,
                            java.lang.String aDBName,
                            java.lang.String aUserName,
                            java.lang.String aPassword)
                            throws DatabaseException
Executes SQL statements against a particular database, connecting with a specified user name.

The SQL statements are executed in the order provided, within a single database transaction. This method should be used for schema updates. Schema upates performed with this method will be recognized by the Database Interface.

If an exception is thrown, then the transaction is rolled back.

Parameters:
aSQL - the list of SQL statements, as Strings
aDBName - the name of the Data-Admin-DB-Name corresponding to the database to connect to
aUserName - the user name to use when connecting to the database
aPassword - the password to use when connecting to the database
Throws:
BadDatabaseDefinitionException - if the specified database is not configured properly
DatabaseException - if there is any other problem connecting to the database or executing the statements

getDBInfo

DatabaseInformation getDBInfo(java.lang.String aDBName)
                              throws DatabaseException
Returns low-level information about a database.

Parameters:
aDBName - name of the database for which information is desired
Returns:
information about the database
Throws:
BadDatabaseDefinitionException - if the requested database is not defined correctly
DatabaseException - if there is a database problem

getDBSchemas

java.util.List getDBSchemas(java.lang.String aDBName)
                            throws DatabaseException
Returns a array of strings that are the schema's available from this db connection.

Parameters:
aDBName - Name of the database for which information is desired.
Returns:
An array of strings
Throws:
DatabaseException - if there is a database problem

getDBTables

java.util.Collection getDBTables(java.lang.String aDBName,
                                 java.lang.String aCatalogName,
                                 java.lang.String aSchemaName,
                                 java.lang.String[] aTableTypes)
                                 throws DatabaseException
Returns a Collection of com.pega.pegarules.pub.database.DatabaseTable objects that contain information about a database's tables.

Parameters:
aDBName - Name of the database for which information is desired.
aTableTypes - A string array containing the desired table types.
aCatalogName - The catalog name (or null).
aSchemaName - The schema name (or null).
Returns:
A Collection of com.pega.pegarules.pub.database.DatabaseTable objects.
Throws:
DatabaseException - if there is a database problem

getColumnsForTable

java.util.SortedSet getColumnsForTable(java.lang.String aDBName,
                                       java.lang.String aTableName)
                                       throws DatabaseException
Deprecated. this method does not allow you to specify the catalog and schema of the table

Returns the columns in a table.

Parameters:
aDBName - the name of the database in which the table lives
aTableName - the name of the table
Returns:
a set of Columns, in the same order that the columns are in the table
Throws:
DatabaseException - if there is a database problem

testConnection

void testConnection(java.lang.String aConnectMethod,
                    java.lang.String aDBName,
                    java.lang.String aDBUrl,
                    java.lang.String aDBJndiName,
                    java.lang.String aDBUserName,
                    java.lang.String aDBPassword,
                    com.pega.pegarules.priv.PegaAPI aPega)
                    throws DatabaseException
Tests to see if we can get a connection to a particular database. Either a JDBC URL (aURL) or a JNDI name (aJNDIName) or a database name (aDBName) should be specified.

Parameters:
aConnectMethod - how the database configuration should be obtained--this is supposed to be one of the possible values of the Data-Admin-DB-Name.pyConnectMethod property
aDBUrl - the JDBC URL of the database
aDBJndiName - the JNDI name of the database
aDBName - the database name
aDBUserName - user name for the database
aDBPassword - password for the database
aPega - the current Pega API object
Throws:
ConfigurationException - if the appropriate parameters are not supplied
DatabaseException - if a connection could not be made to the database

doesInstanceExist

boolean doesInstanceExist(java.lang.String aInstanceHandle)
                          throws DatabaseException
Indicates whether a particular instance exists in the database.

This method does not perform any security checking.

Parameters:
aInstanceHandle - the handle (pzInsKey) of the instance
Returns:
true iff the instance exists
Throws:
BadClassDefinitionException - if the instance has an invalid pxObjClass. The processing status is set to error if this is the case.
ConfigurationException - if the database table configuration is bad
DatabaseException - if something else goes wrong

writeIndexesForPage

void writeIndexesForPage(ClipboardPage aPage)
                         throws DatabaseException
Throws:
DatabaseException

doClassesBelongToSingleDb

boolean doClassesBelongToSingleDb(boolean aUseReportDb,
                                  java.util.ArrayList aClasses)
                                  throws DatabaseException
Figures out if all classes in a SQL statement use the same dtabase instance.

Parameters:
aUseReportDb - passed in flag to determine if we should check the reporting dB
aClasses - a list of class name strings
Returns:
true if all classes use the same database instance false otherwise.
Throws:
DatabaseException - if something else goes wrong

resolveResultsOnListPage

void resolveResultsOnListPage(ClipboardPage aListPage)
                              throws DatabaseException
Filters a code-pega-list page so that it only contains the rule resolved classes.

Parameters:
aListPage - passed code pega list page
Throws:
DatabaseException - if something else goes wrong

getColumnForProperty

java.lang.String getColumnForProperty(java.lang.String aClassName,
                                      java.lang.String aPropertyName)
                                      throws DatabaseException
Returns the column name for a property whether explicitly mapped or not. It checks the resulting column is in the table, and returns the column in upper case if required by the database.

Parameters:
aClassName - the name of the class
aPropertyName - the name of the property
Returns:
the column, or null if the property is not mapped or the class is not found.
Throws:
DatabaseException - if lower level throws

getColumnDataTypeForProperty

java.lang.String getColumnDataTypeForProperty(java.lang.String aClassName,
                                              java.lang.String aPropertyName)
                                              throws DatabaseException
Returns the column data type for a property whether explicitly mapped or not. It checks the resulting column is in the table, and returns the column datatype in upper case

Parameters:
aClassName - the name of the class
aPropertyName - the name of the property
Returns:
the database datatype of column , or null if the property is not mapped or the class is not found.
Throws:
DatabaseException - if lower level throws

getPropertyToColumnMap

java.util.Map getPropertyToColumnMap(java.lang.String aClassName)
Returns the explicit map of properties to columns. The column names are as stored in the definition. They are not forced to upper case in this method, regardless of whether the database requires it.

Parameters:
aClassName - the name of the class
Returns:
a map of property names to column names, or null if class not found

getConcreteDescendantsInCurrentApplication

java.lang.String[] getConcreteDescendantsInCurrentApplication(java.lang.String aAncestorName)
                                                              throws InvalidConfigurationException
Returns the names of descendant classes of the given class that are concrete and are in the current Application's rule sets, in distance order, nearest first. The argument (the ancestor class name) is not returned in the set. If the argument ancestor class itself is in the current Application ruleset, the method returns null.

Parameters:
aAncestorName - a class name
Returns:
an array of the concrete descendant classes' names, or null
Throws:
InvalidConfigurationException,{@link - InvalidLocaleException} if there is a locale mismatch
InvalidConfigurationException

recordAssembly

void recordAssembly(boolean aIsStart,
                    java.lang.String aAssemblyClass,
                    java.lang.String aForClass)
Records the fact that rule assembly was started or stopped as a Database Trace event. This activity must be called in pairs--once for the start of an assembly, and once for the end.

Parameters:
aIsStart - true if this indicates the start of an assembly, false if it is the end
aAssemblyClass - the instance class (pxObjClass) of the assembly
aForClass - the class on which the rule is called(pyClassName)

getRulesetsFromApplication

java.util.List<java.lang.String> getRulesetsFromApplication(java.util.List aApplicationList,
                                                            boolean aFollowDependencies,
                                                            boolean aFollowByParent)
                                                            throws DatabaseException
Takes a list of Applications and returns the rulesets defined in those applications

Parameters:
aApplicationList - list of strings containing application names and versions in the format :. Ex: "PegaReporting:05.05.10"
aFollowDependencies - boolean Flag when set to true returns rulesets from all dependent applications for the ones defined in ApplicationList.
aFollowByParent - boolean Flag when set to true returns rulesets following Dependent applications by parent for each application defined in ApplicationList
Returns:
a list of strings containing ruleset name and version.
Throws:
DatabaseException - if invalid entries are present in ApplicationList


Copyright © 2012 Pegasystems Inc. All Rights Reserved.