cancel
Showing results for 
Search instead for 
Did you mean: 

IF statement in Mapping is getting suppressed

Former Member
0 Kudos

Hi all

in my mapping i am using IF statement , in which ,

one of my condition is that

if -


> condition exist then -


> pass XXXXXXXX

else _----


> pass YYYYYYY

when i check my display queue . in the else part data is there but it is supressed

please help me in this issuse

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

it is not working , with collapsecontext also

Edited by: sridhar loganathan on Jan 30, 2009 8:47 AM

Former Member
0 Kudos

Hi,

Try the following mapping,

                                         YYYYYYY --> CollapseContext -->
XXXXXXXX --> CollapseContext --> 
                               Equals -->                              if --> SplitByValue-->Target Field.
           Constant(blank Value)
                                           XXXXXXXX --> CollapseContext -->

-Rohit

Former Member
0 Kudos

Hi sridhar,

It is because of queue and context problem.

The queues should be same for all the input.

Can you give your source structure?

Regards,

Prakasu

Former Member
0 Kudos

yes i hope so , but will you tell me the how to over come this problem , casue for one thing i have changed the context it is working , but i did it in a blind way , but not sure abt what method to folllow for other,

Former Member
0 Kudos

Hi,

Do the following.

Field1exits(Check the queue)-ifthenField2(Check the queue)-elseField3(Check the queue)-Target.

The queue values should be same for the 3 inputs. According to exits queue change the Field2 and Field3 queue.

Regards,

Prakasu

Former Member
0 Kudos

hey please help me , how to check the the queue in context, whether all are existing , after right click and display queue what must we check whether all are in same queue

Former Member
0 Kudos

Hi,

Can you provide your source and target structure..

Regards,

Prakasu

Former Member
0 Kudos

sorry i am in a project where i cannot do anything just access SDN only

Former Member
0 Kudos

sridhar,

give a sample one..and sample input data..According to structure the queues and context will change.

try the display queue for each input used if condition.other two fields queue and Field which used for exit function queue should be same.

Regards,

Prakasu

Former Member
0 Kudos

Hi prakash,

you means to say the fields in which in IF condition must have same context , becasue one fields is in ITEM level and one is in header level, thought that in if condition , this wont affect

Former Member
0 Kudos

Hi,

This will affect when you will use if condition(if with else).can you explain how you mapped the fields.

Like..

<header>

field1

<item>

field2

field3

field2<headerlevel>-exitsifthen<field2<itemlevel>--else<field3<itemlevel>>

Regards,

Prakasu

Former Member
0 Kudos

hi prasash have send a msil to ur gmail my source structure , please help me

Edited by: sridhar loganathan on Jan 30, 2009 9:34 AM

sunil_singh13
Active Contributor
0 Kudos

I have uploaded the screen shot here. Have a look and let me know if it is your requirment else sent me the screen shot of what exactly you are doing and the problem.

http://www.4shared.com/file/83217639/8f4a48a/New_Microsoft_Office_Word_Document.html

Thanks

Sunil Singh

markangelo_dihiansan
Active Contributor
0 Kudos

Hi,

Use the node function mapWithDefault like this:

YYYYYYY ---> mapWithDefault, you could also use it in the then part just to make sure the value is not suppressed

Hope this helps,

Former Member
0 Kudos

hi thank you very much ,

XXXXXX and YYYYYY are address fields coming from data base , i am using condition that if XXXX not exist then take that one else YYYYYY, but in my case i have YYYYYY , which i cannot make it default ,and one more thing i have value in the YYYYYY fields , i dont know why it is getting supressed , in IF condition

markangelo_dihiansan
Active Contributor
0 Kudos

Hi,

We've had also the same scenario in which the source field is coming from database. We have used mapWithDefault but without giving any default values. Our scenario was:

VENDOR_URL --> mapWithDefault --> equalsS NA, where the VENDOR_URL is a constant, but in the middle of the mapping, this is replaced by a value in the hashmap function. I'm not sure why the mapWithDefault was used, but this worked

Former Member
0 Kudos

dont know what is wrong with IF consition in Mapping even though , it had value , it is giving me as suppressed value ,

please help me in this , i am using PI 7.1

sunil_singh13
Active Contributor
0 Kudos

Hi Sridhar,

I think you have some wrong concept with exists function.

Here in your case you require to check the value of node, not the node.

exists function checks if the node is present if the node is present then only it will pass true irrespective of its value.

in nutshell exists function only cheks the node not its value.

I would suggest you to use equals from the text function it will work.

Thanks

Sunil Singh