映射不存在元素到目标 [英] Mapping not existed element to destination

查看:61
本文介绍了映射不存在元素到目标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有一个要求,我需要映射一个元素,即使它在源模式中不存在

I have a requirement here wherein I need to map an element even if its not exist in source schema

有人可以告诉我该怎么做。 

can somebody please tell me how can I do it. 

INPUT架构:

< ns0: TestSchema xmlns:ns0 =" http://输入">

  &NBSP; < DynamicCase>

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; < Key> id< / Key>

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; < Value> 1504< / Value>

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; < / DynamicCase>

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; < DynamicCase>

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; < Key> test< / Key>

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; < Value> A< / Value>

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; < / DynamicCase>&NBSP; &NBSP; &NBSP; &NBSP; &NBSP;   

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; < DynamicCase>

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; < Key> TODATE< / Key>

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; <值及GT; 20180906< /值及GT;&NBSP;   //假设这些节点不存在

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; < / DynamicCase>

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; < DynamicCase>

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; < Key> STARTDATE< / Key>

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; < Value> 20180607< / Value>

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; < / DynamicCase>

<ns0:TestSchema xmlns:ns0="http://Input">
    <DynamicCase>
                <Key>id</Key>
                <Value>1504</Value>
            </DynamicCase>
            <DynamicCase>
                <Key>test</Key>
                <Value>A</Value>
            </DynamicCase>            
            <DynamicCase>
                <Key>TODATE</Key>
                <Value>20180906</Value>   //Suppose these nodes not present
            </DynamicCase>
            <DynamicCase>
                <Key>STARTDATE</Key>
                <Value>20180607</Value>
            </DynamicCase>

< / ns0:TestSchema> 

</ns0:TestSchema> 

如上所示,我需要将一些默认值映射到目标,即使源模式中不存在TODATE的键值对。 

As shown above I need to map some default value to destination even if Key Value pair for TODATE is not present in source schema. 

谢谢。

推荐答案

您好,

我在您的架构动态案例中看到的是重复记录现在您想要检查Key-value对ToDate是否存在。

I See that in your Schema Dynamic Case is a Repeating Record Now you want to Check whether the Key-value pair ToDate is Present or Not.

1。从,拖动不等于Functoid并将KEY节点和第二参数的第一个参数连接到  TODATE。

1. From the , Drag the Not Equal Functoid and connect the First Parameter for KEY Node and Second Parameter to TODATE.

2.   然后将Not Equal Functoid的输出提供给Value Mapping
Functoid。这将是第一个参数。然后将Default值作为Second Parameter to Value Mapping。你可以将它映射到目的地。

2.  Then give the Output of the Not Equal Functoid to Value Mapping Functoid. That will be the first Parameter. Then give the Default value as Second Parameter to Value Mapping. you can Map this to Destination.


这篇关于映射不存在元素到目标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆