on 03-18-2011 9:09 PM
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 ================> Loop</TDLINE>
</E1ORHDR_LTXT>
<E1ORHDR_LTXT SEGMENT="1">
<TDFORMAT>*</TDFORMAT>
<TDLINE>Failed Item Id '================> L-1</TDLINE>
</E1ORHDR_LTXT>
<E1ORHDR_LTXT SEGMENT="1">
<TDFORMAT>*</TDFORMAT>
<TDLINE>Item Failure Type ================> AL</TDLINE>
</E1ORHDR_LTXT>
<E1ORHDR_LTXT SEGMENT="1">
<TDFORMAT>*</TDFORMAT>
<TDLINE>Failed Item Type ================> Instr</TDLINE>
</E1ORHDR_LTXT>
<E1ORHDR_LTXT SEGMENT="1">
<TDFORMAT>*</TDFORMAT>
<TDLINE>Failed Item Id '================> I.1.1</TDLINE>
</E1ORHDR_LTXT>
<E1ORHDR_LTXT SEGMENT="1">
<TDFORMAT>*</TDFORMAT>
<TDLINE>Item Failure Type ================> AF</TDLINE>
</E1ORHDR_LTXT>
<E1ORHDR_LTXT SEGMENT="1">
<TDFORMAT>*</TDFORMAT>
<TDLINE>Who performed the work==========> 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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.