Skip to content

/AWS1/IF_TBD=>BATCHGETTASK()

About BatchGetTask

Retrieves multiple tasks in a single request. This is a batch version of the GetTask API.

The result of getting each task is reported individually in the response. Because the batch request can result in a combination of successful and unsuccessful actions, you should check for batch errors even when the call returns an HTTP status code of 200.

Method Signature

METHODS /AWS1/IF_TBD~BATCHGETTASK
  IMPORTING
    !IT_IDENTIFIERS TYPE /AWS1/CL_TBDBATCHGETTASKID=>TT_BATCHGETTASKIDENTIFIERS OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_tbdbatchgettaskrsp
  RAISING
    /AWS1/CX_TBDACCESSDENIEDEX
    /AWS1/CX_TBDINTERNALSERVERER00
    /AWS1/CX_TBDTHROTTLINGEX
    /AWS1/CX_TBDVALIDATIONEX
    /AWS1/CX_TBDCLIENTEXC
    /AWS1/CX_TBDSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

it_identifiers TYPE /AWS1/CL_TBDBATCHGETTASKID=>TT_BATCHGETTASKIDENTIFIERS TT_BATCHGETTASKIDENTIFIERS

The list of task identifiers to retrieve. You can specify up to 100 identifiers per request.

RETURNING

oo_output TYPE REF TO /aws1/cl_tbdbatchgettaskrsp /AWS1/CL_TBDBATCHGETTASKRSP

Examples

Syntax Example

This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.

DATA(lo_result) = lo_client->batchgettask(
  it_identifiers = VALUE /aws1/cl_tbdbatchgettaskid=>tt_batchgettaskidentifiers(
    (
      new /aws1/cl_tbdbatchgettaskid(
        iv_farmid = |string|
        iv_jobid = |string|
        iv_queueid = |string|
        iv_stepid = |string|
        iv_taskid = |string|
      )
    )
  )
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  LOOP AT lo_result->get_tasks( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_farmid = lo_row_1->get_farmid( ).
      lv_queueid = lo_row_1->get_queueid( ).
      lv_jobid = lo_row_1->get_jobid( ).
      lv_stepid = lo_row_1->get_stepid( ).
      lv_taskid = lo_row_1->get_taskid( ).
      lv_createdat = lo_row_1->get_createdat( ).
      lv_createdby = lo_row_1->get_createdby( ).
      lv_taskrunstatus = lo_row_1->get_runstatus( ).
      lv_tasktargetrunstatus = lo_row_1->get_targetrunstatus( ).
      lv_taskretrycount = lo_row_1->get_failureretrycount( ).
      lv_startedat = lo_row_1->get_startedat( ).
      lv_endedat = lo_row_1->get_endedat( ).
      lv_updatedat = lo_row_1->get_updatedat( ).
      lv_updatedby = lo_row_1->get_updatedby( ).
      lv_sessionactionid = lo_row_1->get_latestsessionactionid( ).
      LOOP AT lo_row_1->get_parameters( ) into ls_row_2.
        lv_key = ls_row_2-key.
        lo_value = ls_row_2-value.
        IF lo_value IS NOT INITIAL.
          lv_intstring = lo_value->get_int( ).
          lv_floatstring = lo_value->get_float( ).
          lv_parameterstring = lo_value->get_string( ).
          lv_pathstring = lo_value->get_path( ).
          lv_string = lo_value->get_chunkint( ).
        ENDIF.
      ENDLOOP.
    ENDIF.
  ENDLOOP.
  LOOP AT lo_result->get_errors( ) into lo_row_3.
    lo_row_4 = lo_row_3.
    IF lo_row_4 IS NOT INITIAL.
      lv_farmid = lo_row_4->get_farmid( ).
      lv_queueid = lo_row_4->get_queueid( ).
      lv_jobid = lo_row_4->get_jobid( ).
      lv_stepid = lo_row_4->get_stepid( ).
      lv_taskid = lo_row_4->get_taskid( ).
      lv_batchgettaskerrorcode = lo_row_4->get_code( ).
      lv_string = lo_row_4->get_message( ).
    ENDIF.
  ENDLOOP.
ENDIF.

Get multiple tasks in a single request

Get multiple tasks in a single request

DATA(lo_result) = lo_client->batchgettask(
  it_identifiers = VALUE /aws1/cl_tbdbatchgettaskid=>tt_batchgettaskidentifiers(
    (
      new /aws1/cl_tbdbatchgettaskid(
        iv_farmid = |farm-1234567890abcdef1234567890abcdef|
        iv_jobid = |job-1234567890abcdef1234567890abcdef|
        iv_queueid = |queue-1234567890abcdef1234567890abcdef|
        iv_stepid = |step-1234567890abcdef1234567890abcdef|
        iv_taskid = |task-1234567890abcdef1234567890abcdef-0|
      )
    )
    (
      new /aws1/cl_tbdbatchgettaskid(
        iv_farmid = |farm-1234567890abcdef1234567890abcdef|
        iv_jobid = |job-1234567890abcdef1234567890abcdef|
        iv_queueid = |queue-1234567890abcdef1234567890abcdef|
        iv_stepid = |step-1234567890abcdef1234567890abcdef|
        iv_taskid = |task-1234567890abcdef1234567890abcdef-1|
      )
    )
  )
).