/**
   * This method creates a user
   *
   * @param EntityManager entityManager
   * @param userDetailBO userDetailBO
   * @param ScreenResponseMessageBO messages
   * @return boolean isProcessSuccess;
   */
  public boolean createUser(EntityManager entityManager, UserDetailBO userDetailBO) {
    final String METHOD_NAME =
        "createUser(EntityManager entityManager, UserDetailBO userDetailBO, ScreenResponseMessageBO messages)";
    logger.entering(CLASS_NAME, METHOD_NAME);

    boolean isProcessSuccess = false;
    UserTable userTable = UserObjectPreparationHelper.convertUserDetailBOToUserEntity(userDetailBO);
    boolean flag = false;
    flag = CheckIfUserExistsTask.process(entityManager, userDetailBO.getUserEmailId());
    if (flag == true) {
      logger.debug("Duplicate user creation");
    } else {
      CreateUserTask.process(entityManager, userTable);
      isProcessSuccess = true;
    }
    logger.exiting(CLASS_NAME, METHOD_NAME);
    return isProcessSuccess;
  }