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

     Input parameters:
       _sys_transaction_id - ID of the transaction created in previous step.
     -->

    <script><![CDATA[
        poolKey = ['INTAKE_WAIT_ALL_POOL_KEY'];
    ]]></script>

    <pool key="intake_wait" convert-to-map="false">
        <list>
            <script return="poolKey"/>
        </list>
        <body>
            <script><![CDATA[
                import com.workfusion.odf.core.Intake;
                import com.workfusion.odf.service.TransactionWaitService;

                Intake intake = Intake.init(binding).get();
                TransactionWaitService transactionWaitService = intake.getInstance(TransactionWaitService.class);
                result = transactionWaitService.registerTransactionCompletion(_sys_transaction_id.toString());
            ]]></script>
        </body>
    </pool>

    <export include-original-data="false">
        <single-column name="_sys_transaction_ids" value="${result}"/>
    </export>
</config>
