I think this might be possible in Java, just not directly in a microflow. The documentation for core.retrieveByPath says:
retrieveByPath(IContext context, IMendixObject mxObject, String path, boolean isSelfAssociationChild)
Retrieves objects using the given object and path.
I haven't tested it, but that boolean would seem to indicate that you could "reverse" the self-association while retrieveing.
Pranay,
Please see this article for a walk through on how to do this. While it is for Mendix 5 - this approach has not changed in version 6.
Mike
What I did in the same situation was create a dummy entity instead of a self-reference.
See also this forum post :
What I did now is, I added a second, dummy, entity. This dummy entity has a 1..* relation AND a 1..1 relation to the main entity. Basically, this is the same as a direct recursive relation, but now I have 2 relations to the main entity