<?xml version='1.0' encoding='UTF-8'?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" 
              xmlns:wd="urn:com.workday/bsvc" 
              wd:version="v44.0">
    <env:Body>
        <wd:Get_Requisitions_Response>
            <wd:Request_References>
                <wd:Requisition_Reference>
                    <wd:ID wd:type="WID">08b13b4401db90019e03d3bd21270000</wd:ID>
                    <wd:ID wd:type="Requisition_Number">WHO-2025-RQ0000000035</wd:ID>
                    <wd:ID wd:type="Requisition_Reference_ID">REQUISITION-6-4503</wd:ID>
                </wd:Requisition_Reference>
            </wd:Request_References>
            <wd:Response_Filter>
                <wd:Page>1</wd:Page>
                <wd:Count>1</wd:Count>
            </wd:Response_Filter>
            <wd:Response_Group>
                <wd:Include_Reference>1</wd:Include_Reference>
            </wd:Response_Group>
            <wd:Response_Results>
                <wd:Total_Results>1</wd:Total_Results>
                <wd:Total_Pages>1</wd:Total_Pages>
                <wd:Page_Results>1</wd:Page_Results>
                <wd:Page>1</wd:Page>
            </wd:Response_Results>
            <wd:Response_Data>
                <wd:Requisition>
                    <wd:Requisition_Reference>
                        <wd:ID wd:type="WID">08b13b4401db90019e03d3bd21270000</wd:ID>
                        <wd:ID wd:type="Requisition_Number">WHO-2025-RQ0000000035</wd:ID>
                        <wd:ID wd:type="Requisition_Reference_ID">REQUISITION-6-4503</wd:ID>
                    </wd:Requisition_Reference>
                    <wd:Requisition_data>
                        <wd:Requisition_Number>WHO-2025-RQ0000000035</wd:Requisition_Number>
                        <wd:Requisition_Document_Status_Reference>
                            <wd:ID wd:type="WID">dc76c5ec446c11de98360015c5e6daf6</wd:ID>
                            <wd:ID wd:type="Document_Status_ID">SUCCESSFULLY COMPLETED</wd:ID>
                        </wd:Requisition_Document_Status_Reference>
                        <wd:Requisition_Date>2025-02-27</wd:Requisition_Date>
                        <wd:Requisition_Currency_Reference>
                            <wd:ID wd:type="WID">9e996ffdd3e14da0ba7275d5400bafd4</wd:ID>
                            <wd:ID wd:type="Currency_ID">USD</wd:ID>
                            <wd:ID wd:type="Currency_Numeric_Code">840</wd:ID>
                        </wd:Requisition_Currency_Reference>
                        <wd:Requisition_Type_Reference>
                            <wd:ID wd:type="WID">71ae72ac86e91001ebdf92e207940000</wd:ID>
                            <wd:ID wd:type="Requisition_Type_Reference_ID">APW_Suppliers_Emergencies</wd:ID>
                        </wd:Requisition_Type_Reference>
                        <wd:Requisition_Sourcing_Buyer_Reference>
                            <wd:ID wd:type="WID">aa10ba222d03100160ef73646b620002</wd:ID>
                            <wd:ID wd:type="Employee_ID">S204606</wd:ID>
                        </wd:Requisition_Sourcing_Buyer_Reference>
                        <wd:Company_Reference>
                            <wd:ID wd:type="WID">71ae72ac86e91001ebdb5e27bb2b0001</wd:ID>
                            <wd:ID wd:type="Organization_Reference_ID">CO-WHO</wd:ID>
                            <wd:ID wd:type="Company_Reference_ID">CO-WHO</wd:ID>
                        </wd:Company_Reference>
                        <wd:Deliver-To_Location_Reference>
                            <wd:ID wd:type="WID">71ae72ac86e91001d59b6a3d798c0000</wd:ID>
                            <wd:ID wd:type="Location_ID">LOC_HQ_CHE_GE020_1</wd:ID>
                        </wd:Deliver-To_Location_Reference>
                        <wd:Ship_To_Address_Data>
                            <wd:Ship-To_Address_Reference>
                                <wd:ID wd:type="WID">328c557978d51001f59323c8d6b60001</wd:ID>
                            </wd:Ship-To_Address_Reference>
                            <wd:Address_Reference>
                                <wd:ID>ADDRESS_REFERENCE-6-11883</wd:ID>
                            </wd:Address_Reference>
                        </wd:Ship_To_Address_Data>
                        <wd:Requester_Reference>
                            <wd:ID wd:type="WID">00543672893610014ae713b95ce10000</wd:ID>
                            <wd:ID wd:type="Employee_ID">S400069</wd:ID>
                        </wd:Requester_Reference>
                        <wd:Memo_to_Suppliers>Test APW ER // 2PTGs</wd:Memo_to_Suppliers>
                        <wd:Freight_Amount>0</wd:Freight_Amount>
                        <wd:Other_Charges>0</wd:Other_Charges>
                        <wd:High_Priority>0</wd:High_Priority>
                        <wd:Consolidate_Requisition_on_PO>0</wd:Consolidate_Requisition_on_PO>
                        <wd:Exclude_Ship_To_Address_When_Consolidating_Requisition_Lines>1</wd:Exclude_Ship_To_Address_When_Consolidating_Requisition_Lines>
                        <wd:Service_Request_Line_Data>
                            <wd:Requisition_Service_Line_Reference>
                                <wd:ID wd:type="WID">0555b7d8ba8c90019e120c2ea2980000</wd:ID>
                                <wd:ID wd:type="Requisition_Line_ID">SERVICE_REQUISITION_LINE-6-4554</wd:ID>
                            </wd:Requisition_Service_Line_Reference>
                            <wd:Service_Requisition_Line_ID>SERVICE_REQUISITION_LINE-6-4554</wd:Service_Requisition_Line_ID>
                            <wd:Line_Company_Reference>
                                <wd:ID wd:type="WID">71ae72ac86e91001ebdb5e27bb2b0001</wd:ID>
                                <wd:ID wd:type="Organization_Reference_ID">CO-WHO</wd:ID>
                                <wd:ID wd:type="Company_Reference_ID">CO-WHO</wd:ID>
                            </wd:Line_Company_Reference>
                            <wd:Item_Reference>
                                <wd:ID wd:type="WID">328c557978d51000b05c796d73700000</wd:ID>
                                <wd:ID wd:type="Purchase_Item_ID">Countersigned Contract (APW Company - Security &amp; Infrastructure Category)</wd:ID>
                            </wd:Item_Reference>
                            <wd:Description>Countersigned Contract (APW Company - Facility Management Category)</wd:Description>
                            <wd:Spend_Category_Reference>
                                <wd:ID wd:type="WID">71ae72ac86e91001d43d6e1526d40001</wd:ID>
                                <wd:ID wd:type="Spend_Category_ID">SER_048_00</wd:ID>
                            </wd:Spend_Category_Reference>
                            <wd:Supplier_Reference>
                                <wd:ID wd:type="WID">0054367289361001f58f1f8549a80000</wd:ID>
                                <wd:ID wd:type="Supplier_Reference_ID">KG-417684</wd:ID>
                                <wd:ID wd:type="Supplier_ID">KG-19472453</wd:ID>
                            </wd:Supplier_Reference>
                            <wd:Extended_Amount>10000</wd:Extended_Amount>
                            <wd:RFQ_Required>0</wd:RFQ_Required>
                            <wd:Start_Date>2025-03-31</wd:Start_Date>
                            <wd:End_Date>2025-04-01</wd:End_Date>
                            <wd:Ship_To_Address_Reference>
                                <wd:ID wd:type="WID">328c557978d51001f59323c8d6b60000</wd:ID>
                                <wd:ID wd:type="Address_ID">ADDRESS_REFERENCE-6-11883</wd:ID>
                            </wd:Ship_To_Address_Reference>
                            <wd:Ship_To_Contact_Reference>
                                <wd:ID wd:type="WID">00543672893610014ae713b95ce10000</wd:ID>
                                <wd:ID wd:type="Employee_ID">S400069</wd:ID>
                            </wd:Ship_To_Contact_Reference>
                            <wd:Deliver_To_Location_Reference>
                                <wd:ID wd:type="WID">71ae72ac86e91001d59b6a3d798c0000</wd:ID>
                                <wd:ID wd:type="Location_ID">LOC_HQ_CHE_GE020_1</wd:ID>
                            </wd:Deliver_To_Location_Reference>
                            <wd:Budget_Date>2025-02-27</wd:Budget_Date>
                            <wd:Worktags_Reference>
                                <wd:ID wd:type="WID">71ae72ac86e91001e66759e0d3920000</wd:ID>
                                <wd:ID wd:type="Organization_Reference_ID">SP_OUTPUT_1.2.3</wd:ID>
                                <wd:ID wd:type="Custom_Organization_Reference_ID">SP_OUTPUT_1.2.3</wd:ID>
                            </wd:Worktags_Reference>
                            <wd:Worktags_Reference>
                                <wd:ID wd:type="WID">ff9cd49d22fe1001f6dcfcee952b0000</wd:ID>
                                <wd:ID wd:type="Custom_Worktag_3_ID">Internal_Use_-_WHO Use_/_Consumption</wd:ID>
                            </wd:Worktags_Reference>
                            <wd:Worktags_Reference>
                                <wd:ID wd:type="WID">4248a2b029db100cbc245a2231540000</wd:ID>
                                <wd:ID wd:type="Organization_Reference_ID">17304_WP_CHN</wd:ID>
                                <wd:ID wd:type="Cost_Center_Reference_ID">17304_WP_CHN</wd:ID>
                            </wd:Worktags_Reference>
                            <wd:Worktags_Reference>
                                <wd:ID wd:type="WID">71ae72ac86e91001d589cc24cc440002</wd:ID>
                                <wd:ID wd:type="Custom_Worktag_09_ID">MSC010</wd:ID>
                            </wd:Worktags_Reference>
                            <wd:Worktags_Reference>
                                <wd:ID wd:type="WID">71ae72ac86e91001e6638587a45a0000</wd:ID>
                                <wd:ID wd:type="Organization_Reference_ID">EE_0005</wd:ID>
                                <wd:ID wd:type="Custom_Organization_Reference_ID">EE_0005</wd:ID>
                            </wd:Worktags_Reference>
                            <wd:Worktags_Reference>
                                <wd:ID wd:type="WID">328c557978d510006bf6142155250000</wd:ID>
                                <wd:ID wd:type="Project_ID">WPTESTPTG99</wd:ID>
                            </wd:Worktags_Reference>
                            <wd:Worktags_Reference>
                                <wd:ID wd:type="WID">328c557978d510006f56c3bff72f0000</wd:ID>
                                <wd:ID wd:type="Grant_ID">WPGRANT99</wd:ID>
                            </wd:Worktags_Reference>
                            <wd:Worktags_Reference>
                                <wd:ID wd:type="WID">71ae72ac86e91001d58a94b841630000</wd:ID>
                                <wd:ID wd:type="Fund_ID">1291_1GFAC2</wd:ID>
                            </wd:Worktags_Reference>
                            <wd:Worktags_Reference>
                                <wd:ID wd:type="WID">328c557978d5100073c6e5cea1ab0000</wd:ID>
                                <wd:ID wd:type="Organization_Reference_ID">WT_WPTESTPTG99_1.1</wd:ID>
                                <wd:ID wd:type="Custom_Organization_Reference_ID">WT_WPTESTPTG99_1.1</wd:ID>
                            </wd:Worktags_Reference>
                            <wd:Worktags_Reference>
                                <wd:ID wd:type="WID">71ae72ac86e91001d589dfff3e020001</wd:ID>
                                <wd:ID wd:type="Custom_Worktag_10_ID">Direct_Sourcing</wd:ID>
                            </wd:Worktags_Reference>
                            <wd:Worktags_Reference>
                                <wd:ID wd:type="WID">71ae72ac86e91001d5899265ebc50001</wd:ID>
                                <wd:ID wd:type="Custom_Worktag_4_ID">G3</wd:ID>
                            </wd:Worktags_Reference>
                            <wd:Worktags_Reference>
                                <wd:ID wd:type="WID">71ae72ac86e91001ebdf851150e40000</wd:ID>
                                <wd:ID wd:type="Organization_Reference_ID">107</wd:ID>
                                <wd:ID wd:type="Region_Reference_ID">107</wd:ID>
                            </wd:Worktags_Reference>
                            <wd:Worktags_Reference>
                                <wd:ID wd:type="WID">328c557978d510007055224e0ae00000</wd:ID>
                                <wd:ID wd:type="Organization_Reference_ID">TT_WPTESTPTG99_1</wd:ID>
                                <wd:ID wd:type="Custom_Organization_Reference_ID">TT_WPTESTPTG99_1</wd:ID>
                            </wd:Worktags_Reference>
                            <wd:Source_This_Line>1</wd:Source_This_Line>
                            <wd:Purchase_Order_Line_Reference>
                                <wd:ID wd:type="WID">dea9451142b79001eaa1f78948580001</wd:ID>
                                <wd:ID wd:type="Purchase_Order_Line_ID">ORDER_SERVICE_LINE-6-2876</wd:ID>
                                <wd:ID wd:type="Line_Number" wd:parent_type="WID" wd:parent_id="dea9451142b79001eaa1f5bc75480000">1</wd:ID>
                                <wd:ID wd:type="Line_Number" wd:parent_type="Document_Number" wd:parent_id="WHO-2025-PO0000000167">1</wd:ID>
                                <wd:ID wd:type="Line_Number" wd:parent_type="Purchase_Order_Reference_ID" wd:parent_id="PURCHASE_ORDER-6-1905">1</wd:ID>
                            </wd:Purchase_Order_Line_Reference>
                            <wd:Is_Line_Closed>0</wd:Is_Line_Closed>
                        </wd:Service_Request_Line_Data>
                    </wd:Requisition_data>
                </wd:Requisition>
            </wd:Response_Data>
        </wd:Get_Requisitions_Response>
    </env:Body>
</env:Envelope>

Dataweave:
%dw 2.0
output application/json
var currentDate = now() as String {format: "yyyy-MM-dd HH:mm:ss"}
// Helper functions
fun getWorkerID(requesterRef, sourcingBuyerRef) = 
    if (requesterRef.*"wd:type"[0] == "Employee") 
        requesterRef.*"wd:ID"[0] 
    else if (sourcingBuyerRef.*"wd:type"[0] == "Employee")
        sourcingBuyerRef.*"wd:ID"[0]
    else
        requesterRef.*"wd:ID"[0] default ""

fun getLineType(line) = 
    if (line.wd:Extended_Amount as Number != 0) 
        "Amount Based Services"
    else if (line.wd:Extended_Amount as Number == 0)
        "Zero Based Services"
    else
        "Rate Based Services"

fun getAuthorizationStatus(status) = 
    if (status == "SUCCESSFULLY COMPLETED") 
        "APPROVED"
    else if (status == "CANCELLED")
        "CANCELLED"
    else if (status == "CLOSED")
        "CLOSED"
    else
        "APPROVED"

fun getQuantity(line) = 
    if (getLineType(line) == "Amount Based Services") 
        null
    else if (getLineType(line) == "Zero Based Services")
        1
    else
        line.wd:Quantity as Number default null

fun getUnitOfMeasure(line) = 
    if (getLineType(line) == "Amount Based Services") 
        null
    else if (getLineType(line) == "Zero Based Services")
        "Each"
    else
        line.wd:Unit_Of_Measure default null

fun getUnitPrice(line) = 
    if (getLineType(line) == "Amount Based Services") 
        null
    else if (getLineType(line) == "Zero Based Services")
        1
    else
        line.wd:Unit_Cost as Number default null

// Main transformation
payload.*"env:Envelope".*"env:Body".*"wd:Get_Requisitions_Response".*"wd:Response_Data".*"wd:Requisition" map ((requisition) -> {
    // Header level fields
    REQ_NUMBER: requisition.wd:Requisition_data.wd:Requisition_Number,
    AUTHORIZATION_STATUS: getAuthorizationStatus(requisition.wd:Requisition_data.wd:Requisition_Document_Status_Reference.*"wd:ID"[?($.@"wd:type" == "Document_Status_ID")][0]),
    PREPARER_ID: getWorkerID(
        requisition.wd:Requisition_data.wd:Requester_Reference,
        requisition.wd:Requisition_data.wd:Requisition_Sourcing_Buyer_Reference
    ),
    CURRENCY_CODE: requisition.wd:Requisition_data.wd:Requisition_Currency_Reference.*"wd:ID"[?($.@"wd:type" == "Currency_ID")][0],
    PR_TYPE: if (requisition.wd:Requisition_data.wd:Requisition_Type_Reference.*"wd:ID"[?($.@"wd:type" == "Requisition_Type_Reference_ID")][0] contains "Goods") 
                "GOODS" 
             else "SERVICES",
    PROCUREMENT_TYPE: requisition.wd:Requisition_data.wd:Requisition_Type_Reference.*"wd:ID"[?($.@"wd:type" == "Requisition_Type_Reference_ID")][0],
    SUGGESTED_BUYER_ID: requisition.wd:Requisition_data.wd:Requisition_Sourcing_Buyer_Reference.*"wd:ID"[?($.@"wd:type" == "Employee_ID")][0],
    BATCH_ID: requisition.wd:Requisition_data.wd:Integration_Event_WID default "",
    BP_EVENT_ID: requisition.wd:Requisition_data.wd:Event_WID default "",
    CREATED_BY: requisition.wd:Requisition_data.wd:Requisition_Sourcing_Buyer_Reference.*"wd:ID"[?($.@"wd:type" == "Employee_ID")][0],
    LAST_UPDATED_BY: requisition.wd:Requisition_data.wd:Requisition_Sourcing_Buyer_Reference.*"wd:ID"[?($.@"wd:type" == "Employee_ID")][0],
    SOURCE: "Extend",
    STATUS_FLAG: "N",
    CREATION_DATE: currentDate,
    
    // Line items
    LINE_ITEMS: requisition.wd:Requisition_data.wd:Service_Request_Line_Data map ((line, index) -> {
        LINE_TYPE: getLineType(line),
        LINE_QUANTITY: getQuantity(line),
        UNIT_OF_MEASURE: getUnitOfMeasure(line),
        CURRENCY_UNIT_PRICE: getUnitPrice(line),
        ITEM_DESCRIPTION: line.wd:Description,
        NOTE_TO_BUYER: line.wd:Memo_to_Suppliers default "",
        LINE_CURRENCY_AMOUNT: line.wd:Extended_Amount as Number,
        ITEM_CODE: if (requisition.wd:Requisition_data.wd:Requisition_Type_Reference.*"wd:ID"[?($.@"wd:type" == "Requisition_Type_Reference_ID")][0] contains "Goods") 
                    line.wd:Item_Reference.*"wd:ID"[?($.@"wd:type" == "Purchase_Item_ID")][0] 
                  else null,
        NEED_BY_DATE: if (requisition.wd:Requisition_data.wd:Requisition_Type_Reference.*"wd:ID"[?($.@"wd:type" == "Requisition_Type_Reference_ID")][0] contains "Goods")
                        requisition.wd:Requisition_data.wd:Requested_Delivery_Date default null
                      else
                        line.wd:End_Date,
        EXPENDITURE_TYPE: line.wd:Expenditure_Type default "",
        EXPENDITURE_ORGANIZATION_ID: line.wd:Worktags_Reference.*"wd:ID"[?($.@"wd:type" == "Cost_Center_Reference_ID")][0] default "",
        PROJECT_NUMBER: line.wd:Worktags_Reference.*"wd:ID"[?($.@"wd:type" == "Project_ID")][0] default "",
        TASK_NUMBER: line.wd:Worktags_Reference.*"wd:ID"[?($.@"wd:type" == "Task_Number")][0] default "",
        AWARD_NUMBER: line.wd:Worktags_Reference.*"wd:ID"[?($.@"wd:type" == "Award_Number")][0] default "",
        MAJOR_CATEGORY: line.wd:Spend_Category_Reference.*"wd:ID"[?($.@"wd:type" == "Spend_Category_ID")][0] default "",
        MINOR_CATEGORY: line.wd:Spend_Category_Reference.*"wd:ID"[?($.@"wd:type" == "Minor_Spend_Category")][0] default "",
        GL_DATE: if (currentDate as Date >= line.wd:Start_Date as Date and currentDate as Date <= line.wd:End_Date as Date)
                    currentDate
                 else if (currentDate as Date < line.wd:Start_Date as Date)
                    line.wd:Start_Date
                 else
                    line.wd:End_Date,
        EXPENDITURE_ITEM_DATE: if (requisition.wd:Requisition_data.wd:Requisition_Type_Reference.*"wd:ID"[?($.@"wd:type" == "Requisition_Type_Reference_ID")][0] contains "Goods")
                                requisition.wd:Requisition_data.wd:Requested_Delivery_Date default null
                              else
                                line.wd:End_Date,
        PR_LINE_REF_ID: line.wd:Requisition_Line_Reference_ID default "",
        PR_LINE_NUM: index + 1,
        TRANSACTION_TYPE: "Create",
        DELIVER_TO_LOCATION_ID: requisition.wd:Requisition_data.wd:Deliver-To_Location_Reference.*"wd:ID"[?($.@"wd:type" == "Location_ID")][0] default "",
        DELIVER_TO_REQUESTOR_ID: getWorkerID(
            requisition.wd:Requisition_data.wd:Requester_Reference,
            requisition.wd:Requisition_data.wd:Requisition_Sourcing_Buyer_Reference
        ),
        SUGGESTED_VENDOR_ID: line.wd:Supplier_Reference.*"wd:ID"[?($.@"wd:type" == "Supplier_ID")][0] default "",
        SUGGESTED_VENDOR_SITE_ID: line.wd:Supplier_Reference.*"wd:ID"[?($.@"wd:type" == "Supplier_Connection_ID")][0] default "",
        REFERENCE_NUM: line.wd:Unit_Reference default "",
        JUSTIFICATION: if (line.wd:Emergency_Event != null) "Emergency Event" else "",
        PROJECT_ACCOUNTING_CONTEXT: "Y",
        PFI_LINE_REF: if (requisition.wd:Requisition_data.wd:Requisition_Type_Reference.*"wd:ID"[?($.@"wd:type" == "Requisition_Type_Reference_ID")][0] contains "Goods")
                        line.wd:PFI_Line_Reference default ""
                      else null,
        SHIPPING_METHOD_REF: if (requisition.wd:Requisition_data.wd:Requisition_Type_Reference.*"wd:ID"[?($.@"wd:type" == "Requisition_Type_Reference_ID")][0] contains "Goods")
                                requisition.wd:Requisition_data.wd:Shipping_Method_Reference_ID default ""
                             else null,
        
        // Line distributions
        DISTRIBUTIONS: line.wd:Requisition_Line_Distribution map ((dist) -> {
            DIST_QUANTITY: if (getLineType(line) == "Amount Based Services") 
                                null
                           else if (getLineType(line) == "Zero Based Services")
                                1
                           else
                                (dist.wd:Extended_Amount as Number / line.wd:Extended_Amount as Number) * (getQuantity(line) as Number,
            DIST_CURRENCY_AMOUNT: dist.wd:Extended_Amount as Number,
            PROJECT_NUMBER: dist.wd:Worktags_Reference.*"wd:ID"[?($.@"wd:type" == "Project_ID")][0] default "",
            TASK_NUMBER: dist.wd:Task_Number default "",
            AWARD_NUMBER: dist.wd:Award_Number default "",
            EXPENDITURE_TYPE: dist.wd:Expenditure_Type default "",
            EXPENDITURE_ITEM_DATE: if (requisition.wd:Requisition_data.wd:Requisition_Type_Reference.*"wd:ID"[?($.@"wd:type" == "Requisition_Type_Reference_ID")][0] contains "Goods")
                                    requisition.wd:Requisition_data.wd:Requested_Delivery_Date default null
                                  else
                                    line.wd:End_Date,
            PR_DIST_REF_ID: dist.wd:Split_Line_Reference_ID default (line.wd:Requisition_Line_Reference_ID default ""),
            GL_DATE: if (currentDate as Date >= line.wd:Start_Date as Date and currentDate as Date <= line.wd:End_Date as Date)
                        currentDate
                    else if (currentDate as Date < line.wd:Start_Date as Date)
                        line.wd:Start_Date
                    else
                        line.wd:End_Date
        })
    })
})

Error:Invalid input ':', expected ')' for the if expression. (line 14, column 16):


14|     if (line.wd:Extended_Amount as Number != 0) 
                   ^
Location:
main (line: 14, column:16)

Fix this error and remove the comments