Hi @Rwjgoedhart,
I think this is slightly similar to what Graeme raised in this post.
You have a hierarchy select that returns ‘x’ rows and you want the <insert /> (or perform) to be actioned on each return.
Only way I have been able to do what you ask above (and what Graeme refers to in his question) is to do that outside of the application. Happy to send through what we do as an example but its not entirely inside the application using Business Rules to trigger the Select and Action.
Regards
Ady
@Rwjgoedhart
Another option if you are wanting to use a Business Rule would be to use the <perform_exec_db_edit>.
If this is the final step and you don’t want another action of the back of the insert this would be a candidate.
Essentially a SQL Insert off the back of getting the data you want to insert from a SQL select as opposed to a XML Hierarchy Select.
Ady
Adrian,
Thank you. That’s what I was worried about.. we currently use perform_exec_db_edit, and really hoped to switch to a cleaner solution.
Hi @Rwjgoedhart ,
another option could be a combination of update and insert.
Use an user_def YOR field on the person. If a new place has been created, the hierarchial select will identify the person which needs to be updated.
Then create an insert for every person which has been updated. This can also be done over night via a scheduled process.
To make it very clear, you can create another update at the end based on the hierarchial select to clear the YOR field.
I did this very often due the mass insert limitation.
Hope this helps.
Best regards,
Sven
Hi,
Unfortunately the baseline mass_update does not support inserts indeed.
Its always a bit tricky to get around this through configuration.
For several customers we are using a “generic” custom MPM for supporting mass_insert of which you can see an example below.
<perform_mass_insert>
<parameters>
<select>
<hierarchy_select>
<primary_table>person</primary_table>
<attrs>
<attr>person.person_id</attr>
</attrs>
<from>
<table>person</table>
</from>
<where />
</hierarchy_select>
</select>
<update>
<update_person_event>
<person_event>
<person_id xpath="person_id"></person_id>
<event_type>NOTIFY</event_type>
<insert_update is_initialized="False" />
</person_event>
</update_person_event>
</update>
</parameters>
</perform_mass_insert>
The MPM has two segment, a select and update.
For each record returned by the select it will execute the update segment.
The update segment can include any valid fsm xml api, so an insert \ update or possibly a mpm.
However, you’ll need this particular customization installed in order to use the mpm above.
I will ask RnD if they can include this in baseline, but until that time it can be solved easiest using this customization.
Best Regards,
Ruben
Hi @Rwjgoedhart ,
another option could be a combination of update and insert.
Use an user_def YOR field on the person. If a new place has been created, the hierarchial select will identify the person which needs to be updated.
Then create an insert for every person which has been updated. This can also be done over night via a scheduled process.
To make it very clear, you can create another update at the end based on the hierarchial select to clear the YOR field.
I did this very often due the mass insert limitation.
Hope this helps.
Best regards,
Sven
I have been noticing some inconsistent behaviour with this method at a client on 6u7. Code that was working in 6u3 and 6u5, is now intermittent.
Hi,
Unfortunately the baseline mass_update does not support inserts indeed.
Its always a bit tricky to get around this through configuration.
For several customers we are using a “generic” custom MPM for supporting mass_insert of which you can see an example below.
<perform_mass_insert>
<parameters>
<select>
<hierarchy_select>
<primary_table>person</primary_table>
<attrs>
<attr>person.person_id</attr>
</attrs>
<from>
<table>person</table>
</from>
<where />
</hierarchy_select>
</select>
<update>
<update_person_event>
<person_event>
<person_id xpath="person_id"></person_id>
<event_type>NOTIFY</event_type>
<insert_update is_initialized="False" />
</person_event>
</update_person_event>
</update>
</parameters>
</perform_mass_insert>
The MPM has two segment, a select and update.
For each record returned by the select it will execute the update segment.
The update segment can include any valid fsm xml api, so an insert \ update or possibly a mpm.
However, you’ll need this particular customization installed in order to use the mpm above.
I will ask RnD if they can include this in baseline, but until that time it can be solved easiest using this customization.
Best Regards,
Ruben
Hi Ruben
I think this is an excellent candidate for inclusion into the baseline product. This functionality comes up time and time again at clients.
Thanks,
Kev