...
All operators that do not reside within a loop contain the default StreamScope.
The two main operations of a StreamScope are nest() and unnest()
Every invocation of the DataStream iterate operation generates a new StreamScope, nested on its outer scope.
The level of each StreamScope (getLevel()) is the number of its outer scopes. Fig.2 shows the assigned scope levels on each operator in an example graph.
StreamScopes can be compared topologically (isInnerOf(..), isOuterOf()).
Operators who reside in the exact same loop should have equal StreamScope
All outer scopes of a StreamScope can be retrieved
(e.g. scope.getContextForLevel(scope.getLevel()-2), or scope.unest().unest())
II - Cyclic Flow Control and Physical Implementation of Feedback Channels
...