我在 c# 中使用以下代码从 BizTalk 服务器中部署的应用程序中获取策略\规则。
BTSTask.exe ListApp -ApplicationName:"EAISolution" -ResourceSpec:"c:\EAISolution.PolicyInf
o.xml" /Server:VHYDTRBELSUP-02 /Database:BizTalkMgmtDb
从上面的命令我得到如下输出
<?xml version="1.0" encoding="utf-16" ?>
<ResourceSpec xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" ApplicationName="EAISolution" xmlns="http://schemas.microsoft.com/BizTalk/ApplicationDeployment/ResourceSpec/2004/12">
<Resources>
<Resource Type="System.BizTalk:BizTalkAssembly" Luid="EAIOrchestration, Version=1.0.0.0, Culture=neutral, PublicKeyToken=97e0f507fd7fd10d" />
<Resource Type="System.BizTalk:BizTalkAssembly" Luid="EAIServices, Version=1.0.0.0, Culture=neutral, PublicKeyToken=97e0f507fd7fd10d" />
<Resource Type="System.BizTalk:BizTalkAssembly" Luid="FFSchemasTest, Version=1.0.0.0, Culture=neutral, PublicKeyToken=97e0f507fd7fd10d" />
<Resource Type="System.BizTalk:Rules" Luid="RULE/ProcessPurchaseOrder/1.0" />
<Resource Type="System.BizTalk:BizTalkBinding" Luid="Application/EAISolution" />
</Resources>
</ResourceSpec>
并从 BizTalk 服务器我使用 BizTalk 服务器管理中的策略导出得到以下输出
<?xml version="1.0" encoding="utf-8" ?>
<brl xmlns="http://schemas.microsoft.com/businessruleslanguage/2002">
<ruleset name="ProcessPurchaseOrder">
<version major="1" minor="0" description="" modifiedby="username" date="2013-05- 27T12:04:55.6121122+05:30" />
<configuration />
<bindings>
<xmldocument ref="xml_31" doctype="RuleTest.PO" instances="16" selectivity="1" instance="0">
<selector>/*[local-name()='PurchaseOrder' and namespace-uri() ='http://EAISolution.PurchaseOrder']/*[local-name()='Item' and namespace-uri()='']</selector>
<selectoralias>/PurchaseOrder/Item</selectoralias>
<schema>....\PO.xsd</schema>
</xmldocument>
<xmldocument ref="xml_32" doctype="RuleTest.PO" instances="16" selectivity="1" instance="0">
<selector>/*[local-name()='PurchaseOrder' and namespace-uri()='http://EAISolution.PurchaseOrder']
</selector>
<selectoralias>/PurchaseOrder</selectoralias>
<schema>....\PO.xsd</schema>
</xmldocument>
</bindings>
<rule name="ApprovalRule" priority="0" active="true">
<if>
<compare operator="less than or equal to">
<vocabularylink uri="3f0e9bcc-6212-4e6a-853c-e517f157a626" element="d4eb2deb-06d3-42c4-af49-ceb21331b1cc" />
<lhs>
<function>
<xmldocumentmember xmldocumentref="xml_31" type="int" sideeffects="false">
<field>*[local-name()='Quantity' and namespace-uri()='']</field>
<fieldalias>Quantity</fieldalias>
</xmldocumentmember>
</function>
</lhs>
<rhs>
<constant>
<int>500</int>
</constant>
</rhs>
</compare>
</if>
<then>
<function>
<xmldocumentmember xmldocumentref="xml_32" type="string" sideeffects="true">
<field>*[local-name()='Status' and namespace-uri()='']</field>
<fieldalias>Status</fieldalias>
<argument>
<constant>
<string>Approved</string>
</constant>
</argument>
</xmldocumentmember>
</function>
</then>
</rule>
</ruleset>
</brl>
所以请让我知道如何使用命令行获取第二个的输出。