Retrieve given object and lower objects of self-reference

4
In the example below is it possible to retrieve all the 'Microflow' objects that have a relation with a given 'Case' object or one of it's sub 'Case' objects? Which xpath constraint should I use in my retrieve activity?
asked
3 answers
7

That's isn't possible with XPath. Because the you're database model is recursive (each Case can have more sub cases and each sub case can also have more sub cases) you have to do some extra steps.

Because your model is recursive you've also to create a recursive microflow. In you're case it's something like the following microflow (not tested, but this idea will work for you). The clou is that you've to call 'your self' (the first activity in the loop) to retrieve n deep data.

Microflow

answered
2

You can use the following Xpath constraints to retrieve the microflow objects:

[Module.MicroflowCase = $InputCaseObject or Module.MicroflowCase/Module.Case/Module.Case_Case = $InputCaseObject]

However, it's not possible to retrieve objects N deep by using Xpath.

answered
2

To retrieve all the 'Microflow' objects which have a relation with a given 'Case' object OR one of it's DIRECT associated sub 'Case' objects, use the following constraint:

[Module.MicroflowCase = $InputCaseObject or Module.MicroflowCase/Module.Case/Module.Case_Case = $InputCaseObject]

However, to retrieve 'Microflow' objects which have a relation with one of it's sub 'Case' objects and such a sub 'Case' object can be very deep in the Case/Case_Case tree, then you cannot query that directly with XPath. Use a microflow and check with loops if the given 'Case' object has childs, and if these childs also have childs and so on. Check for each child if they also have an association with 'Microflow' objects.

answered