cancel
Showing results for 
Search instead for 
Did you mean: 

Need help with Graphical Mapping problem

terri_walton2
Explorer
0 Kudos

I am new to graphical mapping and I do not know how to map this situation in the graphical mapper. I have data coming in text segments. I only want to map the lines that contain failure information. On the output side, I need to group the related lines into an instance node failedItemList. Below are the source data and the target output.

I set the context of TDLINE to E1ORHDR, which gives me all the TDLINE values in a single context. Then I check for the occurance of Failed Item Type, Failed Item Id, or Item Failure Type, and if it is a match, I map it to the corresponding output field.

However, I am only getting output for the first occurance of FailedItemList. The second occurance is not being output. I know that somehow I need to trigger a context change when I get to the second occurance of TDLINE="Failed Item Type", but I cannot figure out how to do this. Any help would be appreciated.

Source

<?xml version="1.0" encoding="UTF-8"?>

<ZPM_IORDER01>

<IDOC BEGIN="1">

<EDI_DC40 SEGMENT="1">

<TABNAM>EDI_DC40</TABNAM>

</EDI_DC40>

<E1ORHDR SEGMENT="1">

<E1ORHDR_LTXT SEGMENT="1">

<TDFORMAT>*</TDFORMAT>

<TDLINE>Equipment No. 0E3426786 03/15</TDLINE>

</E1ORHDR_LTXT>

<E1ORHDR_LTXT SEGMENT="1">

<TDFORMAT>*</TDFORMAT>

</E1ORHDR_LTXT>

<E1ORHDR_LTXT SEGMENT="1">

<TDFORMAT>*</TDFORMAT>

<TDLINE>Failed Item Type ================&gt; Loop</TDLINE>

</E1ORHDR_LTXT>

<E1ORHDR_LTXT SEGMENT="1">

<TDFORMAT>*</TDFORMAT>

<TDLINE>Failed Item Id '================&gt; L-1</TDLINE>

</E1ORHDR_LTXT>

<E1ORHDR_LTXT SEGMENT="1">

<TDFORMAT>*</TDFORMAT>

<TDLINE>Item Failure Type ================&gt; AL</TDLINE>

</E1ORHDR_LTXT>

<E1ORHDR_LTXT SEGMENT="1">

<TDFORMAT>*</TDFORMAT>

<TDLINE>Failed Item Type ================&gt; Instr</TDLINE>

</E1ORHDR_LTXT>

<E1ORHDR_LTXT SEGMENT="1">

<TDFORMAT>*</TDFORMAT>

<TDLINE>Failed Item Id '================&gt; I.1.1</TDLINE>

</E1ORHDR_LTXT>

<E1ORHDR_LTXT SEGMENT="1">

<TDFORMAT>*</TDFORMAT>

<TDLINE>Item Failure Type ================&gt; AF</TDLINE>

</E1ORHDR_LTXT>

<E1ORHDR_LTXT SEGMENT="1">

<TDFORMAT>*</TDFORMAT>

<TDLINE>Who performed the work==========&gt; TLW</TDLINE>

</E1ORHDR_LTXT>

</E1ORHDR>

</IDOC>

</ZPM_IORDER01>

Target

<WorkOrderRequest>

<company_name> ACB Corp </company_name>

<Order_number>40001</Order_number>

<FailedItemList>

<ItemType>Loop</ItemType>

<ItemCode>L-1</FailedItemId>

<failureType>AL</failureType>

</FailedItemList>

<FailedItemList>

<ItemType>Instr</ItemType>

<ItemCode>I.1.1</FailedItemId>

<failureType>AF</failureType>

</FailedItemList>

</WorkOrderRequest>

Thanks, Terri

Edited by: Terri Walton on Mar 18, 2011 4:10 PM - Edited for readability.

Accepted Solutions (1)

Accepted Solutions (1)

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

However, I am only getting output for the first occurance of FailedItemList. The second occurance is not being output. I know that somehow I need to trigger a context change when I get to the second occurance of TDLINE="Failed Item Type",

This is assuming that you are using ifWithoutElse in your checking. Add this


yourIfWithoutElse logic --> removeContext --> splitByValue:each Value --> target

The removeContext will deal with the suppressed values that your ifWithoutElse is outputting.

Hope this helps,

Mark

former_member472138
Active Contributor
0 Kudos

Hello,

Groupingfield --> removeContext --> Sort --> FormatExample --> splitbyvalue(each value) --> CollapContext --> FaileditemList

SourceField --> splitbyvlaue --> ( add this to FormatbyExample)

This definitely should work out for you.

Regards

Pothana

Edited by: Pothana Yadav on Mar 21, 2011 7:02 AM

Answers (0)