无法抑制 BizTalk 映射中的节点

发布于 2024-10-31 23:48:47 字数 3345 浏览 5 评论 0原文

下午大家, 我正在学习 BizTalk,并被这个问题困扰。

有一个选择组,其中包含电话或地址。 我可以在输出电话时抑制某些地址字段。 为了使事情更简单,我将只讨论“CityName”字段。

我已尝试以下操作:

  • 将输入文件中的“City”(文本)节点映射到输出中的“CityName”。将 Exists 逻辑 functoid 连接到输入节点中的“Address1”节点和输出中的“CityName”。我总是得到一个填充有文本的城市名称。

  • 将输入文件中的“城市”节点和Exists逻辑functoid映射到值映射器 functoid。将值映射器 functoid 连接到输出中的 CityName。我在地址节点中得到一个城市名称(正确),在电话节点中得到一个空节点(错误)。

  • 将输入文件中的“City”节点和 Exists 逻辑 functoid 映射到值映射器(扁平化) functoid。将值映射器(扁平化) functoid 连接到输出中的 CityName。我在地址节点中得到一个城市名称(正确),在电话节点中得到一个空节点(错误)。

我认为最后两个之一应该有效,但两者都给出一个空节点而不是一个抑制节点。空节点没有属性。

CityName 节点由此架构类型进行描述:

<xsd:complexType name="NameType">
    <xsd:simpleContent>
        <xsd:extension base="xsd:string">
            <xsd:attribute name="languageID" type="xsd:language" use="optional">
            </xsd:attribute>
            <xsd:attribute name="sequence" type="IntegerNumericType">
            </xsd:attribute>
            <xsd:attribute name="sequenceName" type="StringType" />
        </xsd:extension>
    </xsd:simpleContent>
</xsd:complexType>

<xsd:simpleType name="IntegerNumericType">
    <xsd:restriction base="xsd:integer" />
</xsd:simpleType>

<xsd:simpleType name="StringType">
    <xsd:restriction base="xsd:string" />
</xsd:simpleType>

类型定义中是否存在强制创建空节点的内容?

谢谢

编辑:以下是不正确的输出。第二和第三通信节点有 地址子节点,不应该。

我在电话号码和平面输入模式中的第一个地址行上有一个循环 functoid。这会产生三个通信节点。我在地址行上使用逻辑存在 functoid 来抑制第一个节点中的电话信息。我在输出上有一个逻辑非 functoid,它直接绑定到输出模式中的地址节点。我认为应该关闭整个地址节点,但事实并非如此。

我尝试将连接到“逻辑存在”functoid 的“值映射”functoid 添加到“城市名称”和“邮政编码”元素,这使得它们为空,但它们不会消失。 ARG!

我检查过,这些字段都设置为零 MinOccurs,并且我不相信它们被分配了默认值。

<ns0:Communication>
    <ns0:Address>
        <ns0:AddressLine sequence="1">1234 My St</ns0:AddressLine>
        <ns0:AddressLine sequence="2">Apt. 2</ns0:AddressLine>
        <ns0:CityName>Kansas City</ns0:CityName>
        <ns0:CountrySubDivisionCode name="State">MO</ns0:CountrySubDivisionCode>
        <ns0:CountrySubDivisionCode name="County">Jackson</ns0:CountrySubDivisionCode>
        <ns0:CountryCode>US</ns0:CountryCode>
        <ns0:PostalCode>64099</ns0:PostalCode>
    </ns0:Address>
</ns0:Communication>
<ns0:Communication sequence="1">
    <ns0:ChannelCode>Telephone</ns0:ChannelCode>
    <ns0:UseCode>Personal</ns0:UseCode>
    <ns0:DialNumber>1234567890</ns0:DialNumber>
    <ns0:Address>
        <ns0:CityName />
        <ns0:CountryCode />
        <ns0:PostalCode>64099</ns0:PostalCode>
    </ns0:Address>
</ns0:Communication>
<ns0:Communication sequence="2">
    <ns0:ChannelCode>Telephone</ns0:ChannelCode>
    <ns0:UseCode>Business</ns0:UseCode>
    <ns0:DialNumber>0987654321</ns0:DialNumber>
    <ns0:Address>
        <ns0:CityName />
        <ns0:CountryCode />
        <ns0:PostalCode>64099</ns0:PostalCode>
    </ns0:Address>
</ns0:Communication>

Afternoon all,
I'm learning BizTalk and am stuck on this problem.

There's a choice group with either telephone or address.
I can get the some of the address fields to be suppressed when outputting the telephone.
To make things simpler I'll just discuss the "CityName" field .

I've tried the following:

  • Mapped the "City" (text) node in the input file to "CityName" in the output. Connected an Exists logical functoid to the "Address1" node in the input node and the "CityName" in the output. I always get a city name with text filled in.

  • Mapped the "City" node in the input file and the Exists logical functoid to a Value Mapper functoid. Connected the Value Mapper functoid to the CityName in the output. I get a city name in the address node (Correct) and an empty node in the telephone node (Incorrect).

  • Mapped the "City" node in the input file and the Exists logical functoid to a Value Mapper (Flattening) functoid. Connected the Value Mapper (Flattening) functoid to the CityName in the output. I get a city name in the address node (Correct) and an empty node in the telephone node (Incorrect).

I thought one of the last two should have worked but both give an empty node instead of a suppressed node. The empty nodes have no attributes.

The CityName node is described by this schema type:

<xsd:complexType name="NameType">
    <xsd:simpleContent>
        <xsd:extension base="xsd:string">
            <xsd:attribute name="languageID" type="xsd:language" use="optional">
            </xsd:attribute>
            <xsd:attribute name="sequence" type="IntegerNumericType">
            </xsd:attribute>
            <xsd:attribute name="sequenceName" type="StringType" />
        </xsd:extension>
    </xsd:simpleContent>
</xsd:complexType>

<xsd:simpleType name="IntegerNumericType">
    <xsd:restriction base="xsd:integer" />
</xsd:simpleType>

<xsd:simpleType name="StringType">
    <xsd:restriction base="xsd:string" />
</xsd:simpleType>

Is there something in the type definition that's forcing an empty node to be created?

Thanks

EDIT: Below is the incorrect output. The second and third Communication nodes have
an Address Child node and should not.

I have a looping functoid on the phone numbers and the first address line in a flat input schema. That produces the three Communications nodes. I'm using a Logical Existance functoid on the address line to suppress the phone info in the first node. I have a Logical Not functoid on the output of that which is tied directly to the Address node in the output schema. I thought that should turn off the entire address node but it doesn't.

I tried adding a Value Mapping functoid connected to the Logical Existance functoid to the City Name and Postal code elements and that makes them empty, but they just will not go away. ARG!

I checked and the fields are all set to zero MinOccurs and I don't believe they're assigned a default value.

<ns0:Communication>
    <ns0:Address>
        <ns0:AddressLine sequence="1">1234 My St</ns0:AddressLine>
        <ns0:AddressLine sequence="2">Apt. 2</ns0:AddressLine>
        <ns0:CityName>Kansas City</ns0:CityName>
        <ns0:CountrySubDivisionCode name="State">MO</ns0:CountrySubDivisionCode>
        <ns0:CountrySubDivisionCode name="County">Jackson</ns0:CountrySubDivisionCode>
        <ns0:CountryCode>US</ns0:CountryCode>
        <ns0:PostalCode>64099</ns0:PostalCode>
    </ns0:Address>
</ns0:Communication>
<ns0:Communication sequence="1">
    <ns0:ChannelCode>Telephone</ns0:ChannelCode>
    <ns0:UseCode>Personal</ns0:UseCode>
    <ns0:DialNumber>1234567890</ns0:DialNumber>
    <ns0:Address>
        <ns0:CityName />
        <ns0:CountryCode />
        <ns0:PostalCode>64099</ns0:PostalCode>
    </ns0:Address>
</ns0:Communication>
<ns0:Communication sequence="2">
    <ns0:ChannelCode>Telephone</ns0:ChannelCode>
    <ns0:UseCode>Business</ns0:UseCode>
    <ns0:DialNumber>0987654321</ns0:DialNumber>
    <ns0:Address>
        <ns0:CityName />
        <ns0:CountryCode />
        <ns0:PostalCode>64099</ns0:PostalCode>
    </ns0:Address>
</ns0:Communication>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

霊感 2024-11-07 23:48:47

拥有示例输入和输出 xml 片段会有所帮助。没有它,我就可以猜测 xml 结构。如果它们看起来像这样,那么下面的映射应该可以正常工作:

simple biztalk map of address and Phone fields

做你的架构看起来像那样吗?如果目标模式中的 设置为 Max Occurs = unbounded,则此类映射生成的输出有效。如果情况并非如此,并且如果您只能有一个联系人输出,那么如果地址不存在,则必须仅输出电话,如下所示:

在此处输入图像描述

当然,这似乎有点愚蠢,因为人们希望在源 xml 中同时拥有地址和电话,而目标 xml 则不允许您同时拥有这两者。

如果这些场景都不符合您的情况,请编辑您的问题以提供更多详细信息。

It would help to have sample input and output xml snippets. Without that, I can guess at the xml structures. If they look something like this, then the below mapping should work fine:

simple biztalk map of address and phone fields

Do your schemas look like that? The output produced by such a map is valid IF the <Choice> in the destination schema is set to Max Occurs = unbounded. If that's not the case, and if you can only have one Contact output, then you would have to only output the Phone if the Address is not there, like this:

enter image description here

Of course, that seems a bit silly, since one would expect to have both an Address and a Phone in the source xml, and the destination xml prevents you from having both.

If none of these scenarios matches up with yours, then please edit your question to provide more details.

九歌凝 2024-11-07 23:48:47

最小&架构上的最大出现次数默认为 1。映射器在生成 XSLT 时会查看该值。尝试将“最小出现次数”设置为 0。

The min & max occurrences on the schema defaults to 1. The mapper looks at that when generating the XSLT. Try setting Min Occur to 0.

谜泪 2024-11-07 23:48:47

解决这个问题的方法是直接使用xsl< /a> 而不是内置的映射器。

使用 xsl,您可以控制选择值的时间和方式。那是非常困难的
当使用多个循环 functoid 时。

The way to solve this issue is to use xsl directly instead of the built in mapper.

With xsl you can control when and how values are selected. That's very difficult
when using multiple looping functoids.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文