定义新的业务规则
可以通过使用 businessRules.dtd 定义创建或加载 XML 文件的方式来定义自己的业务规则。
以下示例显示了如何定义业务规则 (wt.businessRules.BusinessRule:45346)、业务规则集 (wt.businessRules.BusinessRuleSet:45345) 以及将业务规则与业务规则集相关联的业务规则链接 (wt.businessRules.BusinessRuleLink:356747)。
* 
以上示例中的数字是 XML 文件中用以区分各个对象的 ID。
1. 定义业务规则。
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE BusinessRule SYSTEM "standardX20.dtd">
<BusinessRule>
<ObjectID><localId>wt.businessRules.BusinessRule:45346</localId>
</ObjectID>
<objectContainerPath>/</objectContainerPath>

<key>IXBBusinessRule1_key</key>
<name>
com.ptc.windchill.enterprise.change2.change2ClientResource:
CHECK_OUT_VALIDATOR_RULE_NAME</name>
<description>
com.ptc.windchill.enterprise.change2.change2ClientResource:
CHECK_OUT_VALIDATOR_RULE_DESC</description>
<enabled>true</enabled>
<configs>
<config name="key1" value="value1"></config>
<config name="key2" value="value1"></config>
<config name="key1" value="value2"></config>
</configs>
</BusinessRule>
2. 定义业务规则集。
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE BusinessRuleSet SYSTEM "standardX20.dtd">
<BusinessRuleSet>
<ObjectID><localId>wt.businessRules.BusinessRuleSet:45345</localId>
</ObjectID>
<objectContainerPath>/wt.inf.container.OrgContainer=PTC/wt.pdmlink.
PDMLinkProduct=GOLF_CART>
</objectContainerPath>

<key>IXBBusinessRuleSet1_key</key>
<name>
com.ptc.windchill.enterprise.change2.change2ClientResource:
CHANGE_PRE_RELEASE_RULESET_NAME</name>
<description>
com.ptc.windchill.enterprise.change2.change2ClientResource:
CHANGE_PRE_RELEASE_RULESET_DESC</description>
<enabled>true</enabled>
<overridable>true</overridable>
</BusinessRuleSet>
3. 定义业务规则链接。
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE BusinessRuleLink SYSTEM "standardX20.dtd">
<BusinessRuleLink>
<ObjectID><localId>wt.businessRules.BusinessRuleLink:356747</localId>
</ObjectID>
<ruleSet><ObjectReference><localId>wt.businessRules.BusinessRuleSet:
45345</localId></ObjectReference></ruleSet>
<rule><ObjectReference><localId>wt.businessRules.BusinessRule:45346
</localId></ObjectReference></rule>
<blockNumber>10</blockNumber>
</BusinessRuleLink>
4. 加载 XML 文件。有关详细信息,请参阅加载业务规则对象
这对您有帮助吗?