Example XML definition

This code block is the full XML definition (with <data>, <logic>, and <format> blocks combined) of the example scenario:

<payroll_export plugin="com.workbrain.app.export.payroll.basic.BasicPayrollExportPlugin">
  <data>
    <field name='emp_name' />
    <field name='emp_lastname'/>
    <field name='emp_firstname'/>
    <field name='wrkd_work_date'/>
    <field name='wrkd_minutes'/>
    <field name='wrkd_rate'/>
    <field name='dept_name'/>
    <field name='tcode_name'/>
    <field name='htype_name'/>
    <dummy_field name='earn_code'/>
  </data>

  <logic>
    <match_output>
      <match field="tcode_name" value="WRK" />
      <match field="htype_name" value="REG" /> 
      <output_row>
        <map field="earn_code" value="001">
      </output_row>
    </match_output>
    <match_output>
      <match field="tcode_name" />
        <value>VAC</value>
        <value>SICK</value>
      </match>
      <output_row>
        <map field="earn_code" value="002">
      </output_row>
    </match_output>
    <match_output>
      <match field="tcode_name" value="WRK" />
      <match field="htype_name" value="OT%" />
      <output_row>
        <map field="earn_code" value="011"/>
      </output_row >
    </match_output>
    <match_output>
      <match field="tcode_name" value="UAT" />
    </match_output>
    <match_output>
      <match field="htype_name" value="UNPAID" />
    </match_output>
    <match_output>
      <output_row>
        <map field="earn_code" value="999"/>
      </output_row >
    </match_output>
  </logic>

  <format>
    <header>
      <constant>Payroll Report</constant>  
      <new_line/>
    </header>
    <body>
      <constant> : </constant>
      <string field='emp_firstname' pad_right='20' />
      <constant> ; </constant>
      <string field='emp_lastname' pad_right='20' />
      <constant> ; </constant>
      <string field='emp_name' pad_right='20' />
      <constant> ; </constant>
      <string field='dept_name' pad_right='20' />
      <constant> ; </constant>
      <string field='wrkd_work_date' format='yyyy-MM-dd' />
      <constant> ; </constant>
      <string field='wrkd_minutes' format='00000.00' />
      <constant> ; </constant>
      <string field='wrkd_rate' format='00000.00' />
      <constant> ; </constant>
      <string field='earn_code' format='000' />
      <new_line/>
    </body>
    <footer>
      <constant>End Payroll Report</constant>
      <new_line/>
    </footer>
  </format>
</payroll_export>

This XML block is placed into the XML field of the Payroll Export Task Detail page.