BRE策略-数据库事实的连接字符串存储位置



使用BizTalk 2016 FP3 CU5。

我有一个BRE规则,它接受4个类型化的xml文档和一个数据连接。我已经设置了一个编排,以便使用调用规则形状执行它。

我使用BizTalk部署框架(BTDF(进行部署,这可以很好地将BRE策略部署到。我的问题是,在策略的导出xml(名为NotificationService.xml(中,有一个对规则中使用的数据库的硬编码引用,如下所示:

<datarow ref="db_32" server="SDEIDBTI04CrossRef" dataset="CrossRef" table="Lookups"

这引用了我的dev-vm,但随着解决方案通过测试并投入生产,服务器名称需要相应地更改。

我目前对这个问题的解决方案是使用BTDF预处理xml文件的能力,并用取自SSO的EnvironmentSettings excel文件中的值进行替换。因此,我创建了一个"NotificationService.Dynamic.xml",在其中我将前一行更改为:

<!-- ifdef ${_xml_preprocess} -->
<datarow ref="db_32" server="${Common.Components.CrossRefDbServer}CrossRef" dataset="CrossRef" table="Lookups" instances="16" selectivity="1" isdataconnection="true" instance="0" />
<!-- endif -->

(*我不得不保留ifdefs是有充分理由的!(

在我的deployment.btdfproj文件中,我添加了以下内容,以确保预处理的策略是被部署的策略:

<FilesToXmlPreprocess Include="NotificationService.Dynamic.xml" 
Condition="'$(Configuration)' == 'Server'">
<LocationPath>..</LocationPath>
<OutputFilename>NotificationService.Dynamic_Processed.xml</OutputFilename>
</FilesToXmlPreprocess>
<FilesToXmlPreprocess Include="NotificationService.Dynamic.xml" Condition="'$(Configuration)' != 'Server'">
<LocationPath>..NotificationServiceNotificationService.BRE</LocationPath>
<OutputFilename>NotificationService.Dynamic_Processed.xml</OutputFilename>
</FilesToXmlPreprocess>
<RulePolicies Include="NotificationService.Dynamic_Processed.xml">
<LocationPath>..NotificationServiceNotificationService.BRE</LocationPath>
</RulePolicies>

这是有效的,但我忍不住认为我已经把解决方案复杂化了。每次导出新版本的策略时,我都要经历从导出的NotificationService.xml文件创建NotificationService.Dynamic.xml文件的麻烦。在不使用BTDF的情况下,人们如何解决同样的问题?

如果事实证明我走的是最好的路,那么希望这个问题能在未来对其他人有所帮助——我在谷歌上找不到答案!

我会创建一个静态方法,在该方法中创建获取查找值的所有逻辑。

因此,在这种方法中,您可以使用SSOSettingsFileReader.dll获得SSOCrossRefDbServer设置,然后执行一些c#代码来调用您的lookuptable并返回值。

如果将注册表设置StaticSupport设置为1,则可以在BRE中调用此方法。

最新更新