public abstract class DBEventValidation extends DBObject
The DBEventValidation abstract class provides a series of sub classes that enable different levels of granularity to the creation of Event Validations.
Validation Groups
When validations are added to a DBEvent, they are added by creating new DBEventValidationGroup objects. Each DBEventValidationGroup can contain multiple DBEventValidation objects.
For a DBEventValidationGroup to pass validation all associated DBEventValidation objects need to pass. For a DBEvent to pass validation only one DBEventValidationGroup needs to pass.
Effectively the DBEventValidationGroups form an OR comparison while each DBEventValidation forms and AND comparison.
Event Validation Passes = ( (Group1Validation1 Passes and Group1Validation2 Passes) or ( Group2Validation1 Passes and Group2Validation2 Passes)
Only the validation messages from the first group that fails the validation test will be returned to the user.
When the DBEvent processes the Validation Groups cost analysis is performed so that it processes the Groups that contain Validations with the least overhead. Validations that contain custom code or conditions based on derived fields are done last as these are seen as possible performance hit.
DBObject.DenormalizeAction
Modifier and Type | Field and Description |
---|---|
static GlobalId |
DBCLASS_GID
Provides validation so that user can be notified of potential issues as
a result of a particular Event.
|
static java.lang.String |
DBCLASS_NAME
Provides validation so that user can be notified of potential issues as
a result of a particular Event.
|
ATTRIBUTE_MARVIN, dbClass, ds, NO_LOOP_PARAMS
Constructor and Description |
---|
DBEventValidation(DBClass def,
DataSource dataSource)
Std.
|
Modifier and Type | Method and Description |
---|---|
protected ValidationError |
extValidateField(DBField field,
ValidationList list)
Additional validation for a particular field.
|
static DBEventValidation |
findKey(DataSource ds,
int key)
Find the target for this class by the primary key
|
DBEventValidationLevel |
findLevel(java.lang.String... args)
The Level indicates the severity of the Validation.
|
DBMessage |
findMessage(java.lang.String... args)
The Message is a DBMessage that contains the text to be displayed to the
user.
|
DBModuleOption |
findModuleOption(java.lang.String... args)
If the clause is associated with an Module Option then this clause will
only be applicable if that Option is enabled.
|
ValidationItem |
generateValidationItem(DBObject base)
Constructs either a ValidationError or ValidationWarning depending on the level
and associated DBMessage.
|
java.lang.String |
getCondition(java.lang.String... args) |
int |
getID(java.lang.String... args) |
DBEventValidationLevel |
getLevel(java.lang.String... args) |
DBMessage |
getMessage(java.lang.String... args) |
DBModuleOption |
getModuleOption(java.lang.String... args) |
java.lang.String |
getSummary(java.lang.String... args) |
DBEventValidationGroup |
getValidationGroup()
Retrieves the associated Validation Group
|
boolean |
isApplicable(DBObject base)
Determines if this validation is applicable for associated DBObject
|
abstract boolean |
isComplex()
checks whether the EventValidation Object is complex or non-complex
|
static DBQuery<DBEventValidation> |
makeQuery(DataSource ds)
Make a new QUERY for this class.
|
DBEventValidation |
setCondition(java.lang.String value,
java.lang.String... args) |
DBEventValidation |
setID(int value,
java.lang.String... args) |
DBEventValidation |
setLevel(com.aspc.dal.workflow.DBEventValidationLevel value,
java.lang.String... args) |
DBEventValidation |
setMessage(com.aspc.dal.message.DBMessage value,
java.lang.String... args) |
DBEventValidation |
setModuleOption(com.aspc.dal.dbobj.module.DBModuleOption value,
java.lang.String... args) |
DBEventValidation |
setValidationGroup(com.aspc.dal.workflow.DBEventValidationGroup value,
java.lang.String... args) |
abstract ValidationItem |
validateBaseObject(DBObject base)
Validates that the base object details matches the criteria set in the clause.
|
addReloadEventListener, archiveCheck, autoEnterCreate, calculateValue, calculateValue, calculateValue, callingRestoreByJournal, changeThreadMode, checkCreateAccess, checkDelete, checkDeleteAccess, checkModifyAccess, checkModifyAccess, checkReadAccess, clearCache, copy, copyFields, copyIncludeField, copyInwardLinks, delete, denormalizedResult, displayLogName, displayName, displayValue, doSearch, dump, equals, eventDataLoaded, eventFieldUpdated, extAutoEnterCreate, extCanDeleteDependantObject, extCheckCreateAccess, extCheckDeleteAccess, extCheckModifyAccess, extCheckModifyAccess, extCheckReadAccess, extCopy, extDelete, extDeleteRecord, extFixUp, extGetDerivedGlobalKey, extGetDerivedValue, extGetValue, extIsMandatory, extIsOnChange, extMarkSavePoint, extPostDeleteRecord, extPostSaveRecord, extPreDeleteRecord, extPreSaveRecord, extPreValidate, extPreValidateDelete, extRaiseEvents, extRollbackTo, extSaveRecord, extSetValue, extUndelete, extValidateDelete, extValidateRecord, fetchLinkHolder, findGlobalKey, findGlobalKey, findGlobalKey, findGlobalKey, findLinkedObject, findLinkedObject, findLinkedObject, findRawData, fireEventDataLoaded, fixUp, forceLockedTransaction, getBoolean, getBoolean, getBoolean, getBoolean, getBoolean, getBoolean, getChangedFieldInfo, getChangedFields, getDate, getDate, getDate, getDate, getDate, getDefaultValue, getDisableOnChangeEvent, getDouble, getDouble, getDouble, getDouble, getDouble, getFieldDouble, getFieldInt, getFieldLong, getFieldString, getFormattedString, getFormattedString, getGlobalKey, getGlobalKey, getGlobalKey, getGlobalKey, getGlobalKey, getInt, getInt, getInt, getInt, getInt, getInt, getInwardLinkage, getKeyString, getKeyValue, getLinkedObject, getLinkedObject, getLinkedObject, getLinkedObjectByKey, getLinkedRowId, getLinkedRowId, getLinkedRowIdByData, getLinkHolder, getLockedTransaction, getLong, getLong, getLong, getLong, getLong, getLong, getMutableArrayValue, getMutableArrayValue, getOriginalKey, getOriginalValue, getOriginalValue, getProcessedValue, getPureValue, getRawData, getRawValue, getRawValue, getRowId, getRowKey, getSecondaryCacheGroupKey, getSrcLayerID, getString, getString, getString, getString, getString, getString, getValue, getValue, getValue, getValue, hasAutoChanged, hasAutoChanged, hasChanged, hasChangedByUser, hasChangedByUserField, hasChangedByUserField, hasFieldChanged, hasFieldChanged, hashCode, hasStoredResult, iCheckDeleteAccess, iCheckModifyAccess, iCheckReadAccess, iGetDenormalizedMap, iGetRawValue, iPlaceDenormalizedResult, iPostSaveOrDeleteRecord, iPreSaveOrDeleteRecord, iPreValidate, iRaiseEvents, iSaveOrDeleteRecord, isBrokenLink, isBrokenLink, isChanged, isDataCacheKnownToBeDirty, isDeleted, isEmpty, iSetValue, isForceReindex, isKeyWordField, isMandatory, isNew, isNull, isNull, isOnChange, isReindex, iValidateRecord, lastTouched, makeArchiveDataLoader, makeClone, makeDataLoader, makeDenormalizedDoc, makeLinkedArray, makeModifyAccessException, makeSearchPlan, makeWriteProvider, manualDenormalizeOnSave, markSavePoint, optLockedTransaction, registerWatchedObject, reindex, releaseDenormalized, removeReloadEventListener, restoreByJournal, rollbackTo, setBoolean, setBoolean, setBoolean, setBoolean, setDisableOnChangeEvent, setDouble, setDouble, setInt, setInt, setLong, setLong, setRawData, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, toString, touch, undelete, validateField, validateRecord, validateSubType
public static final java.lang.String DBCLASS_NAME
public static final GlobalId DBCLASS_GID
public DBEventValidation(DBClass def, DataSource dataSource) throws java.lang.Exception
def
- The class of this objectdataSource
- The datasource for this objectjava.lang.Exception
- A serious problem occurred@CheckReturnValue public int getID(java.lang.String... args)
@Nonnull public DBEventValidation setID(int value, java.lang.String... args) throws java.lang.Exception
java.lang.Exception
@CheckReturnValue @Nonnull public java.lang.String getCondition(java.lang.String... args)
@Nonnull public DBEventValidation setCondition(java.lang.String value, java.lang.String... args) throws java.lang.Exception
java.lang.Exception
@CheckReturnValue @Nullable public DBEventValidationLevel getLevel(java.lang.String... args)
@CheckReturnValue @Nonnull public final DBEventValidationLevel findLevel(java.lang.String... args) throws NotFoundException
DBEventValidationLevel
(String, Searchable)args
- the optional argumentsNotFoundException
- DBEventValidationLevel was not found@Nonnull public DBEventValidation setLevel(com.aspc.dal.workflow.DBEventValidationLevel value, java.lang.String... args) throws java.lang.Exception
java.lang.Exception
@CheckReturnValue @Nullable public DBMessage getMessage(java.lang.String... args)
@CheckReturnValue @Nonnull public final DBMessage findMessage(java.lang.String... args) throws NotFoundException
DBMessage
(String,
Mandatory, Searchable)args
- the optional argumentsNotFoundException
- DBMessage was not found@Nonnull public DBEventValidation setMessage(com.aspc.dal.message.DBMessage value, java.lang.String... args) throws java.lang.Exception
java.lang.Exception
@CheckReturnValue @Nullable public DBModuleOption getModuleOption(java.lang.String... args)
@CheckReturnValue @Nonnull public final DBModuleOption findModuleOption(java.lang.String... args) throws NotFoundException
DBModuleOption
(String, Searchable)args
- the optional argumentsNotFoundException
- DBModuleOption was not found@Nonnull public DBEventValidation setModuleOption(com.aspc.dal.dbobj.module.DBModuleOption value, java.lang.String... args) throws java.lang.Exception
java.lang.Exception
@CheckReturnValue @Nonnull public java.lang.String getSummary(java.lang.String... args)
@Nonnull public DBEventValidation setValidationGroup(com.aspc.dal.workflow.DBEventValidationGroup value, java.lang.String... args) throws java.lang.Exception
java.lang.Exception
@Nonnull @CheckReturnValue public static DBQuery<DBEventValidation> makeQuery(@Nonnull DataSource ds) throws NotFoundException
ds
- the datasourceNotFoundException
- if class could not be found@Nonnull @CheckReturnValue public static DBEventValidation findKey(@Nonnull DataSource ds, int key) throws NotFoundException, java.lang.Exception
ds
- the datasourcekey
- the valueNotFoundException
- if target could not be foundjava.lang.Exception
- a serious problempublic abstract ValidationItem validateBaseObject(DBObject base) throws java.lang.Exception
base
- Base object to validatejava.lang.Exception
- Exceptionpublic DBEventValidationGroup getValidationGroup()
public ValidationItem generateValidationItem(DBObject base)
base
- Base object to generate the error forpublic boolean isApplicable(DBObject base) throws java.lang.Exception
base
- Base object to test the condition againstjava.lang.Exception
- A serious problem@CheckReturnValue @OverridingMethodsMustInvokeSuper @Nullable protected ValidationError extValidateField(@Nonnull DBField field, @Nonnull ValidationList list) throws java.lang.Exception
extValidateField
in class DBObject
list
- The validation listfield
- The field to be validatedjava.lang.Exception
- A serious problempublic abstract boolean isComplex()
stSoftware Copyright © 2001-2014 stSoftware All Rights Reserved.