Customizing Business Rules
You can create business rules to provide custom validation logic for objects in PDMLink. These rules are used to determine eligibility of an object to go through defined checkpoints in the change management or promotion processes. You can require feedback on the result of the evaluation. The business rules validation is scalable and configurable.
Business Rules offer a validation framework which can be utilized within workflow execution. For example, before objects are released through the Change Notice workflow, you must ensure that none of the Resulting Objects are checked out. You can make a Business Rule to perform this validation.
This section focuses on the Business Rules Engine and provides a few working examples.
Intended Outcome
After going through this information, you should be able to start using the rules that are provided with Windchill 10.1 M010, or you should be able to create custom business rules for your change process.
You will then be able to use business rule sets and rules to validate that the objects are valid to be processed.
Prerequisite knowledge
To apply this information, you need to have an understanding of the following:
Basic development involving Java and XML
The management of Windchill properties
Solution Elements
Element
Type
Package
Description
BusinessRuleSet
Java class
wt.businessRules
A BusinessRuleSet instance is the configuration used to navigate a set of business rules for a container.
BusinessRule
Java class
wt.businessRules
BusinessRule will hold the information about the rule to be executed. Each rule may have unique configuration requirements associated to it.
BusinessRuleLink
Java class
wt.businessRules
An ObjectToObject binary link holding the references to BusinessRuleSet and BusinessRule. Each BusinessRuleSet is associated to BusinessRules using BusinessRuleLinks.
BusinessRulesHelper
Java Class
wt.businessRules
Helper for the business rules service and engine.
BusinessRulesEngine
Java Class
com.ptc.core.businessRules.engine
The business rules engine will execute the validation of each business rule in order as defined by the execution plan set in the business rule set.
BusinessRuleSetBean
Java Class
com.ptc.core.businessRules.engine
Used to specify more than one business rule set and target collection relationship key at a time in order to generate an accumulation of results with one call to the business rule engine.
RuleValidationCriteria
Java Class
com.ptc.core.businessRules.validation
Contains information that is used by all business rules within a business rule set.
RuleValidation
Java Class
com.ptc.core.businessRules.validation
Interface for the business rule validators. Custom validators should implement this interface.
RuleValidationResult
Java Class
com.ptc.core.businessRules.validation
Contains one validation output per business rule. It contains a rule validation key to indicate the business rule that was executed. It will hold a validation status attribute to indicate if the business rule successfully passed the validation or not. The RuleValidationResult will also contain the target object, which links the result to a specific WTReference, and a list of feedback messages which contains text that could optionally be displayed in a report.
RuleValidationResultSet
Java Class
com.ptc.core.businessRules.validation
A set of RuleValidationResult objects.
BusinessRuleSetRelationshipDelegate
Java Class
com.ptc.core.businessRules.relationship
Used to get the seed objects for a primary business object that is to be evaluated for a particular business rule set. Relationship delegates are registered in service.properties. See the “Retrieval of Seed Objects” for more information on these delegates.
Est-ce que cela a été utile ?