Advanced Customization > Business Logic Customization > Business Rules > Bypassing Business Rules > Example > Execute All Required and Non-Required Business Rule Sets
Execute All Required and Non-Required Business Rule Sets
In order to display all required and not required rule conflicts update the Audit Change Notice workflow task conditional to use both rule sets EXAMPLE1_RELEASE_RULE_SET and EXAMPLE1_NON_REQUIRED_ATTRIBUTE_RULE_SET.
if (wt.change2.ChangeHelper2.isTrackingChange((wt.inf.container.WTContained)
primaryBusinessObject)) {
result = "Revisioning Enabled";
}else {
result = "Revisioning Disabled";
}
com.ptc.core.businessRules.engine.BusinessRuleSetBean[]
beans = new com.ptc.core.businessRules.engine.BusinessRuleSetBean[] {

// Configure to call non-required rule set
com.ptc.core.businessRules.engine.BusinessRuleSetBean.
newBusinessRuleSetBean
("EXAMPLE1_NON_REQUIRED_ATTRIBUTE_RULE_SET",
"wt.change2.ChangeRecord2"),

// Configure to call required rule set
com.ptc.core.businessRules.engine.BusinessRuleSetBean.newBusinessRuleSetBean
("EXAMPLE1_RELEASE_RULE_SET", "wt.change2.ChangeRecord2")
};
com.ptc.core.businessRules.validation.RuleValidationResultSet
resultSet = wt.businessRules.BusinessRulesHelper.engine.execute
(primaryBusinessObject, beans);
if ( resultSet.hasResultsByStatus(com.ptc.core.businessRules.
validation.RuleValidationStatus.FAILURE)) {

businessRulesResultSetGlobal = wt.businessRules.BusinessRulesHelper.
serialize(resultSet);
preReleaseConflictsMsg = new wt.util.WTMessage("com.ptc.windchill.
enterprise.change2.change2ClientResource",
com.ptc.windchill.enterprise.change2.change2ClientResource.
BUSINESS_RULES_PRERELEASE_VALIDATION_MSG, null)
.getLocalizedMessage();
preReleaseConflictsMsg = preReleaseConflictsMsg + "\n" +
resultSet.getFailedRulesMessage(java.util.Locale.getDefault());
}
The following is an example shows the conflicts on the Audit Change Notice workflow task.
Was this helpful?