code: protected void createVariableLocal(String variableName, Object value, ExecutionEntity sourceActivityExecution) {
      ensureVariableInstancesInitialized();
  
      if (variableInstances.containsKey(variableName)) {
        throw new ActivitiException("variable '" + variableName + "' already exists. Use setVariableLocal if you want to overwrite the value");
      }
  
      createVariableInstance(variableName, value, sourceActivityExecution);
    }
docs: only called when a new variable is created on this variable scope. This method is also responsible for propagating the creation of this variable to the history.