code: private boolean isOnDispatchableState(PvmExecutionImpl targetScope) {
      ActivityImpl targetActivity = targetScope.getActivity();
      return
        //if not leaf, activity id is null -> dispatchable
        targetScope.getActivityId() == null ||
          // if leaf and not scope -> dispatchable
          !targetActivity.isScope() ||
          // if leaf, scope and state in default -> dispatchable
          (targetScope.isInState(ActivityInstanceState.DEFAULT));
    }
docs: Checks if the given execution is on a dispatchable state.
  That means if the current activity is not a leaf in the activity tree OR
  it is a leaf but not a scope OR it is a leaf, a scope
  and the execution is in state DEFAULT, which means not in state
  Starting, Execute or Ending. For this states it is
  prohibited to trigger conditional events, otherwise unexpected behavior can appear.
  
  @return true if the execution is on a dispatchable state, false otherwise