BizTalk 2009 教程 修正版(十) - 教程三:第1课

教程三 用BizTalk 处理票据和付账
场景
继续教程二的场景,之前我们只是把发给供货商的货单CommonPO发到一个文件夹里,并没有真正发出去,现在我们要把货单发送出去。
3. BizTalk 把 CommonPO(图中的Purchase order) 发给供货商
4. BizTalk 同时给仓库发一个确认消息,表明购货单已经发出去
5. 供货商发货,然后把货单(Andvanc ship notice)和收款单(invoice)发给BizTalk
6. BizTalk 在收到货物后,把货款通过银行或者第三发支付发给供货商(并未在这里实现),然后把汇款凭证(Payment voucher)发给供货商
7. 供货商收到钱后,给BizTalk 发一个确认消息(发票 Payment Acknoledgement: ACK)。
8. BizTalk 把发票发给ERP系统,整个流程结束。

 Tutorial 3 message flow

第1课 设计发票和如何付账的流程
打开教程二 创建的 B2BSolution
1. 添加 发票和付款 组件
打开B2BOrchestration里的B2BProcess.odx , 紧接着Route_PO后面添加相关组件:

名字从上到下分别为: Receive_ASN; Receive_Invoice; Construct_PaymentVoucher;Send_Payment; Receive_PaymentAck; Send_PaymentAck.
注:ASN:AdvancedShipNotice
2. 创建 发票和款项 消息实例
添加4个消息实例信息如下:

Message identifier
Message type
Referenced assembly
CommonInvoice_Instance
Schemas
B2BSchemas.CommonInvoice
ASN_Instance
Schemas
B2BSchemas.AdvancedShipNotice
PaymentVoucher_Instance
Web Message
B2BSchemas.ProcessPayment_request
PaymentAck_Instance
Web Message
B2BSchemas.ProcessPayment_response

3. 创建付款凭证消息
把Construct_PaymentVoucher 的Message Constructed属性设置为PaymentVoucher_Instance. 双击Transform2 选择B2BSchemas.InvoiceToPayment map. 设置Source 为CommonInvoice_Instance.设置Destination为:PaymentVoucher_Instance.Pay_xml
4. 创建,配置,连接端口

添加4个逻辑端口:根据下面4个表格设置相应端口

Property
Value
Port Name
ReceiveASN_Port
Port Type Name
ReceiveASN_Type
Communication Pattern
One-Way
Access Restrictions
Public - no limit
Port direction of communication
I'll always be receiving messages on this port
Port binding
Specify later

 

Property
Value
Port Name
ReceiveInvoice_Port
Port Type Name
ReceiveInvoice_Type
Communication Pattern
One-Way
Access Restrictions
Public - no limit
Port direction of communication
I'll always be receiving messages on this port
Port binding
Specify later

 

Property
Value
Port Name
RR_Payment_Port
Port Type Name
RR_Payment_Type
Communication Pattern
Request-Response
Access Restrictions
Public - no limit
Port direction of communication
I'll be sending a request and receiving a response.
Port binding
Specify later

 

Property
Value
Port Name
SendPaymentAck_Port
Port Type Name
SendPaymentAck_Type
Communication Pattern
One-Way
Access Restrictions
Internal - limited to this project
Port direction of communication
I'll always be sending messages on this port
Port binding
Specify later

配置消息类型:

Action shape
Message
Receive_Invoice
CommonInvoice_Instance
Send_Payment
PaymentVoucher_Instance
Receive_PaymentAck
PaymentAck_Instance
SendPaymentAck
PaymentAck_Instance
Receive_ASN
ASN_Instance

连接到端口

Port
Action shape
ReceiveInvoice_Port
Receive_Invoice
RR_Payment_Port
->Request
Send_Payment
RR_Payment_Port
->Response
Receive_PaymentAck
SendPaymentAck_Port
SendPaymentAck
ReceiveASN_Port
Receive_ASN

 
最后的Orchestration 差不多是这样的:

教程三,第1课完毕

BizTalk 2009 教程 修正版(十一) - 教程三:第2课

blog comments powered by Disqus