Example 4 steps

  1. Create collector loops.

    To collect the input data, we need two nested loops, one for the repetitive element Employee and one for the repetitive element Time

    The loops are controlled by these elements. Insert one Collector function into each loop.

  2. Collect data.
    1. Drag and drop the input elements FirstName, LastName, and EmployeeNumber to the first Collector function.

    2. Because we modify the date, create a UVJ function.

      Insert a UVJ function into the inner loop before the second Collector function.

      Drag and drop the input element Date to the Java function and create an output parameter oDate.

    3. Create a logic in the UVJ function to remove time, so that the input date and time 2013-06-17T16:43:23 is converted to 20130617. Use the EDIFACT format "102", that is the format CCYYMMDD. This format is equal to D8 for ANSI X12.

      For example, use this Java code:

      oDate = new DateTimeConverter().setXMLDateTime(iDate).getEDIDateTime("102");
    4. Create a new input parameter Date in the second Collector function.

      Drag and drop the Java function’s output parameter oDate to the Collector function’s input parameter Date.

    5. Drag and drop the input elements Project and Hours to the second Collector function.

      image025_8004b34a_8004b34a.jpg
  3. Create restructure loops.

    This step is the same as step 1 in Example 2. Create the three nested restructure loops after the collector loops.

  4. Select data.
    Instead of using the input document’s elements, we use the Collector functions’ output parameters.
    1. Drag and drop these parameters:
      • Date from the second Collector function to the first Restructure function

      • FirstName from the first Collector function to the second Restructure function, and so on

    2. Because we are restructuring the data, you do not need to match the loop levels for the Collector functions and the Restructure functions. Additionally, you have already created the collector loops for this purpose, so you do not need to select input loop levels for the Restructure functions as you do in Example 2.

    3. Drag and drop from the Restructure functions’ output parameters to the elements and attribute in the output document.image026_8004b34b_8004b34b.png

  5. Sort and group the data.

    This step is the same as step 4 in Example 2. This example only differs on how you define which data to use. Sorting and grouping are done exactly in the same way as in Example 2.