Erweiterte Anpassung > Business Logic Customization > Business Rules > Business Rule Types > Attribute Rule > Examples
  
Examples
If you have a specific soft type of a part, and it has an attribute called weight to represent how heavy the part is. Before releasing parts that have a weight, you want to ensure that a weight is set to a reasonable figure. In order to do this, you want to construct a business rule to verify that the weight attribute falls within the range 1-100.
Business Rule Set that Implements the Attribute Rule
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE BusinessRuleSet SYSTEM "standardX20.dtd">
<BusinessRuleSet>
<ObjectID><localId>wt.businessRules.BusinessRuleSet:45347
</localId></ObjectID>
<objectContainerPath>/wt.inf.container.
OrgContainer=BusinessRulesTestOrganization
/wt.pdmlink.PDMLinkProduct=BusinessRulesTestProduct
</objectContainerPath>
<key>CHANGEABLE_PRE_RELEASE</key>
<name>Test_Changeable_ReleaseRuleSet</name>
<description>To test basic Attribute RuleSet Validation
</description>
<enabled>true</enabled>
<overridable>true</overridable>
<updateIfExists>true</updateIfExists>
</BusinessRuleSet>
Business Rule that Implements the Attribute Rule
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE BusinessRule SYSTEM "standardX20.dtd">
<BusinessRule>
<ObjectID><localId>wt.businessRules.BusinessRule:
168926</localId></ObjectID>
<objectContainerPath>/wt.inf.container.OrgContainer
=BusinessRulesTestOrganization/
wt.pdmlink.PDMLinkProduct=BusinessRulesTestProduct
</objectContainerPath>
<key>PART_ATTRIBUTE_RULE</key>
<selector>ATTRIBUTE_RULE</selector>
<name>Test Attribute Rule</name>
<description>Test Attribute Rule</description>
<enabled>true</enabled>
<updateIfExists>true</updateIfExists>
<configs>
<config name="objectType"
value="wt.part.AttributeRulePart"></config>
<config name="weight" value="[0..100]"></config>
</configs>
</BusinessRule>
Business Rule Link that implements the Attribute rule
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE BusinessRuleLink SYSTEM "standardX20.dtd">
<BusinessRuleLink>
<ObjectID><localId>wt.businessRules.BusinessRuleLink:168919
</localId></ObjectID>
<ruleSet><ObjectReference><localId>wt.businessRules.BusinessRuleSet:45347
</localId></ObjectReference></ruleSet>
<rule><ObjectReference><localId>wt.businessRules.BusinessRule:168926
</localId></ObjectReference></rule>
<blockNumber>1</blockNumber>
<updateIfExists>true</updateIfExists>
</BusinessRuleLink>