|
Genesys 8.1 SCXML Technical Reference |
||
< Runtime Core Elements > |
There are several ways an application can terminate a session:
<final>
as a Child of the <scxml>
Element Termination — The session is terminated after the <onexit>
logic is run. A done.xxx event is then fired by the orchestration platform for that session. The xxx part of the event is different depending on how the session was started. In the case of <invoke>
initation, the xxx is "invoke" plus the invokeid from the original request. In the case of <session:start>
and web service interface initiation, it is the word "scxml". This is done regardless of the type of session it is (parent or child), but there are exceptions (for example, in the case of <invoke>
initiation, when the invoking session terminates the invoked session). In addition, data can be sent with this done event. See the SCXML Element Extensions
section for details.
<invoke>
-Related Termination (Initiated by the Invoking Session) — When the invoking session ends (<final>
) or leaves the invoking state (<transition target=new>
, the orchestration platform will perform the cancel operation (internal) on the invoked session. When cancelling an invoked session, the platform will send the cancel.invoke.invokeid event to the invoked session first. This will be an external event. After consuming this event, the invoked session will exit at the end of the next microstep. When the invoked session exits, it will execute the <onexit>
handlers for all active states. Note: a done event is not fired in this case, because the invoking session is not interested in the event.
<session:terminate>
Termination — This action terminates a session from another session. This will result in the orchestration platform terminating the selected session (same termination process as with <invoke>
-related termination (initiated by the invoking session)), but it will send the appropriate done.xxx event to only the initiating session. See the terminate action definition for more details.
TerminateSession Web Service Termination — This action is the same as the <session:terminate>
action, except it is performed by a 3rd party application via a web service interface.
In addition to the application-driven ways for terminating a session, the platform may encounter session hung conditions in which it will need to terminate the corresponding sessions. The following are the hung conditions which need to be handled by the platform:
<final>
processing for an application has not finished in a reasonable time frame.<transition>
).<script>
, <queue:submit>
, for example)Because of this, the platform must have the necessary set of platform configuration options to handle these conditions. In most cases, it is configuring a count or a time period.
The general process for handling these conditions is to do the following:
<invoke>
, for example) it will not execute the <onexit>
handlers. It will simply terminate the session.The following diagram shows the general processing that will occur when these conditions are detected:
|
Genesys 8.1 SCXML Technical Reference |
||
< Runtime Core Elements > |