Skip to content

/AWS1/IF_IOS=>CREATECOMPUTATIONMODEL()

About CreateComputationModel

Create a computation model with a configuration and data binding.

Method Signature

IMPORTING

Required arguments:

iv_computationmodelname TYPE /AWS1/IOSRESTRICTEDNAME /AWS1/IOSRESTRICTEDNAME

The name of the computation model.

io_computationmodelconf TYPE REF TO /AWS1/CL_IOSCOMPUTATIONMDELC00 /AWS1/CL_IOSCOMPUTATIONMDELC00

The configuration for the computation model.

it_computationmdeldatabind00 TYPE /AWS1/CL_IOSCOMPUTATIONMDELD00=>TT_COMPUTATIONMODELDATABINDING TT_COMPUTATIONMODELDATABINDING

The data binding for the computation model. Key is a variable name defined in configuration. Value is a ComputationModelDataBindingValue referenced by the variable.

Optional arguments:

iv_computationmodeldesc TYPE /AWS1/IOSRESTRICTEDDESCRIPTION /AWS1/IOSRESTRICTEDDESCRIPTION

The description of the computation model.

iv_clienttoken TYPE /AWS1/IOSCLIENTTOKEN /AWS1/IOSCLIENTTOKEN

A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don't reuse this client token if a new idempotent request is required.

it_tags TYPE /AWS1/CL_IOSTAGMAP_W=>TT_TAGMAP TT_TAGMAP

A list of key-value pairs that contain metadata for the asset. For more information, see Tagging your IoT SiteWise resources in the IoT SiteWise User Guide.

RETURNING

oo_output TYPE REF TO /aws1/cl_ioscrecomputationmd01 /AWS1/CL_IOSCRECOMPUTATIONMD01

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->createcomputationmodel(
  io_computationmodelconf = new /aws1/cl_ioscomputationmdelc00(
    io_anomalydetection = new /aws1/cl_ioscomputationmdela00(
      iv_inputproperties = |string|
      iv_resultproperty = |string|
    )
  )
  it_computationmdeldatabind00 = VALUE /aws1/cl_ioscomputationmdeld00=>tt_computationmodeldatabinding(
    (
      VALUE /aws1/cl_ioscomputationmdeld00=>ts_computationmdeldat00_maprow(
        value = new /aws1/cl_ioscomputationmdeld00(
          io_assetmodelproperty = new /aws1/cl_iosastmdelprpbindin00(
            iv_assetmodelid = |string|
            iv_propertyid = |string|
          )
          io_assetproperty = new /aws1/cl_iosastprpbindingvalue(
            iv_assetid = |string|
            iv_propertyid = |string|
          )
          it_list = VALUE /aws1/cl_ioscomputationmdeld00=>tt_bindingvaluelist(
            (
              new /aws1/cl_ioscomputationmdeld00(
                io_assetmodelproperty = new /aws1/cl_iosastmdelprpbindin00(
                  iv_assetmodelid = |string|
                  iv_propertyid = |string|
                )
                io_assetproperty = new /aws1/cl_iosastprpbindingvalue(
                  iv_assetid = |string|
                  iv_propertyid = |string|
                )
              )
            )
          )
        )
        key = |string|
      )
    )
  )
  it_tags = VALUE /aws1/cl_iostagmap_w=>tt_tagmap(
    (
      VALUE /aws1/cl_iostagmap_w=>ts_tagmap_maprow(
        value = new /aws1/cl_iostagmap_w( |string| )
        key = |string|
      )
    )
  )
  iv_clienttoken = |string|
  iv_computationmodeldesc = |string|
  iv_computationmodelname = |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_computationmodelid( ).
  lv_arn = lo_result->get_computationmodelarn( ).
  lo_computationmodelstatus = lo_result->get_computationmodelstatus( ).
  IF lo_computationmodelstatus IS NOT INITIAL.
    lv_computationmodelstate = lo_computationmodelstatus->get_state( ).
    lo_errordetails = lo_computationmodelstatus->get_error( ).
    IF lo_errordetails IS NOT INITIAL.
      lv_errorcode = lo_errordetails->get_code( ).
      lv_errormessage = lo_errordetails->get_message( ).
      LOOP AT lo_errordetails->get_details( ) into lo_row.
        lo_row_1 = lo_row.
        IF lo_row_1 IS NOT INITIAL.
          lv_detailederrorcode = lo_row_1->get_code( ).
          lv_detailederrormessage = lo_row_1->get_message( ).
        ENDIF.
      ENDLOOP.
    ENDIF.
  ENDIF.
ENDIF.