Jump to: navigation, search

Expand Target List

The following SCXML strategy tries to route the call to various objects, starting with a specific agent. If this is not successful within 10 seconds, it will expand the target list to route the call to an agent group. Again, if this is not successful within 10 seconds, it will route the call to a place. And finally, if it is not successful within 10 seconds, it will expand the target list to a place group.

<scxml version="1.0" xmlns="http://www.w3.org/2005/07/scxml"
	xmlns:queue="www.genesyslab.com/modules/queue"
	initial="initial">
	<datamodel>
		<data id="reqid" expr="''" />
		<data id="ixnid" expr="''" />
	</datamodel>
	<state id="initial">
		<transition event="interaction.added" target="routing">
			<script>
				_data.ixnid = _event.data.interactionid;
			</script>
		</transition>
	</state>
	<state id="routing" initial="route_to_agent">
		<state id="route_to_agent">
			<onentry>
				<log expr="'Queue Submit to Agent'" />
				<queue:submit requestid="_data.reqid" interactionid="_data.ixnid"
				 priority="5" timeout="10" clearontimeout="false">
					<queue:targets>
						<queue:target type="agent" name="'701_sip'" />
					</queue:targets>
				</queue:submit>
				<send event="'to_gr1'" delay="'5s'" />
			</onentry>
			<transition event="error.queue.submit" target="route_to_agent_group" />
		</state>
		<state id="route_to_agent_group">
			<onentry>
				<log expr="'Queue Submit to Agent Group'" />
				<queue:submit requestid="_data.reqid" interactionid="_data.ixnid"
				 priority="5" timeout="10" clearontimeout="false">
					<queue:targets>
						<queue:target type="agentgroup" name="'SipGr_1'" />
					</queue:targets>
				</queue:submit>
			</onentry>
			<transition event="error.queue.submit" target="route_to_place" />
		</state>
		<state id="route_to_place">
			<onentry>
				<log expr="'Queue Submit to Place'" />
				<queue:submit requestid="_data.reqid" interactionid="_data.ixnid"
				 priority="5" timeout="10" clearontimeout="false">
					<queue:targets>
						<queue:target type="place" name="'701'" />
					</queue:targets>
				</queue:submit>
			</onentry>
			<transition event="error.queue.submit" target="route_to_place_group" />
		</state>
		<state id="route_to_place_group">
			<onentry>
				<log expr="'Queue Submit to Place Group'" />
				<queue:submit requestid="_data.reqid" interactionid="_data.ixnid"
				 priority="5" timeout="10" clearontimeout="false">
					<queue:targets>
						<queue:target type="placegroup" name="'SIP_PlGr2'" />
					</queue:targets>
				</queue:submit>
			</onentry>
			<transition event="error.queue.submit" target="error">
				<log expr="'ERROR'" />
			</transition>
		</state>
		<transition event="queue.submit.done" target="exit">
			<log expr="'Queue Submit DONE'" />
			<log expr="_event.data.targetselected" />
		</transition>
	</state>
	<final id="exit" />
	<final id="error" />
</scxml>
This page was last edited on September 22, 2017, at 13:06.
Comments or questions about this documentation? Contact us for support!