<?xml version="1.0" encoding="UTF-8"?>
<ccxml xmlns="http://www.w3.org/2002/09/ccxml" xmlns:conf="http://www.w3.org/2005/ccxml-conformance" version="1.0">
<!--
Release 1.1 - 2010-06-15
FIXED: 
ISSUE-715, TA 739.

Release 1.3 - 2010-12-21
FIXED: 
no issue, deleted line:
add_2_assert_trace('738');
because assertion 738 is not tested in this file. 
-->
	<conf:docsetup/>
	<var name="ConnectionID" expr="undefined"/>
	<var name="VxmlFile2" expr="'TWO_2.vxml'"/>
	<var name="param1" expr="1"/>
	<var name="param2" expr="'hello'"/>
	<var name="chld_reason"/>
	<var name="send_id_1"/>
	<var name="DialogID"/>
	<var name="i_success"/>
	<var name="cur_event_ID"/>
	<var name="MY_BLANK" expr="''"/>
	<var name="WKR_STRING"/>

	<var name="event_source_type_ccxml" expr="'ccxml'"/>
	<script><![CDATA[
	   function GetMilliseconds() {
     var d = new Date();
     return d.getTime();  // ms from midnight on Jan 1, 2000.
   }

var t_start, t_end, t_delay = 2000, t_delta, t_delta_e = 0.05 * t_delay;
		   ]]></script>
	<script><![CDATA[

var i=0;
assertions[i++] = init_assertion('739');

add_2_assert_trace('739');
add_2_assert_trace('1167');
add_2_assert_trace('1168');
add_2_assert_trace('1170');
add_2_assert_trace('1171');


var assert_last = i - 1;
var assert_index = -1;
//
// out of the loop assertions (children?)
//
//
s_ASSERTIONS_LEFT = show_remained_assertions();
var b_in_test = false;


]]></script>

	<eventprocessor statevariable="current_state">
		<transition event="ccxml.loaded">
			<conf:comment expr="'Event: ' + event$.name"/>
			<send targettype="'ccxml'" target="session.id" name="'user.timeout'" delay="TEST_LONG_TIMEOUT"/>
			<send targettype="'ccxml'" target="session.id" name="name_prepare_new"/>
		</transition>
		
		<transition event="user.PREPARE_NEW">
			<conf:comment expr="'Event: ' + event$.name"/>
			<if cond="assert_index &gt;= 0">
				<assign name="ASSERTION_NUM" expr="assertions[assert_index].number"/>
				<assign name="t_ASSERT_RESULT" expr="assertions[assert_index].P_F"/>
				<script>t_ASSERT_REASON = assertions[assert_index].reason</script>
				<if cond="t_ASSERT_RESULT == s_PASS">
					<conf:pass reason="t_ASSERT_REASON"/>
					<elseif cond="t_ASSERT_RESULT == s_FAIL"/>
					<conf:fail reason="t_ASSERT_REASON"/>
					<else/>
					<conf:not_exec reason="t_ASSERT_REASON"/>
				</if>
			</if>
			<assign name="assert_index" expr="assert_index + 1"/>
			<if cond="assert_index &gt; assert_last">
						<!--
1168 	
8.2.1 &lt;assign&gt; and &lt;var&gt; 	
The application scope is opened by CCXML implementation before interpretation of a new session starts and exists until the session exits.
 	emily.candell@comverse.com 	Accepted 	

-->
				<assign name="ASSERTION_NUM" expr="'1168'"/>
				<if cond="application.appScopeVar=='5'">
					<conf:pass/>
				<else/>
					<assign name="chld_reason" expr="'appScopeVar is ' + appScopeVar + '; should be 5.'"/>
					<conf:fail reason="chld_reason"/>
				</if>
<!--
1167 	

8.2.1 &lt;assign&gt; and &lt;var&gt; 	
The session scope is opened by CCXML implementation before interpretation of a new session starts and exists until the session exits. 	
emily.candell@comverse.com 	Accepted 	
-->

				<assign name="ASSERTION_NUM" expr="'1167'"/>
				<if cond="session.id != undefined">
					<conf:pass/>
				<else/>
					<assign name="chld_reason" expr="'session.id has fallen out of scope.'"/>
					<conf:fail reason="chld_reason"/>
				</if>	
				<log label="s_TA" expr="s_ASSERTIONS_LEFT"/>
				<conf:uncond_exit expr="'DONE'"/>
				<else/>
				<log label="s_TA" expr="s_ASSERTIONS_LEFT"/>
				<assign name="ASSERTION_NUM" expr=" assertions[assert_index].number"/>
				<assign name="t_ASSERT_REASON" expr="''"/>
				<script>assertions[assert_index].P_F = s_FAIL;</script>
				<assign name="current_state" expr="state_prefix + ASSERTION_NUM"/>
				<send targettype="'ccxml'" target="session.id" name="start_name_prefix + ASSERTION_NUM" sendid="cur_event_ID"/>
				<log label="s_TA" expr="'Loop event: SendID=' + cur_event_ID"/>
			</if>
		</transition>
		
		<transition event="user.START_ASSERTION_739" state="ASSERTION_NMBR_739">
			<!--
739 	
8.2.1 &lt;assign&gt; and &lt;var&gt; 	
Variables defined in the ccxml scope are visible only within that document in which they are declared. 	emily.candell@comverse.com 	Accepted 	

-->
			<conf:comment expr="'Event: ' + event$.name"/>
			<if cond="ccxml.num_738_ccxml_39==undefined">
			<!-- FIXED ISSUE-715: assignament of  "bool_738_ccxml_7" erased-->
			<script>
				assertions[assert_index].P_F = s_PASS;
			
				</script>
				<else/>
			<script>
			assertions[assert_index].P_F = s_FAIL;
			assertions[assert_index].reason = 'Expected value: undefined, actual value: ' + ccxml.num_738_ccxml_39;
			 </script>
			</if>
<!--
1170 	
8.2.1 &lt;assign&gt; and &lt;var&gt; 	
Variables defined within the application scope are visible to all documents within the CCXML application. 	
emily.candell@comverse.com 	Accepted 	
-->
			<assign name="ASSERTION_NUM" expr="'1170'"/>
			<if cond="application.appScopeVar=='5'">
				<conf:pass/>
			<else/>
				<conf:fail/>
			</if>

<!--
1171 	
8.2.1 &lt;assign&gt; and &lt;var&gt; 	
This ccxml scope is opened by CCXML implementation for each CCXML document when it is loaded and exists while the document is loaded. 	emily.candell@comverse.com 	Accepted 	-->
			<assign name="ASSERTION_NUM" expr="'1171'"/>
			<if cond="ccxml.ccxmlScopeVar==undefined">
				<conf:pass/>
				<else/>
				<conf:fail/>
			</if>
			
			<assign name="current_state" expr="'GEN'"/>
			<send targettype="'ccxml'" target="session.id" name="name_prepare_new"/>	
					
		</transition>
		
		<transition event="user.timeout">
			<assign name="current_state" expr="'GEN'"/>
			<conf:uncond_exit expr="'TEST-TIMEOUT.' + show_remained_assertions()"/>
		</transition>
		
		<transition event="send.successful">
			<conf:comment expr="'Event: ' + event$.name + ' (generic handler) state=' + current_state"/>
		</transition>
		
		<transition event="*">
			<assign name="t_ASSERT_REASON" expr="'UNEXPECTED EVENT ' + event$.name + ' IN STATE ' + current_state"/>
			<conf:comment expr="t_ASSERT_REASON"/>
			<if cond="current_state == 'init'">
				<conf:uncond_exit expr="'Did not come out from init state.'"/>
				<else/>
				<send targettype="'ccxml'" target="session.id" name="name_prepare_new"/>
			</if>
		</transition>
	</eventprocessor>

<!-- ************************************** -->


</ccxml>

