This can be done via a perform_evaluate_expression which you have to add to you XML message.
<perform_evaluate_expression result_name="result03">
<parameters>
<table_name>task_steps</table_name>
<keys>
<key_item>
<column_name>task_step_id</column_name>
<column_value xpath_node="//task_steps_hierarchy_select_result[@result_name='result01']/task_steps/task_step_id" />
</key_item>
</keys>
<expression>task_steps.user_def_num1 - 25</expression>
</parameters>
</perform_evaluate_expression>
In this perform you have to pass in your value with “xpath_node=***” , *** is a string which is referring to another hierarchy select where your original value came from. This hierarchy selects of my original value looks like below code. You need it to specify the *** part of the xpath_node.
<hierarchy_select return_only_requested_attrs="true" max_rows="1" result_name="result01">
<primary_table>task_steps</primary_table>
<attrs>
<attr>task_steps.user_def_num1</attr>
<attr>task_steps.task_step_id</attr>
</attrs>
<from>
<table>task_steps</table>
</from>
<where>
<data_constraint>
<constraint>
<left_operand>task_steps.user_def2</left_operand>
<operator>eq</operator>
<right_operand>@request_id</right_operand>
</constraint>
<constraint>
<left_operand>task_steps.step_id</left_operand>
<operator>eq</operator>
<right_operand>66</right_operand>
</constraint>
<constraint>
<left_operand>task_steps.step_type</left_operand>
<operator>eq</operator>
<right_operand>PRODVAL</right_operand>
</constraint>
</data_constraint>
</where>
</hierarchy_select>
The result of the perform_evaluate_expression can then be passed to you update message, also via a xpath_node.
</update_non_part_usage>
<update_non_part_usage>
<non_part_usage>
<request_id>@request_id</request_id>
<task_id>@task_id</task_id>
<npu_id></npu_id>
<description>Auto Inserted by SEC CODE mapping BR</description>
<line_code>SEC4</line_code>
<line_code_type>SEC</line_code_type>
<quantity xpath_node="//perform_evaluate_expression_result[@result_name='result03']/response" />
<insert is_initialized="False" />
</non_part_usage>
</update_non_part_usage>
Then the last part where you have to be carefull with is that you perform all the xml code within a “perform_batch” and tell it how to run through the code with a tag.
<perform_batch>
// Choose one of beneath methods. //
<sequential_dependent/>
<sequential_independent/>
<sequential_dependent/>
<sequential_independent/>
//
This is what it means...
· sequential_independent—each message in the batch is executed one at a time, in order; if one message operation fails, the next is executed.
· sequential_dependent—each message in the batch is executed one at a time, in order; if one message operation fails, execution is stopped, and all transactions are rolled back.
· concurrent_independent—each message in the batch is executed at the same time; if any message operation fails, the rest continue to execute.
· concurrent_dependent—each message in the batch is executed at the same time; if any message operation fails, execution is stopped, and all transactions are rolled back.
//
// Here your xml code. //
</perform_batch>
The complete code for you a an example.
<perform_batch>
<sequential_dependent/>
<hierarchy_select return_only_requested_attrs="true" max_rows="1" result_name="result01">
<primary_table>task_steps</primary_table>
<attrs>
<attr>task_steps.user_def_num1</attr>
<attr>task_steps.task_step_id</attr>
</attrs>
<from>
<table>task_steps</table>
</from>
<where>
<data_constraint>
<constraint>
<left_operand>task_steps.user_def2</left_operand>
<operator>eq</operator>
<right_operand>@request_id</right_operand>
</constraint>
<constraint>
<left_operand>task_steps.step_id</left_operand>
<operator>eq</operator>
<right_operand>66</right_operand>
</constraint>
<constraint>
<left_operand>task_steps.step_type</left_operand>
<operator>eq</operator>
<right_operand>PRODVAL</right_operand>
</constraint>
</data_constraint>
</where>
</hierarchy_select>
<perform_evaluate_expression result_name="result03">
<parameters>
<table_name>task_steps</table_name>
<keys>
<key_item>
<column_name>task_step_id</column_name>
<column_value xpath_node="//task_steps_hierarchy_select_result[@result_name='result01']/task_steps/task_step_id" />
</key_item>
</keys>
<expression>task_steps.user_def_num1 - 25</expression>
</parameters>
</perform_evaluate_expression>
<update_non_part_usage>
<non_part_usage>
<request_id>@request_id</request_id>
<task_id>@task_id</task_id>
<npu_id></npu_id>
<description>Auto Inserted by SEC CODE mapping BR</description>
<line_code>SEC3</line_code>
<line_code_type>SEC</line_code_type>
<quantity>1</quantity>
<insert is_initialized="False" />
</non_part_usage>
</update_non_part_usage>
<update_non_part_usage>
<non_part_usage>
<request_id>@request_id</request_id>
<task_id>@task_id</task_id>
<npu_id></npu_id>
<description>Auto Inserted by SEC CODE mapping BR</description>
<line_code>SEC4</line_code>
<line_code_type>SEC</line_code_type>
<quantity xpath_node="//perform_evaluate_expression_result[@result_name='result03']/response" />
<insert is_initialized="False" />
</non_part_usage>
</update_non_part_usage>
</perform_batch>