Hi,
I am creating an xml message to update (child) tasks which have different task-status and owner(person_id) from their (visit)task.
I created a custom view to get those tasks.
In this query:
task_id = visit-task
child_task_id = task_id
<!-- =========================================================== -->
<!-- update task owner and task status from visit when visit-owner is not empty -->
<!-- ======================================================== -->
<perform_batch>
<sequential_dependent>
<hierarchy_select result_name="select_result1">
<primary_table>task</primary_table>
<attrs>
<attr>task.task_id</attr>
<attr>task.person_id</attr>
<attr>task.task_status</attr>
<attr>task.team_id</attr>
<attr>c_visit_task_owner_diff_view.task_id</attr>
<attr>c_visit_task_owner_diff_view.visit_owner</attr>
<attr>c_visit_task_owner_diff_view.visit_task_status</attr>
<attr>c_visit_task_owner_diff_view.visit_team_id</attr>
</attrs>
<from>
<table>task</table>
<table>c_visit_task_owner_diff_view</table>
</from>
<where>
<data_constraint>
<constraint>
<left_operand>c_visit_task_owner_diff_view.visit_owner</left_operand>
<operator>not_null</operator>
</constraint>
</data_constraint>
<join_constraint>
<constraint>
<left_operand>task.task_id</left_operand>
<operator>equi</operator>
<right_operand>c_visit_task_owner_diff_view.child_task_id</right_operand>
</constraint>
</join_constraint>
</where>
</hierarchy_select>
<mass_update_task>
<hierarchy_select result_name="select_result11">
<primary_table>task</primary_table>
<attrs>
<attr>task.task_id</attr>
<attr>task.person_id</attr>
<attr>task.task_status</attr>
<attr>task.team_id</attr>
<attr>c_visit_task_owner_diff_view.task_id</attr>
<attr>c_visit_task_owner_diff_view.visit_owner</attr>
<attr>c_visit_task_owner_diff_view.visit_task_status</attr>
<attr>c_visit_task_owner_diff_view.visit_team_id</attr>
</attrs>
<from>
<table>task</table>
<table>c_visit_task_owner_diff_view</table>
</from>
<where>
<data_constraint>
<constraint>
<left_operand>task.task_id</left_operand>
<operator>eq</operator>
<right_operand xpath_node="//task_hierarchy_select_resultr@result_name='select_result1']/task/task_id"/>
</constraint>
<constraint>
<left_operand>c_visit_task_owner_diff_view.visit_owner</left_operand>
<operator>not_null</operator>
</constraint>
</data_constraint>
<join_constraint>
<constraint>
<left_operand>task.task_id</left_operand>
<operator>equi</operator>
<right_operand>c_visit_task_owner_diff_view.child_task_id</right_operand>
</constraint>
</join_constraint>
</where>
</hierarchy_select>
<task>
<task_id xpath_node="//task_hierarchy_select_result@result_name='select_result11']/task/task_id"/>
<person_id xpath_node="//task_hierarchy_select_resultt@result_name='select_result11']/task/c_visit_task_owner_diff_view/visit_owner"/>
<team_id xpath_node="//task_hierarchy_select_resultl@result_name='select_result11']/task/c_visit_task_owner_diff_view/visit_team_id"/>
<task_status xpath_node="//task_hierarchy_select_resultt@result_name='select_result11']/task/c_visit_task_owner_diff_view/visit_task_status"/>
<update/>
</task>
<transaction_size>100</transaction_size>
<synchronous>Y</synchronous>
</mass_update_task>
</sequential_dependent>
</perform_batch>
That message can update only the 1st row of those result.
How can I update all the results?
This post is only for IFS employees and partners. Could you please post it here? Thanks in advance.
Look forward to your feedback.
Cheers,
~Juni