docs: private void dispatchOnSameActivity(PvmExecutionImpl targetScope, PvmExecutionImpl replacedBy,
                                        Map<PvmExecutionImpl, String> activityIds,
                                        Map<PvmExecutionImpl, String> activityInstanceIds,
                                        DelayedVariableEvent delayedVariableEvent) {
      //check if the target scope has the same activity id and activity instance id
      //since the dispatching was started
      String currentActivityInstanceId = getActivityInstanceId(targetScope);
      String currentActivityId = targetScope.getActivityId();
  
      final String lastActivityInstanceId = activityInstanceIds.get(targetScope);
      final String lastActivityId = activityIds.get(targetScope);
  
      boolean onSameAct = isOnSameActivity(lastActivityInstanceId, lastActivityId, currentActivityInstanceId, currentActivityId);
  
      //If not we have to check the replace pointer,
      //which was set if a concurrent execution was created during the dispatching.
      if (targetScope != replacedBy && !onSameAct) {
        currentActivityInstanceId = getActivityInstanceId(replacedBy);
        currentActivityId = replacedBy.getActivityId();
        onSameAct = isOnSameActivity(lastActivityInstanceId, lastActivityId, currentActivityInstanceId, currentActivityId);
      }
  
      //dispatching
      if (onSameAct && isOnDispatchableState(targetScope)) {
        targetScope.dispatchEvent(delayedVariableEvent.getEvent());
      }
    }