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.service.getTrackingChange((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 = "The release of this change notice cannot occur because the following business rules failed:";
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?