Jump to: navigation, search

Interaction Interface Functions

_genesys.ixn.getMediaIntValue

This function returns the integer value for the interaction media type name based on the string name. intvalue _genesys.ixn.getMediaIntValue(media) Parameters:

  • media: STRING which can be a variable or a constant - This parameter is the string form of the media type name.

Returns: intvalue: NUMBER - The result of the function is an integer value which represents the given media type. A value of -1 will indicate that an integer value could not be found (before 8.1.200.50, the default value was 0 when the value was not found). The following is an example of the function:

  <state id="check">
    <onentry>
        <log expr="'This function returns the integer value for the interaction media type'" />
        <script>
		if ( _genesys.ixn.getMediaIntValue( 'TMediaVoice' ) == 0 && 
			 _genesys.ixn.getMediaIntValue( 'TMediaVoIP' ) == 1 && 
			 _genesys.ixn.getMediaIntValue( 'TMediaEMail' ) == 2 && 
			 _genesys.ixn.getMediaIntValue( 'TMediaVMail' ) == 3 && 
			 _genesys.ixn.getMediaIntValue( 'TMediaSMail' ) == 4 && 
			 _genesys.ixn.getMediaIntValue( 'TMediaChat' ) == 5 && 
			 _genesys.ixn.getMediaIntValue( 'TMediaVideo' ) == 6 && 
			 _genesys.ixn.getMediaIntValue( 'TMediaCobrowsing' ) == 7 && 
			 _genesys.ixn.getMediaIntValue( 'TMediaWhiteboard' ) == 8 && 
			 _genesys.ixn.getMediaIntValue( 'TMediaAppSharing' ) == 9 && 
			 _genesys.ixn.getMediaIntValue( 'TMediaWebform' ) == 10 && 
			 _genesys.ixn.getMediaIntValue( 'TMediaWorkItem' ) == 11 && 
			 _genesys.ixn.getMediaIntValue( 'TMediaCallback' ) == 12 && 
			 _genesys.ixn.getMediaIntValue( 'TMediaFax' ) == 13 && 
			 _genesys.ixn.getMediaIntValue( 'TMediaIMChat' ) == 14 && 
			 _genesys.ixn.getMediaIntValue( 'TMediaBusinessEvent' ) == 15 && 
			 _genesys.ixn.getMediaIntValue( 'TMediaAlert' ) == 16 && 
			 _genesys.ixn.getMediaIntValue( 'TMediaSMS' ) == 17 && 
			 _genesys.ixn.getMediaIntValue( 'TMediaOutboundPreview' ) == 18 && 
			 _genesys.ixn.getMediaIntValue( 'TMediaOpenMedia' ) == 19 && 
			 _genesys.ixn.getMediaIntValue( 'TMediaNativeSMS' ) == 20 && 
			 _genesys.ixn.getMediaIntValue( 'unknown' ) == -1 && 
			 typeof( _genesys.ixn.getMediaIntValue( 'TMediaVoice' ) ) == 'number')
		{
			_data.testPassed = 1;
		}				
        </script>
    </onentry>
    <transition cond="_data.testPassed==1" target="routing"/>
    <transition cond="_data.testPassed==0" target="error" >		
		<log expr="uneval( _event )" />
    </transition>
  </state>

_genesys.ixn.setuData

This function adds new udata or updates existing udata for an interaction. This function will not affect existing udata values that do not match the property names defined in the input parameter. For example:

Existing udata

Requested additions and updates

Resulting udata

udata.d1 = 3 udata.d2 = 4 udata.d3 = 5

d3 = 10000 d6 = 67 d7.a = 88 d7.b =99

udata.d1 = 3 udata.d2 = 4 udata.d3 = 10000 udata.d6 = 67 udata.d7.a = 88 udata.d7.b = 99

void _genesys.ixn.setuData(input, ixnid) Parameters:

  • input: OBJECT which must be a variable - This parameter is an object which CONTAINs the properties which are to be added to the udata of the given interaction. This means that the input object itself is NOT added to the interaction's udata (for example, if the input parameter object is "a", with properties "b=7" and "c=9" then the resulting udata properties for the interaction will be _genesys.ixn.interactions[_data.ixnid].udata.b and _genesys.ixn.interactions[_data.ixnid].udata.c). The following is an example _genesys.ixn.setuData({b:7, c:9});
  • ixnid: STRING which can be a variable - This parameter is optional. It defines the ID of the interaction which should have its udata added to or updated.

Returns: void The following is an example of this function:

  <state id="setudata">
    <onentry>
      <script>        
        var data = { details : { name : "Smith, John", age : 45 } };
        _genesys.ixn.setuData( data );
        _genesys.ixn.setuData( { category : 1 } );
      </script>
    </onentry>
    <transition target="update"/>
  </state>
  <state id="update">
    <onentry>
      <script>
        _genesys.ixn.setuData( { category : 2 }, _data.ixnid );
      </script>
    </onentry>
    <transition target="check"/>
  </state>
    
  <state id="check">
    <transition event="interaction.udata.changed" cond="_genesys.ixn.interactions[_data.ixnid].udata.category==2 &&
							_genesys.ixn.interactions[_data.ixnid].udata.details.name=='Smith, John' &&
							_genesys.ixn.interactions[_data.ixnid].udata.details.age==45" target="routing" />
  </state>

_genesys.ixn.deleteuData

This function deletes a udata property or all of the udata properties from the given interaction. void _genesys.ixn.deleteuData(key, ixnid) Parameters:

  • key: STRING (variable or constant) or JavaScript object (variable or object literal) - This parameter may be a STRING that represents the key or object, which represents a subset of udata properties that are to be deleted from udata (see example below).
  • ixnid: STRING which can be a variable - This parameter is optional. It defines the ID of the interaction which should have a given udata property removed.

Returns: void The following is an example of the function:

<state id="setudata">
    <onentry>
	<script>
		var data = { details : { name : "Smith, John", age : 45 } };
		_genesys.ixn.setuData( data );
      </script>
    </onentry>
    <transition event="interaction.udata.changed" 
		cond="_genesys.ixn.interactions[_data.ixnid].udata.details.name=='Smith, John' &&
		      _genesys.ixn.interactions[_data.ixnid].udata.details.age==45" 
		target="delete"/>
</state>
<state id="delete">
    <onentry>
	<script>
		_genesys.ixn.deleteuData( { details:{ age:0 } }, _data.ixnid );
	</script>
    </onentry>
    <transition event="interaction.udata.changed" 
		cond="_genesys.ixn.interactions[_data.ixnid].udata.details.name=='Smith, John' &&
			_genesys.ixn.interactions[_data.ixnid].udata.details.age==undefined" 
		target="delete_all_udata"/>
</state>
  
<state id="delete_all_udata">
    <onentry>
	<script>
		_genesys.ixn.deleteuData( { $ALL: 0 } );
	</script>
    </onentry>
    <transition event="interaction.udata.changed" 
		cond="_genesys.ixn.interactions[_data.ixnid].udata.ORSession==undefined &&
			_genesys.ixn.interactions[_data.ixnid].udata.ORDbid==undefined && 
			_genesys.ixn.interactions[_data.ixnid].udata.ORUrl==undefined &&
			_genesys.ixn.interactions[_data.ixnid].udata.details==undefined" 
		target="routing"/>
</state>
This page was last edited on September 28, 2017, at 07:46.
Comments or questions about this documentation? Contact us for support!