Section II – Functional Modules > Chat Interaction Interface > Action Elements Bottom of Page
| Genesys 8.0 SCXML Technical Reference
< Parameter Elements Events >

## Action Elements

The following are the chat-specific interaction actions.

#### < sendchatmessage >

This action sends a chat message during the interaction on behalf of the orchestration logic and the associated resource to all other parties in the chat session. This message will also be added to the transcript of the interaction. (_genesys.FMName.interactions[].chat.transcript[])

##### Attribute Details

Name | Required | Type | Default Value | Valid Values | Description
--- | --- | --- | --- | --- | ---
requestid | false | location expression | none | Any valid location expression | This is the location for the request ID that is returned as part of this request. Any data model expression evaluating to a data model location. See SCXML Location Expressions for details. The location's value will be set to an internally generated unique string identifier to be associated with the action being sent. If this attribute is not specified, the event identifier is dropped. This identifier can be tested by the completion event handler to distinguish among several outstanding requests. If this attribute is not specified, the identifier can be acquired from the fetch completion event. Every request must receive a unique identifier.
interactionid | false | value expression | "0" | Any value expression that returns a valid string | A value expression which returns the _genesys.FMname.interactions[x].g_uid of the interaction that is associated with this request. There is a special value that can be returned: "0" means the functional module will use the _genesys.FMname.interactions[0].g_uid as the related interaction. See SCXML Legal Data Values and Value Expressions for details.
from | true | value expression | none | A valid agent id string | A value expression which returns the device address of the party that this message will be from. See SCXML Legal Data Values and Value Expressions
message | true | value expression | none | A valid string | A value expression which returns the string with the text message that is to be sent on the chat session. See SCXML Legal Data Values and Value Expressions for details.

The following is an example:

    <state id="do_sendchatmessage">
    <datamodel>
    	<data id="reqid"/>
    	<data id="currentixn"/>
    </datamodel>
    <onentry>
    	<ixn:sendchatmessage requestid="_data.reqid"
    		from="_data.currentixn.parties[4].device"
    		message="'hi, what can I do for you'"/>
    </onentry>
    <transition event="chat.sendchatmessage.done" target="statex"/>
    <transition event="error.chat.sendchatmessage" target="statey"/>
    </state>

##### Children

None

##### Events

The following events can be generated as part of this action:

- chat.sendchatmessage.done — This event is sent when the request has been accepted by the system and the chat message is being sent.
- error.chat.sendchatmessage — This event is sent when the request has failed for some reason.

#### <gettranscript >

This action gets the latest version of the chat transcript and returns it in the chat.gettranscript.done event.

##### Attribute Details

Name | Required | Type | Default Value | Valid Values | Description
--- | --- | --- | --- | --- | ---
requestid | false | location expression | none | Any valid location expression | This is the location for the request ID that is returned as part of this request. Any data model expression evaluating to a data model location. See SCXML Location Expressions for details. The location's value will be set to an internally generated unique string identifier to be associated with the action being sent. If this attribute is not specified, the event identifier is dropped. This identifier can be tested by the completion event handler to distinguish among several outstanding requests. If this attribute is not specified, the identifier can be acquired from the fetch completion event. Every request must receive a unique identifier.
interactionid | false | value expression | "0" | Any value expression that returns a valid string | A value expression which returns the _genesys.FMname.interactions[x].g_uid of the interaction that is associated with this request. There is a special value that can be returned: "0" means the functional module will use the _genesys.FMname.interactions[0].g_uid as the related interaction. See SCXML Legal Data Values and Value Expressions for details.

The following is an example:

    <state id="do_getTranscript">
    <datamodel>
    	<data id="reqid"/>
    	<data id="currentixn"/>
    </datamodel>
    <onentry>
    	<ixn:gettranscript requestid="_data.reqid"
    		interactionid="'_genesys.ixn.interactions[1].g_uid"/>
    </onentry>
    <transition event="chat.gettranscript.done" target="statex"/>
    <transition event="error.chat.gettranscript" target="statey"/>
    </state>

##### Children

None

##### Events

The following events can be generated as part of this action:

- chat.gettranscript.done — This event is sent when the request has been accepted by the system and the transcript has been refreshed.
- error.chat.gettranscript — This event is sent when the request has failed for some reason.

Section II – Functional Modules > Chat Interaction Interface > Action Elements Top of Page
| Genesys 8.0 SCXML Technical Reference
< Parameter Elements Events >