/**
   * Create a getter for the specified process parent business data and a property for the parent
   * process id (if it has parent and if the parent has business data)
   *
   * @param process
   * @param propertiesToKept return a set of properties to kept
   */
  private Set<DMObject> createPropertiesForParentProcessBusinessData(FlexoProcess process) {
    Set<DMObject> propertiesToKept = new HashSet<DMObject>();
    if (process.getParentProcess() != null
        && process.getParentProcess().getBusinessDataType() != null) {
      propertiesToKept.add(
          createPropertyForProcessKey(
              getParentProcessBusinessDataIdKey(process.getParentProcess()), Integer.class));

      DMProcessBusinessDataAccessingMethod foundMethod =
          DMProcessBusinessDataAccessingMethod.getProcessBusinessDataAccessingMethod(
              this, process.getParentProcess(), CodeType.AUTOGENERATEDBUSINESSDATA_PARENT);

      if (foundMethod == null) {
        foundMethod =
            new DMProcessBusinessDataAccessingMethod(
                this, process.getParentProcess(), CodeType.AUTOGENERATEDBUSINESSDATA_PARENT);
      } else {
        foundMethod.updateProcess(process.getParentProcess());
      }

      propertiesToKept.add(foundMethod);
    }

    return propertiesToKept;
  }
  /**
   * Create a getter for the specified process single process children business data and a property
   * for the children process id (for each child process with a business data) <br>
   * Need to be called when the children process business data are set !
   *
   * @param process
   * @param propertiesToKept return a set of properties to kept
   */
  public Set<DMObject> createPropertiesForChildrenProcessBusinessData(FlexoProcess process) {
    Set<DMObject> propertiesToKept = new HashSet<DMObject>();
    for (FlexoProcess childProcess : process.getSubProcesses()) {
      if (childProcess.getBusinessDataType() != null && childProcess.isSingleSubProcess()) {
        DMProcessBusinessDataAccessingMethod foundMethod =
            DMProcessBusinessDataAccessingMethod.getProcessBusinessDataAccessingMethod(
                this, childProcess, CodeType.AUTOGENERATEDBUSINESSDATA_CHILD);

        if (foundMethod == null) {
          foundMethod =
              new DMProcessBusinessDataAccessingMethod(
                  this, childProcess, CodeType.AUTOGENERATEDBUSINESSDATA_CHILD);
        } else {
          foundMethod.updateProcess(childProcess);
        }

        propertiesToKept.add(foundMethod);
      }
    }

    return propertiesToKept;
  }