Jump to: navigation, search

Get Maximum Statistic Value

The following example requests the maximum statistic value for a set of targets in the script block and then uses a delay to indicate when 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'"/>
		<statistic:subscribe object="'SipGr_3@.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.getMinData('SipGr_2@.GA,SipGr_3@.GA', 'StatAgentsAvailable')==0" target="exit"/>
	<transition cond="_genesys.statistic.getMinData('SipGr_2@.GA,SipGr_3@.GA', 'StatAgentsAvailable')!=0" target="error"/>
  </state>
  
  <final id="exit"/>
  <final id="error"/>
</scxml>

Feedback

Comment on this article:

blog comments powered by Disqus
This page was last modified on 22 September 2017, at 06:06.