2

我是BizTalk开发的新手,只使用它正确的6-7周,所以原谅我的天真。BizTalk部署和业务规则

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

我使用的业务规则定义出站的交通区位,毕竟变换已经完成,这将数据发送到SQL Server中,这将插入一个存储过程/更新记录:

mssql://.//db1? 

当我们将部署到我们的测试/现场环境中,因为数据库将存储在单独的服务器上,所以我们将无法将出站传输位置设置到本地计算机。例如:

mssql://dbserver//db1? 

我已经通过BizTalk部署框架看了看业务规则可根据环境进行修改,但找不到任何东西。

所以我的问题是,什么是管理业务规则环境设置的最佳(最低维护)方式?使用BizTalk部署框架将是可取的。

回答

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