예제 #1
0
  public void notifyCompletion() {
    // all the children are completed.
    ScopeInstance parent = getParent();

    if (parent.getState().equals(ActiveState.EVENTS_PENDING) && !parent.hasPendingEvents()) {
      // notify completion to parent if its waiting for events
      parent.completed();
    }
  }
예제 #2
0
 /**
  * Returns a VariableID for the given name that is valid in the given ScopeInstance (or any parent
  * ScopeInstance - recursively).
  */
 private VariableID<?> getVarIDMessaged(
     ScopeInstance scopeInst, String varName, ScopeInstance messageScope) {
   if (scopeInst == null) {
     throw new IllegalArgumentException(
         "Cannot get VariableID "
             + varName
             + " for "
             + messageScope.getLegalScope().getName()
             + " scope");
   }
   VariableID.checkLegalVarName(varName);
   FormatManager<?> formatManager = variableDefs.get(varName, scopeInst.getLegalScope());
   if (formatManager != null) {
     return new VariableID<>(scopeInst, formatManager, varName);
   }
   // Recursively check parent scope
   return getVarIDMessaged(scopeInst.getParentScope(), varName, messageScope);
 }