Skip to content

/AWS1/IF_MWS=>LISTWORKFLOWRUNS()

About ListWorkflowRuns

Lists all runs for a specified workflow, with optional pagination and filtering support.

Method Signature

METHODS /AWS1/IF_MWS~LISTWORKFLOWRUNS
  IMPORTING
    !IV_MAXRESULTS TYPE /AWS1/MWSINTEGER OPTIONAL
    !IV_NEXTTOKEN TYPE /AWS1/MWSSTRING OPTIONAL
    !IV_WORKFLOWARN TYPE /AWS1/MWSWORKFLOWARN OPTIONAL
    !IV_WORKFLOWVERSION TYPE /AWS1/MWSVERSIONID OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_mwslstworkflowrunsrsp
  RAISING
    /AWS1/CX_MWSACCESSDENIEDEX
    /AWS1/CX_MWSINTERNALSERVEREX
    /AWS1/CX_MWSOPERATIONTIMEOUTEX
    /AWS1/CX_MWSTHROTTLINGEX
    /AWS1/CX_MWSVALIDATIONEX
    /AWS1/CX_MWSCLIENTEXC
    /AWS1/CX_MWSSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_workflowarn TYPE /AWS1/MWSWORKFLOWARN /AWS1/MWSWORKFLOWARN

The Amazon Resource Name (ARN) of the workflow for which you want a list of runs.

Optional arguments:

iv_maxresults TYPE /AWS1/MWSINTEGER /AWS1/MWSINTEGER

The maximum number of workflow runs to return in a single response.

iv_nexttoken TYPE /AWS1/MWSSTRING /AWS1/MWSSTRING

The pagination token you need to use to retrieve the next set of results. This value is returned from a previous call to ListWorkflowRuns.

iv_workflowversion TYPE /AWS1/MWSVERSIONID /AWS1/MWSVERSIONID

Optional. The specific version of the workflow for which you want a list of runs. If not specified, runs for all versions are returned.

RETURNING

oo_output TYPE REF TO /aws1/cl_mwslstworkflowrunsrsp /AWS1/CL_MWSLSTWORKFLOWRUNSRSP

Domain /AWS1/RT_ACCOUNT_ID
Primitive Type NUMC

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->listworkflowruns(
  iv_maxresults = 123
  iv_nexttoken = |string|
  iv_workflowarn = |string|
  iv_workflowversion = |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_workflowruns( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_idstring = lo_row_1->get_runid( ).
      lv_workflowarn = lo_row_1->get_workflowarn( ).
      lv_versionid = lo_row_1->get_workflowversion( ).
      lv_runtype = lo_row_1->get_runtype( ).
      lo_rundetailsummary = lo_row_1->get_rundetailsummary( ).
      IF lo_rundetailsummary IS NOT INITIAL.
        lv_workflowrunstatus = lo_rundetailsummary->get_status( ).
        lv_timestampvalue = lo_rundetailsummary->get_createdon( ).
        lv_timestampvalue = lo_rundetailsummary->get_startedat( ).
        lv_timestampvalue = lo_rundetailsummary->get_endedat( ).
      ENDIF.
    ENDIF.
  ENDLOOP.
  lv_string = lo_result->get_nexttoken( ).
ENDIF.