cancel
Showing results for 
Search instead for 
Did you mean: 

Help with Message Mapping - Context Change

susan_pfab
Participant
0 Kudos

I need help with the following message mapping. I am filtering by EMP_STAT in the Message Mapping. I have this working for the ROW structures, but I can get the HEADER/REC_COUNT field to calculate. I can do just a record count of ROW and get it to work, but I can't get it to work with the filter EMP_STAT = 'REG' added. I get a context error. Could someone send me the mapping code.

Sender XML----


<RECORD>

<ROW>

<EMPLOYEE>111</EMPLOYEE>

<EMP_STAT>REG</EMP_STAT>

</ROW>

<ROW>

<EMPLOYEE>222</EMPLOYEE>

<EMP_STAT>PT</EMP_STAT>

</ROW>

<ROW>

<EMPLOYEE>333</EMPLOYEE>

<EMP_STAT>REG</EMP_STAT>

</ROW>

</RECORD>

Receiver XML----


<RECORD>

<HEADER>

<REC_COUNT>2</REC_COUNT>

</HEADER>

<ROW>

<EMPLOYEE>111</EMPLOYEE>

<EMP_STAT>REG</EMP_STAT>

</ROW>

<ROW>

<EMPLOYEE>333</EMPLOYEE>

<EMP_STAT>REG</EMP_STAT>

</ROW>

</RECORD>

Accepted Solutions (0)

Answers (1)

Answers (1)

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

You can use this mapping

For REC_COUNT:


EMP_STAT -> equalsS: constant:REG -> ifWithoutElse -> removeContext -> count -> REC_COUNT
                                 EMPLOYEE -> /

For ROW:


EMP_STAT -> equalsS: constant:REG -> ifWithoutElse -> removeContext -> ROW
                                 EMPLOYEE -> /

For EMPLOYEE:


EMP_STAT -> equalsS: constant:REG -> ifWithoutElse -> removeContext -> SplitByValue -> EMPLOYEE
                                 EMPLOYEE -> /

For EMP_STAT:


Constant: REG -> EMP_STAT

Hope this helps,

Mark

susan_pfab
Participant
0 Kudos

Is there a way to code this using a COUNT of ROW instead of COUNT of EMPLOYEE? The example I gave was extremely simplified. There are actually over 100 fields in the sender XML, and EMPLOYEE is not always populated, depending on which other field are populated. Thanks.

Former Member
0 Kudos

Hi Susan,

For REC_COUNT, u can use the mapping suggested above,

For ROW you can try the below mapping:

EMP_STAT

-


> EQUALS -


> REMOVE CONTEXT-----> CREATEIF---->ROW

Constant: REG

Now map the Employee -


> Employee

EMP_STAT ---> EMP_STAT

Please try and ley me know If your problem is solved

Thanks

Newa