简体   繁体   English

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

[英]BRE Policy - Where to Store Connection Strings for Db Facts

Using BizTalk 2016 FP3 CU5. 使用BizTalk 2016 FP3 CU5。

I have a BRE Rule that accepts 4 typed xml documents and a single data connection. 我有一个BRE规则,它接受4个类型的xml文档和一个数据连接。 I've setup an orchestration to execute it using the call rules shape. 我已经设置了业务流程以使用调用规则形状执行该业务流程。

I'm using the BizTalk Deployment Framework (BTDF) for deployment and this does a good job of deploying the BRE policies to. 我正在使用BizTalk部署框架(BTDF)进行部署,这在部署BRE策略方面做得很好。 My problem is, within the exported xml for the policy (named NotificationService.xml) there's a hard-coded reference to a database used in a rule - as follows: 我的问题是,在策略的导出xml(名为NotificationService.xml)中,存在对规则中使用的数据库的硬编码引用-如下所示:

 <datarow ref="db_32" server="SDEIDBTI04\CrossRef" dataset="CrossRef" table="Lookups"

This references my dev vm but as the solution is promoted through test and into production, the server name needs to change accordingly. 这引用了我的dev vm,但是随着解决方案通过测试升级并进入生产环境,服务器名称也需要相应更改。

My current solution to this problem is to use the BTDF's ability to pre-process xml files and substitute with value from the EnvironmentSettings excel file, taken from the SSO. 我当前对这个问题的解决方案是使用BTDF的能力来预处理xml文件,并用来自SSO的EnvironmentSettings excel文件中的值替换。 So, I've created a "NotificationService.Dynamic.xml" in which I've changed the previous line to: 因此,我创建了一个“ 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 -->

(*there's a good reason I've had to keep the ifdefs!) (*有一个很好的理由我必须保留ifdefs!)

In my deployment.btdfproj file, I have added the following to ensure the pre-processed policy is the one that gets deployed: 在我的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>..\NotificationService\NotificationService.BRE</LocationPath>
  <OutputFilename>NotificationService.Dynamic_Processed.xml</OutputFilename>
</FilesToXmlPreprocess>

<RulePolicies Include="NotificationService.Dynamic_Processed.xml">
  <LocationPath>..\NotificationService\NotificationService.BRE</LocationPath>
</RulePolicies>

This is working but I can't help but think I've over complicated the solution. 这是可行的,但我不禁认为我已经使解决方案复杂化了。 Each time I export a new version of the policy I now have to go through the hassle of of creating a NotificationService.Dynamic.xml file from the exported NotificationService.xml file. 每次我导出策略的新版本时,现在都必须经历从导出的NotificationService.xml文件创建NotificationService.Dynamic.xml文件的麻烦。 How do people solve the same problem when not using the BTDF? 人们在不使用BTDF时如何解决相同的问题?

If it turns out that I've followed the best path then hopefully this question will be of assistance to other in future - I could find no answers from google! 如果事实证明我已经走了最好的道路,那么希望这个问题将来对其他人有所帮助-我找不到google的答案!

I'd make a static method where you create all the logic getting your lookup value. 我将创建一个静态方法,在其中创建获得查找值的所有逻辑。

So in this method you'd get the SSO CrossRefDbServer setting using the SSOSettingsFileReader.dll , then do some c# code to call your lookuptable and return the value. 因此,在此方法中,您将使用SSOSettingsFileReader.dll获得SSO CrossRefDbServer设置,然后执行一些c#代码来调用您的lookuptable并返回该值。

You can then call this method in your BRE if you set the registry setting StaticSupport to 1 . 如果将注册表设置StaticSupport设置为1则可以在BRE中调用此方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM