定義新企業規則
您可以使用 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 檔案。如需詳細資訊,請參閱載入企業規則物件
這是否有幫助?