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>

在尝试映射的时候,我的做法如下。

Employee -> 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 sap-xi sap-pi
1个回答
1
投票

问题应该是标签ExternalId的上下文变化缺失。

试着用以下方式修复映射。

ExternalEmployee (target) = ExternalEmployee.

ExternalId (target) = splitByValue(ExternalId)

配置splitByValue选择"每个值" 选项

ExternalIDScreenshot

同时要确保目标ExternalEmployee有1个...无限制的发生!

这就是结果Result

问候

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