Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Update with RestHandler does not support velocity

    Hi Isomorphic,

    same area as this one, but less important for me. In this request, the velocity variable is not replaced (11.1p_2018-04-11):

    employees.ds.xml addition:
    Code:
            <operationBinding operationType="update" operationId="updateSalary" allowMultiUpdate="true">
                <criteria _constructor="AdvancedCriteria" operator="and">
                    <criteria>
                        <Criterion fieldName="OrgUnit" operator="equals" value="$values.Salary" />
                        <Criterion fieldName="OrgUnit" operator="equals" value="$criteria.Name" />
                    </criteria>
                </criteria>
            </operationBinding>
    ARC request to http://127.0.0.1:8888/builtinds/sc/RESTHandler:
    Code:
    <request>
        <dataSource>employees</dataSource>
        <operationType>update</operationType>
        <operationId>updateSalary</operationId>
            <data>
                <Salary>1000</Salary>
                <_constructor>AdvancedCriteria</_constructor>
                 <operator>and</operator>
                 <criteria>
                     <criterion>
                         <fieldName>Name</fieldName>
                         <operator>equals</operator>
                         <value>Ralph Brogan</value>
                     </criterion>
                </criteria>
            </data>
    </request>
    Resulting SQL:
    Code:
    UPDATE employeeTable SET Salary=1000.0
    WHERE ((employeeTable.Name = 'Ralph Brogan' AND employeeTable.Name IS NOT NULL) --good
    AND ((employeeTable.OrgUnit = '$values.Salary' AND employeeTable.OrgUnit IS NOT NULL) [B]--bad[/B]
    AND (employeeTable.OrgUnit = '$criteria.Name' AND employeeTable.OrgUnit IS NOT NULL))) [B]--bad[/B]
    Best regards
    Blama

    #2
    See response on related thread - this request is not in a valid format.

    Comment

    Working...
    X