Entity List Validations on Entity Reservation

The following validations must be implemented on the task's entity list when the task reserves the entities:

  • Verify that the entities are not reserved by another user in the environment.
  • Verify that the total number of reserved entities in the environment does not exceeds the user's permissions in the environment. For example, if the user is allowed to reserved up to 70 entities in ST1 and there are 50 entities that are already reserved for the user in ST1, the user can reserve up to an additional 20 entities in ST1. Therefore, the number of entities in the task execution cannot exceed 20 entities.

Verify that the Entities are Available For Reservation

API URL

/validateReservedEntitiesList

HTTP Method

POST

API Category

TDM_ReserveEntities

API Description

Validate each input entity ID if it is reserved for another user in the input environment. If the entity is reserved for another user in the environment, return a failure on the entity.

API Input

The request body contains the following attributes:

Param Name

Mandatory

Description

beID

Yes

Populated with the unique identifier (be_id field) of the task's Business Entity

envID

Yes

Populated with the task's environment_id (target environment).

listOfEntities

Yes

Populated with the task's entity list. Note that if the entitieslist attribute is set in the overridden execution parameters, populate the listOfEntities with the entities of the entitieslist. Else, get the selection_param_value task's attribute if the task's selection_method is 'L' (entity list).

API Input Example

{
  "beID": "1",
  "envID": "2",
  "listOfEntities": [
    {
      "target_entity_id": "1"
    },
    {
      "target_entity_id": "3"
    },
    {
      "target_entity_id": "4"
    }
  ]
}

API Output

The API returns the list of entities that are reserved in the environment by another user and therefore cannot be reserved by the user.

API Output Example

{
  "result": {
    "listOfEntities": [
      {
        "start_datetime": "2022-01-23 01:00:00.000",
        "end_datetime": "2022-02-10 00:00:00.000",
        "entity_id": "3",
        "reserve_owner": "admin"
      },
      {
        "start_datetime": "2022-02-06 01:00:00.000",
        "end_datetime": "2022-02-16 01:00:00.000",
        "entity_id": "4",
        "reserve_owner": "taha"
      }
    ]
  },
  "errorCode": "SUCCESS",
  "message": null
}

Validate that the Total Number of Entities Reserved by the User

API URL

/validatenoofreserved

HTTP Method

GET

API Category

TDM_ReserveEntities

API Description

A tester user can reserve a limited number of entities per Business Entity and environment. The maximum number of reserved entities is set in the Environment permission set attached to the user. Admin and environment owners can reserve an unlimited number of entities in the environment. The API performs the following validation if the user is not an admin user and is not the owner of the environment:

  • Get the Write permission set attached to the user. If the user does not have a Write permission set in the environment, an exception is thrown by the API.

  • Sum the input number of entities with the number of entities that are already reserved by the user in the environment (if they exist). Validate that the the total number of reserved entities does not exceed the user's permissions.

    Example:

    • The user can reserve up to 70 customers on ST1.

    • The user already has 40 customers reserved on ST1.

    • The user asks to reserve 35 entities in the task:

    • 40+35 = 75.

    • The API returns an error since the user cannot exceed a total of 70 customers (40 + 30) in the task.

API Input

API Input Example

  http://localhost:3213/api/validatenoofreserved?noOfEntities=10&envName=ENV1&beName=Customer

API Output Examples

{
  "result": {
   },
  "errorCode": "SUCCESS",
  "message": null
}
{
  "result": {
   },
  "errorCode": "FAILED",
  "message": "The number of entities to be reserved exceeds the number of entities allowed for the user"
}
Param Name

Mandatory

Description

noOfEntities

Yes

Populated by the number of entities, processed by the task.

envName

Yes

Populated by the target environment's name.

beName

Yes

Populated by the task's Business Entity name. For example, "Customer".

Entity List Validations on Entity Reservation

The following validations must be implemented on the task's entity list when the task reserves the entities:

  • Verify that the entities are not reserved by another user in the environment.
  • Verify that the total number of reserved entities in the environment does not exceeds the user's permissions in the environment. For example, if the user is allowed to reserved up to 70 entities in ST1 and there are 50 entities that are already reserved for the user in ST1, the user can reserve up to an additional 20 entities in ST1. Therefore, the number of entities in the task execution cannot exceed 20 entities.

Verify that the Entities are Available For Reservation

API URL

/validateReservedEntitiesList

HTTP Method

POST

API Category

TDM_ReserveEntities

API Description

Validate each input entity ID if it is reserved for another user in the input environment. If the entity is reserved for another user in the environment, return a failure on the entity.

API Input

The request body contains the following attributes:

Param Name

Mandatory

Description

beID

Yes

Populated with the unique identifier (be_id field) of the task's Business Entity

envID

Yes

Populated with the task's environment_id (target environment).

listOfEntities

Yes

Populated with the task's entity list. Note that if the entitieslist attribute is set in the overridden execution parameters, populate the listOfEntities with the entities of the entitieslist. Else, get the selection_param_value task's attribute if the task's selection_method is 'L' (entity list).

API Input Example

{
  "beID": "1",
  "envID": "2",
  "listOfEntities": [
    {
      "target_entity_id": "1"
    },
    {
      "target_entity_id": "3"
    },
    {
      "target_entity_id": "4"
    }
  ]
}

API Output

The API returns the list of entities that are reserved in the environment by another user and therefore cannot be reserved by the user.

API Output Example

{
  "result": {
    "listOfEntities": [
      {
        "start_datetime": "2022-01-23 01:00:00.000",
        "end_datetime": "2022-02-10 00:00:00.000",
        "entity_id": "3",
        "reserve_owner": "admin"
      },
      {
        "start_datetime": "2022-02-06 01:00:00.000",
        "end_datetime": "2022-02-16 01:00:00.000",
        "entity_id": "4",
        "reserve_owner": "taha"
      }
    ]
  },
  "errorCode": "SUCCESS",
  "message": null
}

Validate that the Total Number of Entities Reserved by the User

API URL

/validatenoofreserved

HTTP Method

GET

API Category

TDM_ReserveEntities

API Description

A tester user can reserve a limited number of entities per Business Entity and environment. The maximum number of reserved entities is set in the Environment permission set attached to the user. Admin and environment owners can reserve an unlimited number of entities in the environment. The API performs the following validation if the user is not an admin user and is not the owner of the environment:

  • Get the Write permission set attached to the user. If the user does not have a Write permission set in the environment, an exception is thrown by the API.

  • Sum the input number of entities with the number of entities that are already reserved by the user in the environment (if they exist). Validate that the the total number of reserved entities does not exceed the user's permissions.

    Example:

    • The user can reserve up to 70 customers on ST1.

    • The user already has 40 customers reserved on ST1.

    • The user asks to reserve 35 entities in the task:

    • 40+35 = 75.

    • The API returns an error since the user cannot exceed a total of 70 customers (40 + 30) in the task.

API Input

API Input Example

  http://localhost:3213/api/validatenoofreserved?noOfEntities=10&envName=ENV1&beName=Customer

API Output Examples

{
  "result": {
   },
  "errorCode": "SUCCESS",
  "message": null
}
{
  "result": {
   },
  "errorCode": "FAILED",
  "message": "The number of entities to be reserved exceeds the number of entities allowed for the user"
}
Param Name

Mandatory

Description

noOfEntities

Yes

Populated by the number of entities, processed by the task.

envName

Yes

Populated by the target environment's name.

beName

Yes

Populated by the task's Business Entity name. For example, "Customer".