SAP PI消息映射的值列表

问题描述 投票:0回答:1

在SAP PI 7.4中,我在尝试映射消息映射中的某些内容时遇到了一些困难,这看起来非常简单。

输入是这样的。

<Employee>
      <ExternalIdList>
          <ExternalId>aaa</ExternalId>
          <ExternalId>bbb</ExternalId>
          <ExternalId>ccc</ExternalId>
      </ExternalIdList>
</Employee>

我需要这个映射到以下结构的东西

<Newobject>
 <ExternalEmployeeList>
  <ExternalEmployee>
   <ExternalId>aaa</ExternalId>
  </ExternalEmployee>
  <ExternalEmployee>
   <ExternalId>bbb</ExternalId>
  </ExternalEmployee>
  <ExternalEmployee>
   <ExternalId>ccc</ExternalId>
  </ExternalEmployee>
 </ExternalEmployeeList>
</Newobject>

在尝试映射时,我会按如下方式执行此操作:

员工 - > NewObject

ExternalIdList - > ExternalEmployeeList

ExternalId - > ExternalEmployee

ExternalId - > ExternalId

在测试映射时,会创建3个ExternalEmployee节点,但只有第一个包含ExternalId中的值“aaa”。其他2个ExternalEmployees没有获得ExternalId:

<Newobject>
 <ExternalEmployeeList>
  <ExternalEmployee>
   <ExternalId>aaa</ExternalId>
  </ExternalEmployee>
  <ExternalEmployee/>
  <ExternalEmployee/>
  </ExternalEmployee>
 </ExternalEmployeeList>
</Newobject>

我已经尝试了一些节点功能或改变了上下文,但似乎没有任何工作。推荐的解决方案是什么?

也许事先添加一个XSLT映射来在输入消息中的ExternalIdList和ExternalId之间插入一个级别?这似乎有很多模糊。

在此先感谢,欢迎每一个方向正确的方向!

mapping sap esb netweaver
1个回答
0
投票

问题应该是标记ExternalId中缺少上下文更改。

尝试按以下方式修复映射:

ExternalEmployee(target)= ExternalEmployee

ExternalId(target)= splitByValue(ExternalId)

配置splitByValue选择“每个值”选项

ExternalIDScreenshot

还要确保目标ExternalEmployee有1..unbounded发生!

这是结果Result

最好的祝福!

© www.soinside.com 2019 - 2024. All rights reserved.