cancel
Showing results for 
Search instead for 
Did you mean: 

How to force field to appear in input structure in content conversion

Former Member
0 Kudos

Hi all,

I am doing file content conversion in sender File adapter. Here is the structure

[/
Header
Body
   field1 - length 2
   field2 - occurrence 1:1, length 3
   field3 - length 2
   field4  length 2
Trailer
Here is the fixed length file that is inputed into XI 

<b>header22   2211trailer</b>

field2 occrence is 1:1 and as you se from the file example field2 from the body is empty(just space).But When I do the content conversion I don;t have this field showing up in my structure!??!!

I want to make sure that field2 appears even as empty field because that is screwing my mapping!?

Can you please have any idea how to make sure that field is in my input structure when I pass spaces?Can I force it somehow?

Thanks all.

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

jon,

Did you try using the following config on the adapter conent conversion?

Body.fieldContentFormatting = nothing

praveen

Former Member
0 Kudos

Hi Jon,

U need to use

If>Field>Exists

Then-->Field

Else-->Constant

Regards,

Former Member
0 Kudos

Hi Srihari ,

Thanks much - i think that is what i need to do . can you please give me some details and explain me how to do it ?

Will in this case my Tag of the blank field be there (in the input structure) no matter if pass blak or not blank??We are talking about Input structure - right?

Thanks much

Former Member
0 Kudos

Jon,

take one if-else "thing".

then:

source tag ->exists(node function)-> arrow to IF

then source tag to THEN

else constant (blank) to ELSE

and result from if - arrow to target field

Peter

Former Member
0 Kudos

Hi Jon,

Yes you are right.

For Ex: ur XML is

<1>a</1>

<2>b</2>

and sometime is there is no value ur FCC will become

<1>a</1>

So what you have to do is in the message mapping take the source element

if <2> exists then <2>---->Target

else

<2>---->Constant(space)

and this "exists" is a standard function in NodeFunctions.

Regards,

Former Member
0 Kudos

jon,

what's your source message's "critical" tag occurence?

Try to give it minOccurs=1

Peter

Former Member
0 Kudos

the field has already occur 1:1 but when I pass blank field the tag of the field just disappear from the structure? Why is that? Can I make this tag still appearing if blank field2 is passed? This is my question?

Thanks much!

Former Member
0 Kudos

Jon,

it can't disappear... Isn't it in the source structure but disappears after the mapping is done? In the target structure?

Peter

Former Member
0 Kudos

Peter,

I am telling you - if blank field is passsed , after file content converison is done, the tag is not there..Is is just skipped!!

Now if I pass - some not blank value - 123 for example - the tag is again back in the structure? Is there anyway i can do to make sure my field2 tag is there no matter if i pass blank field or not blank ?

thanks mush!

Former Member
0 Kudos

It's strange, but I trust you

Well, try the mapping workaround from the answer above.

Peter

Former Member
0 Kudos

Well, now i see, it is not what i thought..

Try st like: if (source) node exist, map it, otherwise put blank constant..

This is no problem in mapping and will solve ur problem.

Peter

Former Member
0 Kudos

its really starnge but i m doin the exact same thing and i m getting a field in structure irrespective of it being blank or filled.

for blank i get <field2/>

and for filled up values i get <field2>111</field2>

what is the occurence of body anyways?try making that 1-1 and test.

secondly if it does not work,use mapwithdefault function to atleast populate the receiver structure with a blank

Thanx

Aamir

Former Member
0 Kudos

Aamir,

FYI My Body occurrence is 0:1 ...

I am going to try what SriHari Bandi proposes lastly and will let you know.

thanks for your help anyway....:)

Former Member
0 Kudos

mapping will not solve your problem,its an issue at AE level,the FCC is not converting the structure as per the sender data type,i don't know how any mapping function can solve at the sender level.mapping is executed much after the sender FCC:)

mapping will help in case of receiver not sender FCC.

Thanx

Aamir

Former Member
0 Kudos

Jon,

If everything is in one line then how you will read in XI with the structure you given. It will definitely throw an error.

Also if we have spaces in the file it reads into XI as spaces if the content conversion is ok. I think your content conversion is wrong here not the spaces issue.

Regards,

---Satish

Former Member
0 Kudos

hi jon,

have you given fieldSepartor...??

what exactly is your input and what are you expecting...

regards

Ramesh P

Former Member
0 Kudos

there is no field separator - this is is just fixed length file.

the file is

headerBobyTrailer as

<b>header11 2244trialer</b>

where the blank space is field2 .

(I do not care about header, trailer)

How do you handle this in FCC on the file adapter? I really want to pass this blank value to the target structure??!

thanks all