Skip to Content
Former Member

### Question regarding the If-then-else function

Hi folks ,

I have been constantly putting threads on this subject for the past day, hope it doesn't annoy any one here.

My scenario is really simple, and i am almost close to the solution, but there is just 1 thing missing and i know that is a very small thing, could be the context too. Hope some one can help by pointing it out>

Mapping:

In my source i have a header(0-unbounded) & detail(0-unbounded). At a given instant either header / detail will occur in source, depending on that the target node "response" will occur(0-n times)

i have achieved this in the mapping.

the problem is this:

Both the Header/Detail have a field in it called Sequence# which is mandatory and can occur only once in the Header/Detail node.

Now depending on what occurs: ie Header/Detail i need to map that particular seq# into my Target Respone's SEQ_#.

I have done the mapping for this and have done a standalone testing.

Mapping: Check if HEADER EXISTS, if yes? then map the HEADER.Seq# to TARGET.Seq#

Here are my findings:

Scenario1: 3 header nodes(No Detaili) each with a seq # in it. Out put 3 Target node each with 3 seq # in it.

Scenario2: 2 Detail Nodes(No header) each with a seq # in it. Output fails to produce the 2nd Target Structure's Seq# and Fails

When i look into the Display Queue in the mapping , i examine the iF-Then-Else function:

Since HEADER doesn't exist i c 1 Suppress in my If-Condition hence the if condition becomes FALSE., now since its false its supposed to map the seq# from my detail. (This case i have 2 ).

But in the output of the IF-Then Else, i get out only 1 seq # which is the 1st one,

What i am thinking is that the exists condition is giving out only 1 FALSE instead of 2, If there were 2 false from the exists then i would have had both the seq # in my output,

I hope my question is clear, Would appreciate anysort of help . And i apologize if I seem to be brigning up the same question over again experts.

I don't wnt to create a UDF for this matter because i know there is something i am not doing right,

Hank

##### Add comment
10|10000 characters needed characters exceeded

### 2 Answers

• Best Answer
Jun 24, 2009 at 12:47 PM

Hi,

Can you change the context of header to upper most level and check in display queue.

Regards,

Chandra.

##### Add comment
10|10000 characters needed characters exceeded
• Former Member Former Member

Thanks Satish,

• Former Member
Jun 24, 2009 at 01:16 PM

if ur target structure is

```response-----------------1 to unbounded
SEQ_#.
```
```after testing the conditions
use removeContext standard node function just  before mapping to *response* node
and use same condition u used for responce node but insted of removeContext function use
splitByValue(each Value)  just before mapping to *SEQ_#.*

```

##### Add comment
10|10000 characters needed characters exceeded