Skip to content

/AWS1/IF_IOS=>CANCELENRICHMENTJOB()

About CancelEnrichmentJob

Cancels a running or pending enrichment job. This is an idempotent operation—calling it multiple times with the same jobId is safe and returns the current status.

Behavior

  • Jobs in PENDING or RUNNING status transition to CANCELLED
  • Jobs in RUNNING state may not be cancellable once they have progressed to certain processing stages
  • Jobs already in terminal states (COMPLETED, FAILED, TIMED_OUT) cannot be cancelled; the operation returns a ConflictingOperationException
  • Cancelling an already-CANCELLED job is a no-op and returns the current status (idempotent behavior)
  • The API responds immediately after recording the cancellation
  • Cleanup of job resources happens asynchronously in the background

When to Cancel

Cancel a job when:

  • The job is taking longer than expected
  • The job was created with incorrect parameters
  • You no longer need the results

Idempotency

You can safely retry cancellation requests. Calling CancelEnrichmentJob multiple times for the same job returns the current status without error as long as the job is not in a terminal state other than CANCELLED.

Method Signature

METHODS /AWS1/IF_IOS~CANCELENRICHMENTJOB
  IMPORTING
    !IV_WORKSPACENAME TYPE /AWS1/IOSWORKSPACENAME OPTIONAL
    !IV_JOBID TYPE /AWS1/IOSID OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_ioscancenrchmntjobrsp
  RAISING
    /AWS1/CX_IOSACCESSDENIEDEX
    /AWS1/CX_IOSCNFLCTOPERATIONEX
    /AWS1/CX_IOSINTERNALFAILUREEX
    /AWS1/CX_IOSINVALIDREQUESTEX
    /AWS1/CX_IOSLIMITEXCEEDEDEX
    /AWS1/CX_IOSRESOURCENOTFOUNDEX
    /AWS1/CX_IOSTHROTTLINGEX
    /AWS1/CX_IOSCLIENTEXC
    /AWS1/CX_IOSSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_workspacename TYPE /AWS1/IOSWORKSPACENAME /AWS1/IOSWORKSPACENAME

The name of the IoT SiteWise workspace containing the enrichment job to cancel.

iv_jobid TYPE /AWS1/IOSID /AWS1/IOSID

The unique identifier of the enrichment job to cancel. This is the jobId returned by CreateEnrichmentJob.

RETURNING

oo_output TYPE REF TO /aws1/cl_ioscancenrchmntjobrsp /AWS1/CL_IOSCANCENRCHMNTJOBRSP

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->cancelenrichmentjob(
  iv_jobid = |string|
  iv_workspacename = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_id = lo_result->get_jobid( ).
  lv_enrichmentjobstatus = lo_result->get_status( ).
ENDIF.