/AWS1/IF_DOA=>SENDMESSAGE()¶
About SendMessage¶
Sends a chat message and streams the response for the specified agent space execution
Method Signature¶
METHODS /AWS1/IF_DOA~SENDMESSAGE
IMPORTING
!IV_AGENTSPACEID TYPE /AWS1/DOAAGENTSPACEID OPTIONAL
!IV_EXECUTIONID TYPE /AWS1/DOARESOURCEID OPTIONAL
!IV_CONTENT TYPE /AWS1/DOAMESSAGECONTENT OPTIONAL
!IO_CONTEXT TYPE REF TO /AWS1/CL_DOASENDMESSAGECONTEXT OPTIONAL
!IV_USERID TYPE /AWS1/DOARESOURCEID OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_doasendmessagersp
RAISING
/AWS1/CX_DOAACCESSDENIEDEX
/AWS1/CX_DOACONFLICTEXCEPTION
/AWS1/CX_DOACONTENTSIZEEXCDEX
/AWS1/CX_DOAINTERNALSERVEREX
/AWS1/CX_DOAINVALIDPARAMETEREX
/AWS1/CX_DOARESOURCENOTFOUNDEX
/AWS1/CX_DOASERVICEQUOTAEXCDEX
/AWS1/CX_DOATHROTTLINGEX
/AWS1/CX_DOAVLDTNEXCEPTION
/AWS1/CX_DOACLIENTEXC
/AWS1/CX_DOASERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Required arguments:¶
iv_agentspaceid TYPE /AWS1/DOAAGENTSPACEID /AWS1/DOAAGENTSPACEID¶
The agent space identifier
iv_executionid TYPE /AWS1/DOARESOURCEID /AWS1/DOARESOURCEID¶
The execution identifier for the chat session
iv_content TYPE /AWS1/DOAMESSAGECONTENT /AWS1/DOAMESSAGECONTENT¶
The user message content
Optional arguments:¶
io_context TYPE REF TO /AWS1/CL_DOASENDMESSAGECONTEXT /AWS1/CL_DOASENDMESSAGECONTEXT¶
Optional context for the message
iv_userid TYPE /AWS1/DOARESOURCEID /AWS1/DOARESOURCEID¶
User identifier. This field is deprecated and will be ignored — the service resolves user identity from the authenticated session.
RETURNING¶
oo_output TYPE REF TO /aws1/cl_doasendmessagersp /AWS1/CL_DOASENDMESSAGERSP¶
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->sendmessage(
io_context = new /aws1/cl_doasendmessagecontext(
iv_currentpage = |string|
iv_lastmessage = |string|
iv_useractionresponse = |string|
)
iv_agentspaceid = |string|
iv_content = |string|
iv_executionid = |string|
iv_userid = |string|
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
TRY.
WHILE lo_result->get_events( )->/aws1/if_rt_stream_reader~data_available( ) = ABAP_TRUE.
lo_event = lo_result->get_events( )->READ( ).
IF lo_event->get_responsecreated( ) IS NOT INITIAL.
" process this kind of event
ELSEIF lo_event->get_responseinprogress( ) IS NOT INITIAL.
" process this kind of event
ELSEIF lo_event->get_responsecompleted( ) IS NOT INITIAL.
" process this kind of event
ELSEIF lo_event->get_responsefailed( ) IS NOT INITIAL.
" process this kind of event
ELSEIF lo_event->get_summary( ) IS NOT INITIAL.
" process this kind of event
ELSEIF lo_event->get_heartbeat( ) IS NOT INITIAL.
" process this kind of event
ELSEIF lo_event->get_contentblockstart( ) IS NOT INITIAL.
" process this kind of event
ELSEIF lo_event->get_contentblockdelta( ) IS NOT INITIAL.
" process this kind of event
ELSEIF lo_event->get_contentblockstop( ) IS NOT INITIAL.
" process this kind of event
ENDIF.
ENDWHILE.
ENDTRY.
ENDIF.