views – How do I create a block that shows content related through a second level relationship?

I have three node content types, called ‘pathway’, ‘page’ and ‘relation’.
The relation nodes I use to connect pages to the pathways.
The relation nodes have reference fields: endpoint A and endpoint B.
I want to create a views block of all relation nodes, which use endpoint A reference (pathway) to referene the same patway as the relation that references the currently viewed node using endpoint B.

The purpose of the block is to show all relations of the pathway on every page that is referenced by one of these relations.

enter image description here