Skip to content

/AWS1/IF_CNT=>CREATERULE()

About CreateRule

Creates a rule for the specified Connect Customer instance.

Use the Rules Function language to code conditions for the rule.

Method Signature

METHODS /AWS1/IF_CNT~CREATERULE
  IMPORTING
    !IV_INSTANCEID TYPE /AWS1/CNTINSTANCEID OPTIONAL
    !IV_NAME TYPE /AWS1/CNTRULENAME OPTIONAL
    !IO_TRIGGEREVENTSOURCE TYPE REF TO /AWS1/CL_CNTRULETRIGGEREVSRC OPTIONAL
    !IV_FUNCTION TYPE /AWS1/CNTRULEFUNCTION OPTIONAL
    !IT_ACTIONS TYPE /AWS1/CL_CNTRULEACTION=>TT_RULEACTIONS OPTIONAL
    !IV_PUBLISHSTATUS TYPE /AWS1/CNTRULEPUBLISHSTATUS OPTIONAL
    !IO_PREEVALUATIONFILTERS TYPE REF TO /AWS1/CL_CNTPREEVALFILTERS OPTIONAL
    !IV_CLIENTTOKEN TYPE /AWS1/CNTCLIENTTOKEN OPTIONAL
    !IT_TAGS TYPE /AWS1/CL_CNTTAGMAP_W=>TT_TAGMAP OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_cntcreateruleresponse
  RAISING
    /AWS1/CX_CNTACCESSDENIEDEX
    /AWS1/CX_CNTINTERNALSERVICEEX
    /AWS1/CX_CNTINVALIDREQUESTEX
    /AWS1/CX_CNTRESOURCECONFLICTEX
    /AWS1/CX_CNTRESOURCENOTFOUNDEX
    /AWS1/CX_CNTSERVICEQUOTAEXCDEX
    /AWS1/CX_CNTTHROTTLINGEX
    /AWS1/CX_CNTCLIENTEXC
    /AWS1/CX_CNTSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_instanceid TYPE /AWS1/CNTINSTANCEID /AWS1/CNTINSTANCEID

The identifier of the Connect Customer instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.

iv_name TYPE /AWS1/CNTRULENAME /AWS1/CNTRULENAME

A unique name for the rule.

io_triggereventsource TYPE REF TO /AWS1/CL_CNTRULETRIGGEREVSRC /AWS1/CL_CNTRULETRIGGEREVSRC

The event source to trigger the rule.

iv_function TYPE /AWS1/CNTRULEFUNCTION /AWS1/CNTRULEFUNCTION

The conditions of the rule.

it_actions TYPE /AWS1/CL_CNTRULEACTION=>TT_RULEACTIONS TT_RULEACTIONS

A list of actions to be run when the rule is triggered.

iv_publishstatus TYPE /AWS1/CNTRULEPUBLISHSTATUS /AWS1/CNTRULEPUBLISHSTATUS

The publish status of the rule.

Optional arguments:

io_preevaluationfilters TYPE REF TO /AWS1/CL_CNTPREEVALFILTERS /AWS1/CL_CNTPREEVALFILTERS

The pre-evaluation filters for the rule, that restrict the rule to be applied to only certain resources based on the resource's attributes, such as tags assigned to a contact. The pre-evaluation filters are applied even before rule conditions are evaluated and are used to enforce tag-based-access-control while applying rules.

iv_clienttoken TYPE /AWS1/CNTCLIENTTOKEN /AWS1/CNTCLIENTTOKEN

A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see Making retries safe with idempotent APIs.

it_tags TYPE /AWS1/CL_CNTTAGMAP_W=>TT_TAGMAP TT_TAGMAP

The tags used to organize, track, or control access for this resource. For example, { "Tags": {"key1":"value1", "key2":"value2"} }.

RETURNING

oo_output TYPE REF TO /aws1/cl_cntcreateruleresponse /AWS1/CL_CNTCREATERULERESPONSE

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->createrule(
  io_preevaluationfilters = new /aws1/cl_cntpreevalfilters(
    it_andconditions = VALUE /aws1/cl_cntpreevalfilter=>tt_preevaluationfilterlist(
      (
        new /aws1/cl_cntpreevalfilter(
          iv_filterkey = |string|
          iv_filtertype = |string|
          iv_filtervalue = |string|
          iv_operator = |string|
          iv_resourcetype = |string|
        )
      )
    )
  )
  io_triggereventsource = new /aws1/cl_cntruletriggerevsrc(
    iv_eventsourcename = |string|
    iv_integrationassociationid = |string|
  )
  it_actions = VALUE /aws1/cl_cntruleaction=>tt_ruleactions(
    (
      new /aws1/cl_cntruleaction(
        io_assigncontactcataction = new /aws1/cl_cntassigncontactcat00( )
        io_assignslaaction = new /aws1/cl_cntassignslaactdefn(
          io_caseslaconfiguration = new /aws1/cl_cntcaseslaconf(
            it_targetfieldvalues = VALUE /aws1/cl_cntfieldvalueunion=>tt_slafieldvalueunionlist(
              (
                new /aws1/cl_cntfieldvalueunion(
                  io_emptyvalue = new /aws1/cl_cntemptyfieldvalue( )
                  iv_booleanvalue = ABAP_TRUE
                  iv_doublevalue = '0.1'
                  iv_stringvalue = |string|
                )
              )
            )
            iv_fieldid = |string|
            iv_name = |string|
            iv_targetslaminutes = 123
            iv_type = |string|
          )
          iv_slaassignmenttype = |string|
        )
        io_createcaseaction = new /aws1/cl_cntcreatecaseactdefn(
          it_fields = VALUE /aws1/cl_cntfieldvalue=>tt_fieldvalues(
            (
              new /aws1/cl_cntfieldvalue(
                io_value = new /aws1/cl_cntfieldvalueunion(
                  io_emptyvalue = new /aws1/cl_cntemptyfieldvalue( )
                  iv_booleanvalue = ABAP_TRUE
                  iv_doublevalue = '0.1'
                  iv_stringvalue = |string|
                )
                iv_id = |string|
              )
            )
          )
          iv_templateid = |string|
        )
        io_endassociatedtasksaction = new /aws1/cl_cntendasscdtsksactdef( )
        io_eventbridgeaction = new /aws1/cl_cnteventbridgeactdefn( |string| )
        io_extractinformationaction = new /aws1/cl_cntextractinfoactdefn(
          it_rulesextractiondefns = VALUE /aws1/cl_cntrulesextdefnid=>tt_rulesextdefinitionidlist(
            ( new /aws1/cl_cntrulesextdefnid( |string| ) )
          )
        )
        io_sendnotificationaction = new /aws1/cl_cntsendnotifactdefn(
          io_exclusion = new /aws1/cl_cntnotifrecipienttype(
            it_userids = VALUE /aws1/cl_cntuseridlist_w=>tt_useridlist(
              ( new /aws1/cl_cntuseridlist_w( |string| ) )
            )
            it_usertags = VALUE /aws1/cl_cntusertagmap_w=>tt_usertagmap(
              (
                VALUE /aws1/cl_cntusertagmap_w=>ts_usertagmap_maprow(
                  key = |string|
                  value = new /aws1/cl_cntusertagmap_w( |string| )
                )
              )
            )
          )
          io_recipient = new /aws1/cl_cntnotifrecipienttype(
            it_userids = VALUE /aws1/cl_cntuseridlist_w=>tt_useridlist(
              ( new /aws1/cl_cntuseridlist_w( |string| ) )
            )
            it_usertags = VALUE /aws1/cl_cntusertagmap_w=>tt_usertagmap(
              (
                VALUE /aws1/cl_cntusertagmap_w=>ts_usertagmap_maprow(
                  key = |string|
                  value = new /aws1/cl_cntusertagmap_w( |string| )
                )
              )
            )
          )
          iv_content = |string|
          iv_contenttype = |string|
          iv_deliverymethod = |string|
          iv_subject = |string|
        )
        io_submitautoevalaction = new /aws1/cl_cntsubmitautoevalac00( |string| )
        io_taskaction = new /aws1/cl_cnttaskactiondefn(
          it_references = VALUE /aws1/cl_cntreference=>tt_contactreferences(
            (
              VALUE /aws1/cl_cntreference=>ts_contactreferences_maprow(
                key = |string|
                value = new /aws1/cl_cntreference(
                  iv_arn = |string|
                  iv_status = |string|
                  iv_statusreason = |string|
                  iv_type = |string|
                  iv_value = |string|
                )
              )
            )
          )
          iv_contactflowid = |string|
          iv_description = |string|
          iv_name = |string|
        )
        io_updatecaseaction = new /aws1/cl_cntupdcaseactiondefn(
          it_fields = VALUE /aws1/cl_cntfieldvalue=>tt_fieldvalues(
            (
              new /aws1/cl_cntfieldvalue(
                io_value = new /aws1/cl_cntfieldvalueunion(
                  io_emptyvalue = new /aws1/cl_cntemptyfieldvalue( )
                  iv_booleanvalue = ABAP_TRUE
                  iv_doublevalue = '0.1'
                  iv_stringvalue = |string|
                )
                iv_id = |string|
              )
            )
          )
        )
        iv_actiontype = |string|
      )
    )
  )
  it_tags = VALUE /aws1/cl_cnttagmap_w=>tt_tagmap(
    (
      VALUE /aws1/cl_cnttagmap_w=>ts_tagmap_maprow(
        key = |string|
        value = new /aws1/cl_cnttagmap_w( |string| )
      )
    )
  )
  iv_clienttoken = |string|
  iv_function = |string|
  iv_instanceid = |string|
  iv_name = |string|
  iv_publishstatus = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_arn = lo_result->get_rulearn( ).
  lv_ruleid = lo_result->get_ruleid( ).
ENDIF.