code: public boolean isWithinActiveScope(final QName unitId) {
  
          final Node<Scope> self = dialog.getScopeModel().findNode(
                  dialog.findUnit(unitId).getScopeId()
          );
          final Scope scopeOfUnit = self.getData();
          int parentScopeId = getParentScope(unitId).getId();
  
          Scope activeScope = activeChildMapping.get(parentScopeId);
          boolean selfIsActive = activeScope != null && activeScope.equals(scopeOfUnit);
  
          if(selfIsActive) // only verify parents if necessary
          {
              LinkedList<Scope> parentScopes = new LinkedList<Scope>();
              getParentScopes(self, parentScopes);
  
              boolean inActiveParent = false;
              for(Scope parent : parentScopes)
              {
                  if(!parent.isActive())
                  {
                      inActiveParent = true;
                      break;
                  }
              }
              return inActiveParent;
          }
  
          return selfIsActive;
      }
docs: Is within active scope when itself and all it's parent scopes are active as well.
  This is necessary to ensure access to statements from parent scopes.
  
  @param unitId
  @return