Jump to: navigation, search

Get Statistic Value

The following example requests a statistic in the script block and then uses a delay to determine when this value will become available to the SCXML session.

<scxml version="1.0" xmlns="http://www.w3.org/2005/07/scxml" 
	xmlns:queue="www.genesyslab.com/modules/queue" 
	xmlns:dialog="www.genesyslab.com/modules/dialog" 
	xmlns:statistic="www.genesyslab.com/modules/statistic" 
	initial="initial">
  <state id="initial">
	<transition event="interaction.added" target="subscribe"/>
  </state>
  <state id="subscribe">
	<onentry>
		<statistic:subscribe object="'SipGr_2@.GA'" statistic="'StatAgentsAvailable'"/>
	</onentry>
    
	<transition event="statistic.subscribe.done" target="delay"/>
	<transition event="error.statistic.subscribe" target="error"/>
  </state>
  <state id="delay">
	<onentry>
		<send event="'delay'" target="_sessionid" targettype="'scxml'" delay="'2s'"/>
	</onentry>
	<transition event="delay" target="check"/>
  </state>
  <state id="check">
	<transition cond="_genesys.statistic.sData('SipGr_2@.GA', 'StatAgentsAvailable')==1" target="exit"/>
	<transition cond="_genesys.statistic.sData('SipGr_2@.GA', 'StatAgentsAvailable')!=1" target="error"/>
  </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!