简体   繁体   English

具有信封架构的BizTalk业务流程

[英]BizTalk Orchestration with Envelope Schema

I have Flat File Schema in which I set the Allow Message Breakup at Infix Root to true. 我有平面文件架构,在其中将“在根目录中的允许邮件拆分”设置为true。 And also I set the Record Max Occurrence 1. To dispatch the message and send the multiple message to the send port.I used a Receive Pipeline(with flat file disassemble) and Send Pipeline (XML Transmit) in the receive and send ports. 另外,我还设置了Record Max Occurrence1。为了调度消息并将多条消息发送到发送端口。我在接收和发送端口中使用了接收管道(带有平面文件反汇编)和发送管道(XML传输)。 Till this it worked fine. 到此为止一切正常。

平面文件架构

The input .txt File at the receive Port 接收端口上的输入.txt文件

1000 ABC IT 1001 DEF Maintenece 1002 GHI Payroll 1000 ABC IT 1001 DEF维护1002 GHI工资单

The Output was three .xml files like 输出是三个.xml文件,例如

  <?xml version="1.0" encoding="utf-8" ?> 
  <Record xmlns="http://FlatFilewithEnvelop.FlatFileSchema1">
  <Employee xmlns="">
  <ID>1000</ID> 
  <Name>ABC</Name> 
  <Dept>IT</Dept> 
  </Employee>
  </Record>


 <?xml version="1.0" encoding="utf-8" ?> 
 <Record xmlns="http://FlatFilewithEnvelop.FlatFileSchema1">
 <Employee xmlns="">
 <ID>1001</ID> 
 <Name>DEF</Name> 
 <Dept>Maintenece</Dept> 
 </Employee>
 </Record>

 <?xml version="1.0" encoding="utf-8" ?> 
 <Record xmlns="http://FlatFilewithEnvelop.FlatFileSchema1">
 <Employee xmlns="">
 <ID>1002</ID> 
 <Name>GHI</Name> 
 <Dept>Payroll</Dept> 
 </Employee>
 </Record>

Now I wanted to send only the message with specific ID.So I added a Orchestration in to the Project where I am using decision shape, using the expression. 现在我只想发送具有特定ID的消息,所以我在Orchestration中添加了要使用决策形状的表达式到项目中。 Else I didn't want to send any message to the send Port. 否则我不想将任何消息发送到发送端口。

Msg(FlatFilewithEnvelop.PropertySchema.ID) == 1000

编排

If I send the same message in the Receive Port, I am getting four messages in the Send port(shown as below). 如果在接收端口中发送相同的消息,则在发送端口中将收到四条消息(如下所示)。 I dont what was the mistake can anybody tell me what is the mistake. 我没有错是谁能告诉我什么是错。

<?xml version="1.0" encoding="utf-8" ?> 
<Record xmlns="http://FlatFilewithEnvelop.FlatFileSchema1">
<Employee xmlns="">
<ID>1000</ID> 
<Name>ABC</Name> 
<Dept>IT</Dept> 
</Employee>
</Record>

<?xml version="1.0" encoding="utf-8" ?> 
<Record xmlns="http://FlatFilewithEnvelop.FlatFileSchema1">
<Employee xmlns="">
   <ID>1000</ID> 
   <Name>ABC</Name> 
   <Dept>IT</Dept> 
  </Employee>
 </Record>

<?xml version="1.0" encoding="utf-8" ?> 
<Record xmlns="http://FlatFilewithEnvelop.FlatFileSchema1">
<Employee xmlns="">
<ID>1001</ID> 
<Name>DEF</Name> 
<Dept>Maintenece</Dept> 
</Employee>
</Record>

<?xml version="1.0" encoding="utf-8" ?> 
<Record xmlns="http://FlatFilewithEnvelop.FlatFileSchema1">
<Employee xmlns="">
  <ID>1002</ID> 
  <Name>GHI</Name> 
  <Dept>Payroll</Dept> 
  </Employee>
  </Record>

What is probably happening is that you initially created a send port with a filter subscribing to the messages. 可能发生的情况是,您最初创建了一个带有订阅消息的筛选器的发送端口。

Then you created an Orchestration that also subscribes to the messages and is bound to the send port. 然后,您创建了一个Orchestration,它也订阅消息并绑定到发送端口。

If you look in BizTalk Server Administration Console and do a New Query and Search For Equals Subscriptions you will see a filter for your Send Port like below 如果您在BizTalk Server管理控制台中查找并执行“新查询”和Search For Equals Subscriptions您将看到发送端口的过滤器,如下所示

    Property    Operator    Value   Group by
    http://schemas.microsoft.com/BizTalk/2003/system-properties.SPTransportID   ==  {GUID}  Or
    http://schemas.microsoft.com/BizTalk/2003/system-properties.MessageType ==  MesageType  And

Notice how the subscription has an OR, the first will be the GUID for the port and the second part will be the filter you added to the port. 请注意,订阅如何具有OR,第一部分将是端口的GUID,第二部分将是您添加到端口的过滤器。 Any message published by an Orchestration that is bound to the port will set the SPTransportID to the GUID of the port. 由业务流程发布的,绑定到该端口的任何消息都将SPTransportID设置为该端口的GUID。

The Filter on the send port is still looking for the messages and the Orchestration is also publishing a message to the port, hence the four messages. 发送端口上的筛选器仍在寻找消息,业务流程也正在向该端口发布消息,因此是四个消息。

The solution. 解决方案。 Remove the Filter from the port. 从端口上卸下过滤器。

Another thing is to keep your send port subscription and enrich it with the verification on the promoted field ID with desired value and disable the orchestration. 另一件事是保留您的发送端口订阅,并通过对具有期望值的提升字段ID进行验证来丰富它,并禁用编排。 So your message will be intercepted by the send port only. 因此,您的消息将仅被发送端口拦截。

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

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