<?xml version="1.0" encoding="UTF-8"?>
<config xmlns="http://web-harvest.sourceforge.net/schema/1.0/config"
        scriptlang="groovy">

    <script><![CDATA[
        import com.workfusion.odf.core.Intake;
        import com.workfusion.odf.service.SplitJoinService;

        Intake intake = Intake.init(binding).get();
        SplitJoinService splitJoinService = intake.getInstance(SplitJoinService.class);

        String transactionId = _sys_transaction_id.toString();
        def docs = splitJoinService.splitTransaction(transactionId);

        result = []
        docs.each {
            result << [
                    '_sys_doc_id': it.id
            ]
        }
        ]]></script>


    <export include-original-data="true">
        <multi-column list="${result}" split-results="true">
            <put-to-column-getter name="_sys_doc_id" property="_sys_doc_id" />
        </multi-column>
    </export>

</config>