Jump to: navigation, search

Delete All User Data

The following SCXML strategy shows how to delete all user data from an interaction.

<scxml version="1.0" xmlns="http://www.w3.org/2005/07/scxml" 
	xmlns:ixn="http://www.genesyslab.com/modules/interaction"
	initial="initial">
  <state id="initial">
	<transition event="interaction.added" target="setudata">
		<script>
			_data.ixnid = _event.data.interactionid;
		</script>
	</transition>
  </state>
  <state id="setudata">
	<onentry>
		<script>
			var data = { details : { name : "Smith, John", age : 45 } };
			_genesys.ixn.setuData( data, _data.ixnid );
		</script>
	</onentry>
	<transition event="interaction.udata.changed" 
		cond="_genesys.ixn.interactions[_data.ixnid].udata.details.name=='Smith, John' &amp;&amp; 
		_genesys.ixn.interactions[_data.ixnid].udata.details.age==45" 
		target="delete_all_udata"/>
  </state>
  
  <state id="delete_all_udata">
	<onentry>
		<script>
			_genesys.ixn.deleteuData( "$ALL", _data.ixnid );
		</script>
	</onentry>
	<transition event="interaction.udata.changed" 
		cond="_genesys.ixn.interactions[_data.ixnid].udata.ORSession==undefined &amp;&amp; 
		_genesys.ixn.interactions[_data.ixnid].udata.ORDbid==undefined &amp;&amp; 
		_genesys.ixn.interactions[_data.ixnid].udata.ORUrl==undefined &amp;&amp; 
		_genesys.ixn.interactions[_data.ixnid].udata.details==undefined" 
		target="exit"/>
	<transition 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 September 22, 2017, at 05:06.