Welcome to MSDN Blogs Sign in | Join | Help

Microsoft BizTalk Server

(Kerrey Zheng's view with BPI Products)
了解BizTalk Server 2004 (八)

如何在映射中增加一个Functoid?

在BizTalk的映射中增加一个新的Fumctoid是一件有趣的事,首先建立一个新的项目文件和两个新的架构文件:

1, 项目名:AddFunc.btproj;
2, 架构文件名:OrderItems.xsd, Purchase.xsd

然后建立一个映射文件,名为OrderItemsToPurchasemap.btm; 具体的架构内容和映射关系如下图:

这里要解释的是Unit的总价是经过TotalUnits与Price相乘后所得,TotalUnits和Price的数据类型被定义为xs:int类型,但是在目的架构中Total的属性是String类型,所以我们需要增加一个Scripting Functoid把Integer转换为String:

右键点击Scripting Functoid选择属性,会看到其Input属性为Multiplication, 即TotalUnits和Price相乘的结果,然后选择Script及Inline C#,输入以下代码:

public string IntToString(int param1)
{
              return param1.ToString();
} 

选择OK, 即完成了一个增加Functoid的工作。

Functoid: 执行特定计算或数据处理的可执行模块,在构造 BizTalk Server 映射时可以图形方式使用该模块,从而提供比 XSLT 自身提供的转换还要丰富的转换基准。

Posted: Monday, November 27, 2006 7:15 AM by Kerrey Zheng
Filed under:

Comments

No Comments

Leave a Comment

(required) 

(required) 

(optional)

(required) 

  
Enter Code Here: Required

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Page view tracker