cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in mapping of conditional tag.

Former Member
0 Kudos

Hi Experts,

I have the following problem:

Source tag:

<A>

<FIELD1>DATUM1</FIELD1>

<STATUS> X</STATUS>

</A>

<A>

<FIELD1>DATUM2</FIELD1>

<STATUS> </STATUS>

</A>

<A>

<FIELD1>DATUM3</FIELD1>

<STATUS> </STATUS>

</A>

Target Tag:

<C>

<FIELD1>DATUM1</FIELD1>

</C>

<D>

<FIELD1>DATUM2</FIELD1>

</D>

<D>

<FIELD1>DATUM3</FIELD1>

</D>

So, In Source Tag A, if Status =X =>Target Tag = C

In Source Tag A, if Status =empty =>Target Tag = D.

My mapping is as following:

Source Tag A->exists AND Status=X => CreateIF=>Tag C

Source Tag A->exists AND Status=empty=> CreateIF=>Tag D.

The problem is that I get in Target only Tag C:

<C>

<FIELD1>DATUM1</FIELD1>

</C>

<C>

<FIELD1>DATUM2</FIELD1>

</C>

<C>

<FIELD1>DATUM3</FIELD1>

</C>.

It looks like it does not check for each tag A.

I have tried with UseOneAsMany but it does not work and read a lot on SDN but nothing helped!

Please, any idea?

Kind Regards,

Danijela

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Here is the solution

Source Tag A => SplitByValue(EachValue) => exists AND Status=X => removecontext => CreateIF =>Tag C

Similarly for other tag as well.

BR

Former Member
0 Kudos

Hi Sameer,

Your solution works! Thank you very much.

Thanks to all for suggestions!

Regards,

Danijela

Former Member
0 Kudos

No problem, always have a look at the queue and then that will give you a idea as to how to manipulate them using the node functions

cheers

Sameer

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

This is working..

Source Msg

mt_ip

field

status

Target Msg

mt_op

c

field

d

field

Mapping

status->(equals)->constant(X)->createif->c

field--->field

status->(equals)->constant()->createif->d

field--->field

Edited by: malini balasubramaniam on Jul 15, 2008 12:44 PM

Former Member
0 Kudos

M

In place of "EMPTY" value can you give "Y" ( just for testing purpose ), with this I would like to verify whether it is considering the blank value or not.

Also why you are using the EXISTS function on Tag A?

- Lalit -

Former Member
0 Kudos

Hi Lalit,

Tag A = Occurence 0..unbounded.

For each Tag A, I have to produce Tag C or Tag D (depending on field in Tag A.

I will check for the Y.

Regards,

Danijela

Former Member
0 Kudos

Hi Danijela,

Source tag:

<FIELD1>DATUM1</FIELD1>

<STATUS> X</STATUS>

<FIELD1>DATUM2</FIELD1>

<STATUS> </STATUS>

<FIELD1>DATUM3</FIELD1>

<STATUS> </STATUS>

Target Tag:

<C>

<FIELD1>DATUM1</FIELD1>

</C>

<D>

<FIELD1>DATUM2</FIELD1>

</D>

<D>

<FIELD1>DATUM3</FIELD1>

</D>

Follow these steps -

you have source message type like this

<root>

<Field>

</Field>

<status>

</status>

</root>

In Graphical mapping , first take Status if with else node function and check for 'X' if yes then create target node <C></C> . if else then check for empty with if without else node function and create target node <D></D> node.

It will solve the issue. Pls let us know if you need any further support.

Regards,

kishore

Former Member
0 Kudos

Hi Kishore,

I changed the mapping as you said but it gaves the same. Only Tag C.

Target Tag C:

Source Tag A-FIELD1 is MappedWithDefault with Target Tag C, FIELD1.

For Target Tag D is the same.

I don't understand why it doesn't work.

Any other help/suggestions?

Regards,

Danijela

Former Member
0 Kudos

have tried my solution. Any way first save your changes & activate your mapping then try. This may be unknown behavior due to cache refresh.

Former Member
0 Kudos

Hi,

Simply use ifWithoutElse & EqualS standard function like this.

for target C.

FIELD1---EqualSNOT(Empty)--AND--STATUS--Equals (X) -


IF-THEN-----C.

for target D.

FIELD1---EqualSNOT(Empty)--AND--STATUS--Equals (empty)--IF-THEN-----D.

Regards,

Sarvesh

Former Member
0 Kudos

Hi Sarvesh,

I got lost Tag A in my writing:

Source tag:

<A>

<FIELD1>DATUM1</FIELD1>

<STATUS> X</STATUS>

</A>

<A>

<FIELD1>DATUM2</FIELD1>

<STATUS> </STATUS>

</A>

<A>

<FIELD1>DATUM3</FIELD1>

<STATUS> </STATUS>

</A>

Should I FIELD1 from your answer replace with Tag A?

Regards,

Danijela

Former Member
0 Kudos

Wait a min.... I think your structure is not correct. I mean you should have FIELD1 at target in tag C & FIELD2 in target tag D then only you can get your solution.

No need to replace FIELD1 with tag A.

Former Member
0 Kudos

Hi Sarvesh,

Tag C and Tag D are the same STATUS_TYPE with the same field. Is it a problem?

Do I need to make 2 definitions for each Tag?