Section II – Functional Modules > Functional Modules > Events Bottom of Page
| Genesys 8.0 SCXML Technical Reference
< Action Elements Versioning >

## Events

The events of a functional module interface will be exposed by an SCXML event model with a unique event naming convention and corresponding event properties via the _event system variable and a defined ECMAScript object at the following location: _event.data. In other words, all the event-specific objects and properties will be accessed from this location (for example, the targetselected property of the queue.submit.done event, that is, _event.data.targetselected).

The event names will be defined at the functional module interface level. So if multiple functional modules implement the same functional module interface then they will fire the same events for that interface. The origin property of the event (_event.origin) must have the appropriate "fm" URI Schema value. See Supported URI Schemes section for details on the "fm" URI Schema.

All variable event content will be ECMAScript objects or properties. If the event and its content is transported externally, it will converted to the JSON string format.

All events must have the common set of properties defined in the Events section.

Event subscription for action response events is done implicitly (the session is tied to the action that was performed). This is true for both SCXML element actions and functional module actions. In addition, event subscription for objects that are owned by the session (interactions, and so on) is done implicitly between the platform and the functional modules (the session is tied to the object). As for other functional module–specific event subscriptions, these will be done explicitly by the orchestration logic and the defined functional module interface. As for session-related events, there is only an implicit event subscription for other sessions started by the session.

Events can be sent or published by the logic to a functional module via two methods:

- The `<send>` element and a targettype attribute value of "fm" and a target attribute value of "fm" URI schema.
- The functional module can have its own event publication action element.

Besides the specific events defined for each functional module, the following are the common events that can used when processing a functional module action or ECMAScript function.

Event Name | Description | Where used
--- | --- | ---
error.illegalcond.errortype | If a conditional expression does not evaluate to a boolean value ('true' or 'false'), this event is raised. The optional errortype element indicates the ECMAScript error type as specified in Section 15.11.6 of [ECMASCRIPT-262 ]. | Any element that has a boolean expression attribute
error.illegalloc.errortype | If a location expression does not evaluate to a legal location, this event is raised. The optional errortype element indicates the ECMAScript error type as specified in Section 15.11.6 of [ECMASCRIPT-262 ]. This event is also raised under the following conditions: `<param>` — If the 'expr' attribute is missing and the 'name' attribute does not refer to a location in the data model. `<assign>` — If the location expression does not denote a valid location in the datamodel. | Any element that has an attribute that is a location expression
error.illegalvalue.errortype | If a value expression does not return a legal data value, this event is raised. The optional errortype element indicates the ECMAScript error type as specified in Section 15.11.6 of [ECMASCRIPT-262 ]. | Any element that has an attribute that is a value expression
error.illegaldata.errortype | Any errors which arise during initialization must be mapped into this event, where the optional errortype element indicates the ECMAScript error type as specified in Section 15.11.6 of [ECMASCRIPT-262 ]. | Any element that is processed at load time
error.script.function | Any errors which arise during processing of `<script>` content must be mapped into this event, where the optional function indicates the ECMAScript that was executing. | This is any error that arises as a result of a failure with ECMAScript function.
error.unsupported.element | The platform will raise this event when an element is not supported. The element element identifies the name of the element that is not supported. | This is used for any element that is not supported by the functional module.
error.badfetch | The platform will raise this event when it cannot fetch the data from its source. Note: If the `<scxml>` 'exmode' attribute value is strict, the platform will raise this event. If the `<scxml>` 'exmode' attribute value is lax, the platform will ignore the element. | Any element that is fetching data from some source (source-related attributes, src, srcexpr).
error.illegalassign | This event is raised when the application attempts to change the value of a read-only protected variable or data item. | Any element that could change a variable or data item

#### Naming Conventions

The following is the namespace convention that we will use for all functional modules:

- FMInterfacename.actionname.done — This will represent successful completion of an action element
- error.FMInterfacename.actionname — This will represent an error in completing an action element.
- FMInterfacename.eventname — This will represent an async event.

For example, msgbased.createmessage.done and error.msgbased.createmessage and interaction.created

The following is a summary of all the functional module interface prefix names:

Functional Module Interface | Event Name Prefix
--- | ---
Queue | queue
Interaction | interaction
Voice Interaction | voice
Msgbased Interaction | msgbased
Chat Interaction | chat
Dialog (Treatment) | dialog
Resource | resource
Statistic | statistic
Classification | classification
SCXML Extensions | session
Web API | ws

Section II – Functional Modules > Functional Modules > Events Top of Page
| Genesys 8.0 SCXML Technical Reference
< Action Elements Versioning >