I have this problem with implementing a business case. The case I have is as follows.
- In task_steps I have filled in a quantity (lets call it x) in user_def_num1 for step_id =66
- This task_steps record with a quantity needs to be processed by the business rules and add a non_part_usage record.
- My business rule needs to output the quantity if it is higher then 25 and then create the non_part_usage record with a quantity of x - 25.
I am trying to do this with an XML business rule, but I am aware that I need to use some expression. I only do not know how to do that. This is my code which needs to insert the record. As you can see I fetch the quantity with an xpath_node from an hierarchy_select result called ‘result01’.
Without the expression stuff it gives me the quantity, but I need to subtract 25 from this value.
<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="//task_steps_hierarchy_select_result[@result_name='result01']/task_steps/user_def_num1" - 25]></quantity>
<insert is_initialized="False" />
</non_part_usage>
</update_non_part_usage>
This is how my business rule screen looks like now.
Best answer by josdepijper
View original