Skip to Content
1
Dec 17, 2018 at 02:47 PM

One Source and Multiple Target nodes using UDF

109 Views

Hello Experts,

I'm trying to find a solutions for one of my requirements.

This is my Source

<Header>

<EMPID>12345</EMPID>

<Name>ABC</Name>

<No_of_Hours>16</No_of_Hours>

<Start_Date>12/17/2018</Start_Date>

<End_Date>12/18/2018</End_Date>

</Header>

Expected Target is

<Header>

<EMPID>12345</EMPID>

<Name>ABC</Name>

<No_of_Hours>8</No_of_Hours>

<Start_Date>12/17/2018</Start_Date>

<End_Date>12/17/2018</End_Date>

</Header>

<Header>

<EMPID>12345</EMPID>

<Name>ABC</Name>

<No_of_Hours>8</No_of_Hours>

<Start_Date>12/18/2018</Start_Date>

<End_Date>12/18/2018</End_Date>

</Header>

As per the requirement, if the number of hours is more than 8, another node should be created with same data and dates modified based on start date and end date. such that if a person has clocked for two days, then the source will collate and send as one xml structure, but the target needs two line items based on the available data. assumptions are No_of_Hours field will have the hours only in multiples of 8. There won't be any holidays between startdate and end date. Kindly suggest an approach or an UDF to proceed.

Many Thanks,

Sidharth VR