I have a quite complicated thing to implement and I am searching some input regarding the how-to.
UseCase: Certain functions have to be executed on all child tables/records related to they're parent tables/records.
UPDATE: The use case bases on Dynamics CRM and must implement a cascading assignment of certain records to other teams/users. So one assings the root record to a new team. this mechanism then must cascade this assignment to all records related to the root record like configured in the XML. This assignmend will be done by using the CRM SDK. The whole thing bases on a proprietary datamodel of Microsoft Dynamics CRM.
Se the printscreen for this configuration:
the important part is the part where the fetch condition is defined. The attribute "value" defines a placeholder which will be replaced by the ID or ID's coming from the parent table/record(s). this usually is a list of IDs which then have to be foreach'ed which again created a set of ID's for the next child records. so finally I need to store these ID's and use them for the next cascading.
EDIT: In theory the cascading entities can be nested "endlessly"
Anybody has an idea how to achieve this in a more or less efficient way? maybe with some sample code?
Any help is really appreciated.
Looks like you've defined the problem well enough to start coding. Once you get have some code to share we may be better able to help.
However, before you start coding, have you reviewed the configurable cascading functionality on the relationships? Once you set the relationship type to Configurable Cascading, you have options for each of the different areas. The out-of-box cascading of Assign may be able to do some or all of what you're looking to do: