/AWS1/IF_BDC=>CREATEEVENT()¶
About CreateEvent¶
Creates an event in an AgentCore Memory resource. Events represent interactions or activities that occur within a session and are associated with specific actors.
To use this operation, you must have the bedrock-agentcore:CreateEvent permission.
This operation is subject to request rate limiting.
Method Signature¶
METHODS /AWS1/IF_BDC~CREATEEVENT
IMPORTING
!IV_MEMORYID TYPE /AWS1/BDCMEMORYID OPTIONAL
!IV_ACTORID TYPE /AWS1/BDCACTORID OPTIONAL
!IV_SESSIONID TYPE /AWS1/BDCSESSIONID OPTIONAL
!IV_EVENTTIMESTAMP TYPE /AWS1/BDCTIMESTAMP OPTIONAL
!IT_PAYLOAD TYPE /AWS1/CL_BDCPAYLOADTYPE=>TT_PAYLOADTYPELIST OPTIONAL
!IO_BRANCH TYPE REF TO /AWS1/CL_BDCBRANCH OPTIONAL
!IV_CLIENTTOKEN TYPE /AWS1/BDCSTRING OPTIONAL
!IT_METADATA TYPE /AWS1/CL_BDCMETADATAVALUE=>TT_METADATAMAP OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_bdccreateeventoutput
RAISING
/AWS1/CX_BDCACCESSDENIEDEX
/AWS1/CX_BDCINVALIDINPUTEX
/AWS1/CX_BDCRESOURCENOTFOUNDEX
/AWS1/CX_BDCSERVICEEXCEPTION
/AWS1/CX_BDCSERVICEQUOTAEXCDEX
/AWS1/CX_BDCTHROTTLEDEXCEPTION
/AWS1/CX_BDCVALIDATIONEX
/AWS1/CX_BDCCLIENTEXC
/AWS1/CX_BDCSERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Required arguments:¶
iv_memoryid TYPE /AWS1/BDCMEMORYID /AWS1/BDCMEMORYID¶
The identifier of the AgentCore Memory resource 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.
it_metadata TYPE /AWS1/CL_BDCMETADATAVALUE=>TT_METADATAMAP TT_METADATAMAP¶
The key-value metadata to attach to the event.
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->createevent(
io_branch = new /aws1/cl_bdcbranch(
iv_name = |string|
iv_rooteventid = |string|
)
it_metadata = VALUE /aws1/cl_bdcmetadatavalue=>tt_metadatamap(
(
VALUE /aws1/cl_bdcmetadatavalue=>ts_metadatamap_maprow(
key = |string|
value = new /aws1/cl_bdcmetadatavalue( |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.
LOOP AT lo_event->get_metadata( ) into ls_row_2.
lv_key = ls_row_2-key.
lo_value_1 = ls_row_2-value.
IF lo_value_1 IS NOT INITIAL.
lv_string = lo_value_1->get_stringvalue( ).
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.