cancel
Showing results for 
Search instead for 
Did you mean: 

CreateIf/Ifwithoutelse node function

Former Member
0 Kudos

Hello,

I have target structure like below

Header - 0..Unbounded

SubHeader - 0...1

elements - 0..1

...

...

I need to create Header tag upon some condition mets

I used a createIF node function for the same and it works only for the success condition and its throwing an error as

Cannot produce target node...but my occurence is 0..unbounded for header and 0.1 for subHeader

I am passing the value of UDf and used equals Function..as a condition to create IF and used If without else also but still same..

Any help is appreciated..

Rajesh

Edited by: Rajesh on Jul 2, 2009 1:00 PM

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member200962
Active Contributor
0 Kudos
I used a createIF node function for the same and it works only for the success condition and its throwing an error as 
Cannot produce target node...but my occurence is 0..unbounded for header and 0.1 for subHeader

Since the occurence is 0..unbounded you need not worry about mapping the node with any constant.....just check what is the o/p of your UDF when you get the error...is it producing the required value and is getting the required i/p value?...may be in the error case the input to the equalS function from the UDF is not proper

isuppose the equals function is the equalS (Text) function...

Regards,

Abhishek.

Former Member
0 Kudos

Hello ,

I even tried with constant values and checked the same but its throwing error for false condition as earlier..

I used equalsS function for comparision..

Any guess..??

Rajesh

Former Member
0 Kudos

Hi Rajesh,

Try to use the funciton Exists in the mapping.It means the input has to be passed to the Exist function and map the ouput of Exist to the If Conditon.

Thanks,

Kiran.

Former Member
0 Kudos

Still same result...

what might be wrong....

Rajesh

Former Member
0 Kudos

Hi Rajesh,

Can you just describe the mapping, I mean mapping of the field which is throwing errors.

Thanks,

Kiran.

Former Member
0 Kudos

Hi

After the contant put SpliByValue (Each) and check

rgds

srini

Former Member
0 Kudos

Hello Kiran,

I mapped the condition to Header field as

FirstCase

constant (aaa) equals -- ifiwthout else ---> then constant -->Header

constant(aaa)

if both constatns values are equal then no error ,otherwise throws an error saying target field cannot produce..

second case

cosntant --> Header

constant (aaa) equals -- ifwithout else ---> then constant -->SubHeader

constant(aaa)

Same error in case of values not equal ...

Also I have element occurence as 1..1

former_member200962
Active Contributor
0 Kudos
constant (aaa) equals -- ifiwthout else ---> then constant -->Header
constant(aaa)

instead of mapping a constant to the Header field did you try mapping a node from the source structure which you know will be present when the UDF returns true......also check by mapping blank constant to the Header (if you are not already doing it)..

Edited by: abhishek salvi on Jul 2, 2009 3:33 PM

Former Member
0 Kudos

Hi,

Please try this:

Hearer Mapping: <Condition>----createif -


> Header

subheader mapping: Constant -


> subheader

Element mapping: Contant---->Element.

Try all these thee together.

Regards,

Shweta.

Former Member
0 Kudos

This is how i mapped..

Am i able to overcome the error when i map some source node value ..

but the strange thing is not able to get the element for some condition which is showing the value in queue..

Anyhow i think we need to map some source message value for generating the target on conditions..

Thanks to all of you.....

Rajesh

Former Member
0 Kudos

use Exists as below

if Field1 exixts then Field1

else

constant

Former Member
0 Kudos

Hi,

Please try mapping the root node with a constant. As even if your header node is not created but the root node has to be created. Hope this will solve your probelm.

Regards,

Shweta