BizTalk部署与业务规则

3

我是BizTalk开发的新手,只使用了6-7周,因此请谅解我的幼稚。

我正在开发一个基本的BizTalk 2013应用程序,并准备部署到测试环境。

我正在使用业务规则定义Outbound Transport Location,在所有转换完成后将数据发送到SQL Server中的存储过程中,该存储过程插入/更新记录:

mssql://.//db1?

当我们在测试/生产环境上部署应用时,由于数据库和应用程序部署在不同的服务器上,因此我们无法将出站传输位置设置为本地机器。例如:

mssql://dbserver//db1?

我已经查看了BizTalk部署框架,以确定是否可以根据环境修改业务规则,但没有找到任何信息。

因此,我的问题是,管理基于环境的业务规则设置的最佳(最低维护)方式是什么?最好使用BizTalk部署框架。

1个回答

1
我将发布我用于备忘和帮助未来遇到此类问题的人的解决方案。 在BizTalk部署框架中,可以添加其他XML文件到构建中,并以与绑定文件相同的方式预处理它们,具体取决于环境。 以下是deployment.btdfproj文件的一些片段。不要忘记使用BizTalk部署框架时,顺序很重要:
<!-- Add the policy file as an additional item to the build -->
<ItemGroup>
    <AdditionalFiles Include="my_policy_file.xml">
      <LocationPath>..\$(ProjectName)\location_to_policy</LocationPath>
    </AdditionalFiles>
</ItemGroup>

<!-- Processes the additional XML policy files added to the MSI main build folder. -->
<ItemGroup>
    <FilesToXmlPreprocess Include="my_policy_file.xml">
         <LocationPath>..\</LocationPath>
    </FilesToXmlPreprocess>
</ItemGroup>

<!-- You still have to add the business rule to the build. It is overwritten later. -->
<ItemGroup>
    <RulePolicies Include="my_policy_file.xml">
        <LocationPath>..\$(ProjectName)\location_to_property</LocationPath>
    </RulePolicies>
</ItemGroup>

<!-- Towards the end of the file the pre-processed file overwrites the originally included policy file. -->
<Target Name="CopyXMLPreprocessedPoliciesToBRE" AfterTargets="PreprocessFiles">
    <copy sourceFiles="..\my_policy_file.xml" DestinationFolder="..\BRE\Policies"/>
</Target>

欲了解更多信息,请访问BizTalk部署框架网站上的此主题:https://biztalkdeployment.codeplex.com/discussions/392801


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接