Class CheckoutRuleValidator
java.lang.Object
com.ptc.core.businessRules.validation.CheckoutRuleValidator
- All Implemented Interfaces:
RuleValidation
This class is a validator configured to execute with the BusinessRules engine.
As such, it extends RuleValidation.
This class validates whether or not a set of workable objects has checkouts. This validator will return RuleValidationStatus.SUCCESS if no objects are checked out. It will return RuleValidationStatus.FAILURE if there is at least one object checked out. This can be invoked by calling the business rules engine:
Supported API: true
Extendable: true
This class validates whether or not a set of workable objects has checkouts. This validator will return RuleValidationStatus.SUCCESS if no objects are checked out. It will return RuleValidationStatus.FAILURE if there is at least one object checked out. This can be invoked by calling the business rules engine:
BusinessRulesHelper.engine.execute("CHANGEABLE_PRE_RELEASE", criteria);Supported API: true
Extendable: true
-
Method Summary
Modifier and TypeMethodDescriptionstatic WTKeyedHashMapgetCheckedoutObjects(WTCollection targets) Returns a set of objects that are checked out.Class<?>[]getSupportedClasses(RuleValidationKey validationKey) Returns {Workable.class} Supported API: truebooleanisConfigurationValid(RuleValidationKey validationKey) Returns true.performValidation(RuleValidationKey validationKey, RuleValidationObject validationObject, RuleValidationCriteria criteria) Examines the invalidObjects collection of this class and determines if there are any invalid objects or not.voidprepareForValidation(RuleValidationKey validationKey, RuleValidationCriteria criteria) Perform the validation against the criteria to determine if there are any checked out objects.
-
Method Details
-
getSupportedClasses
Returns {Workable.class} Supported API: true- Specified by:
getSupportedClassesin interfaceRuleValidation- Returns:
- the array of classes
-
isConfigurationValid
Returns true. Supported API: true- Specified by:
isConfigurationValidin interfaceRuleValidation- Returns:
- true when the configuration is valid
- Throws:
WTException
-
performValidation
public RuleValidationResult performValidation(RuleValidationKey validationKey, RuleValidationObject validationObject, RuleValidationCriteria criteria) throws WTException Examines the invalidObjects collection of this class and determines if there are any invalid objects or not. If there are, it checks to see if the current targetObject exists within the invalidObjects set. If it exists in the set, RuleValidationStatus.FAILURE will be returned in the RuleValidationResult. Otherwise, the RuleValidationResult will have a RuleValidationStatus.SUCCESS. Supported API: true- Specified by:
performValidationin interfaceRuleValidation- Returns:
- validation result
- Throws:
WTException
-
getCheckedoutObjects
Returns a set of objects that are checked out. This will check objects that are work in progress checked out, or sandbox checked out. Supported API: true- Throws:
WTException
-
prepareForValidation
public void prepareForValidation(RuleValidationKey validationKey, RuleValidationCriteria criteria) throws WTException Perform the validation against the criteria to determine if there are any checked out objects. Supported API: true- Specified by:
prepareForValidationin interfaceRuleValidation- Throws:
WTException
-