docs: protected ScopeImpl getScopeActivity() {
      ScopeImpl scope = null;
      // this if condition is important during process instance startup
      // where the activity of the process instance execution may not be aligned
      // with the execution tree
      if (isProcessInstanceExecution()) {
        scope = getProcessDefinition();
      } else {
        scope = getActivity();
      }
      return scope;
    }