Skip to content

/AWS1/CL_BDC=>CREATEEVENT()

About CreateEvent

Creates an event in a memory store. Events represent interactions or activities that occur within a session and are associated with specific actors.

To use this operation, you must have the genesismemory:CreateEvent permission.

This operation is subject to request rate limiting.

Method Signature

IMPORTING

Required arguments:

iv_memoryid TYPE /AWS1/BDCMEMORYID /AWS1/BDCMEMORYID

The identifier of the memory store in which to create the event.

iv_actorid TYPE /AWS1/BDCACTORID /AWS1/BDCACTORID

The identifier of the actor associated with this event. An actor represents an entity that participates in sessions and generates events.

iv_eventtimestamp TYPE /AWS1/BDCTIMESTAMP /AWS1/BDCTIMESTAMP

The timestamp when the event occurred. If not specified, the current time is used.

it_payload TYPE /AWS1/CL_BDCPAYLOADTYPE=>TT_PAYLOADTYPELIST TT_PAYLOADTYPELIST

The content payload of the event. This can include conversational data or binary content.

Optional arguments:

iv_sessionid TYPE /AWS1/BDCSESSIONID /AWS1/BDCSESSIONID

The identifier of the session in which this event occurs. A session represents a sequence of related events.

io_branch TYPE REF TO /AWS1/CL_BDCBRANCH /AWS1/CL_BDCBRANCH

The branch information for this event. Branches allow for organizing events into different conversation threads or paths.

iv_clienttoken TYPE /AWS1/BDCSTRING /AWS1/BDCSTRING

A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, AgentCore ignores the request, but does not return an error.

RETURNING

oo_output TYPE REF TO /aws1/cl_bdccreateeventoutput /AWS1/CL_BDCCREATEEVENTOUTPUT

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->/aws1/if_bdc~createevent(
  io_branch = new /aws1/cl_bdcbranch(
    iv_name = |string|
    iv_rooteventid = |string|
  )
  it_payload = VALUE /aws1/cl_bdcpayloadtype=>tt_payloadtypelist(
    (
      new /aws1/cl_bdcpayloadtype(
        io_blob = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
        io_conversational = new /aws1/cl_bdcconversational(
          io_content = new /aws1/cl_bdccontent( |string| )
          iv_role = |string|
        )
      )
    )
  )
  iv_actorid = |string|
  iv_clienttoken = |string|
  iv_eventtimestamp = '20150101000000.0000000'
  iv_memoryid = |string|
  iv_sessionid = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lo_event = lo_result->get_event( ).
  IF lo_event IS NOT INITIAL.
    lv_memoryid = lo_event->get_memoryid( ).
    lv_actorid = lo_event->get_actorid( ).
    lv_sessionid = lo_event->get_sessionid( ).
    lv_eventid = lo_event->get_eventid( ).
    lv_timestamp = lo_event->get_eventtimestamp( ).
    LOOP AT lo_event->get_payload( ) into lo_row.
      lo_row_1 = lo_row.
      IF lo_row_1 IS NOT INITIAL.
        lo_conversational = lo_row_1->get_conversational( ).
        IF lo_conversational IS NOT INITIAL.
          lo_content = lo_conversational->get_content( ).
          IF lo_content IS NOT INITIAL.
            lv_sensitivestring = lo_content->get_text( ).
          ENDIF.
          lv_role = lo_conversational->get_role( ).
        ENDIF.
        lo_value = lo_row_1->get_blob( ).
        IF lo_value IS NOT INITIAL.
        ENDIF.
      ENDIF.
    ENDLOOP.
    lo_branch = lo_event->get_branch( ).
    IF lo_branch IS NOT INITIAL.
      lv_eventid = lo_branch->get_rooteventid( ).
      lv_branchname = lo_branch->get_name( ).
    ENDIF.
  ENDIF.
ENDIF.