Client/Document.pm

filter: Statementstmt 83.3% 155 / 186 Branchbran 58.1% 43 / 74 Conditioncond 46.6% 21 / 45 MC/DCmcdc 19.2% 5 / 26 Subroutinesub 83.3% 20 / 24 Podpod 15.0% 3 / 20 totaltotal 65.8% 247 / 375 CC 56 SCAR 25.7
CC
56
Cov
72%
execute
37.7
currentItemPosition
20.0
nextFormId
12.5
CRAP 13.1
« Client/Item/Grammar.pm ↑ Summary Client/Item/Form.pm »
1 package VoiceXML::Client::Document;
2  
3  
4  
5 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 3 ▶use Data::Dumper;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 3 ▶use base qw(VoiceXML::Client::Item);
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10  
11 3 ▶use vars qw{
Subroutine BEGIN: called CC=1 SCAR=0.0
12 $VERSION
13 3 };
14  
15 3 $VERSION = $VoiceXML::Client::Item::VERSION;
16  
17  
18 =head1 COPYRIGHT AND LICENSE
19  
20
21 Copyright (C) 2007,2008 by Pat Deegan.
22 All rights reserved
23 http://voicexml.psychogenic.com
24  
25 This library is released under the terms of the GNU GPL version 3, making it available only for
26 free programs ("free" here being used in the sense of the GPL, see http://www.gnu.org for more details).
27 Anyone wishing to use this library within a proprietary or otherwise non-GPLed program MUST contact psychogenic.com to
28 acquire a distinct license for their application. This approach encourages the use of free software
29 while allowing for proprietary solutions that support further development.
30  
31  
32 This file is part of VoiceXML::Client.
33  
34
35
36 VoiceXML::Client is free software: you can redistribute it and/or modify
37 it under the terms of the GNU General Public License as published by
38 the Free Software Foundation, either version 3 of the License, or
39 (at your option) any later version.
40  
41 VoiceXML::Client is distributed in the hope that it will be useful,
42 but WITHOUT ANY WARRANTY; without even the implied warranty of
43 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
44 GNU General Public License for more details.
45  
46 You should have received a copy of the GNU General Public License
47 along with VoiceXML::Client. If not, see <http://www.gnu.org/licenses/>.
48  
49  
50 =cut
51  
52  
53 =head2 new
54  
55 =cut
56 3 ▶sub new {
Subroutine new: called CC=3 SCAR=11.2
Pod documented
57 3 my $class = shift;
58 3 my $docname = shift;
59 3 my $runtime = shift;
60
61
62
63 3 my $self = {};
64
65 3 ▶ bless $self, ref $class || $class;
Condition33%1/3
ref $class || $class
l!l&&r!l&&!r
030
MC/DC0%0/2
ref $class || $class
ref $class $class
Truth table33%1/3
A || B
A= ref $classB= $class
ABresult
1X1
011
000
66
67
68 3 ▶ $self->{'type'} = ref $class || $class;
Condition33%1/3
ref $class || $class
l!l&&r!l&&!r
030
MC/DC0%0/2
ref $class || $class
ref $class $class
Truth table33%1/3
A || B
A= ref $classB= $class
ABresult
1X1
011
000
69 3 $self->{'_runtime'} = $runtime;
70 3 $self->{'_context'} = $runtime->create_context();
71 3 $self->{'docname'} = $docname;
72
73 3 $self->{'forms'} = [];
74 3 $self->{'formindices'} = {};
75
76 3 $self->{'variables'} = {};
77
78 3 $self->{'nextform'} = 0;
79 3 $self->{'nextdocument'} = 0;
80 3 $self->{'currentitem'} = 0;
81
82
83 3 return $self;
84 }
85  
86 0 ▶sub init {
Subroutine init: not called CC=1 SCAR=6.9
Pod documented
87 0 my $self = shift;
88
89 0 $self->{'items'} = [];
90
91 0 return 1;
92 }
93  
94  
95 =head2 addItem ITEM
96  
97 Appends ITEM to the list of items for the document. Items may be any VXML::Item::XXX subclass, while
98 ITEM itself may be a single ITEM object reference or an ARRAY ref of VXML::Item::XXX objects (each will
99 be appended in order).
100  
101 Returns the number of appended items.
102  
103 =cut
104  
105 15 ▶sub addItem {
Subroutine addItem: called CC=3 SCAR=11.0
Pod documented
106 15 my $self = shift;
107 15 my $item = shift;
108
109
110 15 my $count = 0;
111 15 ▶ if (ref $item eq 'ARRAY')
Branch: 1 branch
BranchTrueFalseTotal
if (ref $item eq 'ARRAY') { } 3 12 15
112 {
113 3 foreach my $singleItem (@{$item})
114 {
115 12 $count += $self->addItem($singleItem);
116 }
117 } else {
118
119 12 push @{$self->{'items'}}, $item;
120 12 $count = 1;
121 }
122
123 15 return $count;
124
125 }
126  
127 4 ▶sub nextFormId {
Subroutine nextFormId: called CC=10 SCAR=25.3
Pod undocumented
128 4 my $self = shift;
129 4 my $setTo = shift; # optional
130
131 4 ▶ if (defined $setTo && exists $self->{'formindices'}->{$setTo})
Branch: 1 branch
BranchTrueFalseTotal
if (defined $setTo and exists $self->{"formindices"}{$setTo}) 2 2 4
Condition66%2/3
defined $setTo and exists $self->{"formindices"}{$setTo}
!ll&&!rl&&r
202
MC/DC50%1/2
defined $setTo and exists $self->{"formindices"}{$setTo}
defined $setTo exists $self->{"formindices"}{$setTo}
Truth table66%2/3
A and B
A= defined $setToB= exists $self->{"formindices"}{$setTo}
ABresult
0X0
100
111
132 {
133 2 $self->{'nextform'} = $setTo;
134 2 my $nextFormIdx = $self->getFormItemsIndex($setTo);
135
136 2 $self->{'currentitem'} = $nextFormIdx;
137 2 $self->{'items'}->[$nextFormIdx]->reset();
138
139 2 return $setTo;
140
141 }
142
143 2 my $idx = 0;
144 2 ▶ if ($self->{'nextform'})
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"nextform"}) 2 0 2
145 {
146 2 my $nextFormName = $self->{'nextform'};
147
148 2 ▶ if (exists $self->{'formindices'}->{$nextFormName}
Branch: 1 branch
BranchTrueFalseTotal
if (exists $self->{"formindices"}{$nextFormName} and exists $self->{"forms"}[$self->{"formindices"}{$nextFormName}]) 2 0 2
Condition33%1/3
exists $self->{"formindices"}{$nextFormName} and exists $self->{"forms"}[$self->{"formindices"}{$nextFormName}]
!ll&&!rl&&r
002
MC/DC0%0/2
exists $self->{"formindices"}{$nextFormName} and exists $self->{"forms"}[$self->{"formindices"}{$nextFormName}]
exists $self->{"formindices"}{$nextFormName} exists $self->{"forms"}[$self->{"formindices"}{$nextFormName}]
Truth table33%1/3
A and B
A= exists $self->{"formindices"}{$nextFormName}B= exists $self->{"forms"}[$self->{"formindices"}{$nextFormName}]
ABresult
0X0
100
111
149 && ( exists $self->{'forms'}->[$self->{'formindices'}->{$nextFormName}] )
150 )
151 {
152 2 $idx = $self->{'formindices'}->{$nextFormName};
153 2 $self->{'variables'}->{$self->{'forms'}->[$idx]->{'guard'}} = undef;
154 }
155 }
156
157 2 ▶ for (my $i = $idx; $i < scalar @{$self->{'forms'}}; $i++)
Branch: 1 branch
BranchTrueFalseTotal
if ($i < scalar @{$self->{"forms"};}) 2 0 2
158 {
159
160 2 ▶ if ($self->{'variables'}->{$self->{'forms'}->[$i]->{'guard'}})
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{'variables'}{$self->{'forms'}[$i]{'guard'}}) { } 0 2 2
161 {
162 0 ▶ VoiceXML::Client::Util::log_msg("nextFormId() Skipping form " . $self->{'forms'}->[$i]->{'name'}
Branch: 1 branch
BranchTrueFalseTotal
if $VoiceXML::Client::Debug > 1 0 0 0
163 . ' because guard condition is set') if ($VoiceXML::Client::Debug > 1);
164 } else {
165 2 ▶ VoiceXML::Client::Util::log_msg("nextFormId() returning form id " . $self->{'forms'}->[$i]->{'name'} )
Branch: 1 branch
BranchTrueFalseTotal
if $VoiceXML::Client::Debug 0 2 2
166 if ($VoiceXML::Client::Debug);
167 2 return $self->{'forms'}->[$i]->{'name'} ;
168 }
169 }
170
171 0 return undef;
172 }
173  
174 3 ▶sub getForm {
Subroutine getForm: called CC=2 SCAR=7.0
Pod undocumented
175 3 my $self = shift;
176 3 my $id = shift ;
177
178 3 my $idx = $self->getFormItemsIndex($id);
179
180
181 3 ▶ return undef unless (defined $idx);
Branch: 1 branch
BranchTrueFalseTotal
unless defined $idx 0 3 3
182  
183 3 return $self->{'items'}->[$idx];
184
185 }
186  
187 5 ▶sub getFormItemsIndex {
Subroutine getFormItemsIndex: called CC=6 SCAR=18.3
Pod undocumented
188 5 my $self = shift;
189 5 my $id = shift ;
190
191 5 ▶ return undef unless defined ($id);
Branch: 1 branch
BranchTrueFalseTotal
unless defined $id 0 5 5
192  
193 5 ▶ for (my $i=0; $i < scalar @{$self->{'items'}}; $i++)
Branch: 1 branch
BranchTrueFalseTotal
if ($i < scalar @{$self->{"items"};}) 24 0 24
194 {
195 24 my $itm = $self->{'items'}->[$i];
196
197 24 ▶ if ($itm->{'type'} eq 'VoiceXML::Client::Item::Form'
Branch: 1 branch
BranchTrueFalseTotal
if ($itm->{"type"} eq "VoiceXML::Client::Item::Form" and $itm->{"id"} eq $id) 5 19 24
Condition100%3/3
$itm->{"type"} eq "VoiceXML::Client::Item::Form" and $itm->{"id"} eq $id
!ll&&!rl&&r
1095
MC/DC100%2/2
$itm->{"type"} eq "VoiceXML::Client::Item::Form" and $itm->{"id"} eq $id
$itm->{"type"} eq "VoiceXML::Client::Item::Form" $itm->{"id"} eq $id
Truth table100%3/3
A and B
A= $itm->{"type"} eq "VoiceXML::Client::Item::Form"B= $itm->{"id"} eq $id
ABresult
0X0
100
111
198 && $itm->{'id'} eq $id)
199 {
200 5 ▶ VoiceXML::Client::Util::log_msg("Found form $id att idx $i")
Branch: 1 branch
BranchTrueFalseTotal
if $VoiceXML::Client::Debug > 1 0 5 5
201 if ($VoiceXML::Client::Debug > 1);
202
203 5 return $i ;
204 }
205
206 }
207
208 0 return undef;
209 }
210
211  
212  
213 2 ▶sub getNextForm {
Subroutine getNextForm: called CC=1 SCAR=0.0
Pod undocumented
214 2 my $self = shift;
215
216 2 my $id = $self->nextFormId();
217
218
219 2 return $self->getForm($id);
220
221 }
222  
223 14 ▶sub getNextItem {
Subroutine getNextItem: called CC=7 SCAR=19.5
Pod undocumented
224 14 my $self = shift;
225
226 14 ▶ return $self->getNextForm() if ($self->{'nextform'});
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"nextform"} 2 12 14
227
228
229 12 ▶ $self->{'currentitem'} ||= 0;
Condition100%2/2
$self->{"currentitem"} ||= 0
l!l
93
MC/DC100%1/1
$self->{"currentitem"} ||= 0
$self->{"currentitem"}
Truth table100%2/2
A
A= $self->{"currentitem"}
Aresult
11
00
230
231 12 my $oldChildSetting = $self->{'currentitem'} ;
232 12 my $i = $oldChildSetting;
233 12 ▶ while ($i < scalar @{$self->{'items'}})
Branch: 1 branch
BranchTrueFalseTotal
if ($i < scalar @{$self->{"items"};}) 9 4 13
234 {
235
236 9 $self->{'currentitem'} = $i;
237
238 9 my $cType = $self->{'items'}->[$i]->getType();
239 9 ▶ if ($cType ne 'VoiceXML::Client::Item::Form')
Branch: 1 branch
BranchTrueFalseTotal
if ($cType ne 'VoiceXML::Client::Item::Form') { } 5 4 9
240 {
241 # not a form, just return it in sequence
242 5 return $self->{'items'}->[$i];
243
244 } else
245 {
246 # it IS a form... handle guard vars...
247 4 my $formName = $self->{'items'}->[$i]->id();
248
249 4 ▶ if (exists $self->{'formindices'}->{$formName})
Branch: 1 branch
BranchTrueFalseTotal
if (exists $self->{"formindices"}{$formName}) 4 0 4
250 {
251 4 my $formIdx = $self->{'formindices'}->{$formName};
252
253 4 ▶ if (! $self->{'variables'}->{$self->{'forms'}->[$formIdx]->{'guard'}})
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->{"variables"}{$self->{"forms"}[$formIdx]{"guard"}}) 3 1 4
254 {
255 # not visited yet... go for it.
256 3 return $self->{'items'}->[$i];
257 }
258 }
259 }
260
261
262 1 $i++;
263
264 }
265
266 4 $self->{'currentitem'} = $oldChildSetting;
267
268 4 return undef;
269 }
270  
271 0 ▶sub currentItemPosition {
Subroutine currentItemPosition: not called CC=4 SCAR=30.0
Pod undocumented
272 0 my $self = shift;
273 0 my $setTo = shift; # optional
274
275 0 ▶ if (defined $setTo && $setTo =~ m/^\d+$/ && $setTo < scalar @{$self->{'items'}})
Branch: 1 branch
BranchTrueFalseTotal
if (defined $setTo and $setTo =~ /^\d+$/ and $setTo < scalar @{$self->{"items"};}) 0 0 0
Condition0%0/6
defined $setTo and $setTo =~ /^\d+$/ and $setTo < scalar @{$self->{"items"};}
!ll&&!rl&&r
000
defined $setTo and $setTo =~ /^\d+$/
!ll&&!rl&&r
000
MC/DC0%0/3
defined $setTo and $setTo =~ /^\d+$/ and $setTo < scalar @{$self->{"items"};}
defined $setTo $setTo =~ /^\d+$/ $setTo < scalar @{$self->{"items"};}
Truth table0%0/4
A and B and C
A= defined $setToB= $setTo =~ /^\d+$/C= $setTo < scalar @{$self->{"items"};}
ABCresult
0XX0
10X0
1100
1111
276 {
277 0 $self->{'currentitem'} = $setTo;
278 }
279
280 0 return $self->{'currentitem'};
281 }
282  
283 9 ▶sub proceedToNextItem {
Subroutine proceedToNextItem: called CC=1 SCAR=0.0
Pod undocumented
284 9 my $self = shift;
285
286 9 return $self->{'currentitem'}++;
287
288 }
289  
290  
291 7 ▶sub registerForm {
Subroutine registerForm: called CC=1 SCAR=0.0
Pod undocumented
292 7 my $self = shift;
293 7 my $formName = shift;
294 7 my $guard = shift;
295
296 7 push @{$self->{'forms'}}, {
297 'name' => $formName,
298 'guard' => $guard};
299
300 7 $self->{'formindices'}->{$formName} = $#{$self->{'forms'}};
301
302
303 7 $self->registerVariable($formName);
304 }
305  
306 37 ▶sub registerVariable {
Subroutine registerVariable: called CC=3 SCAR=11.8
Pod undocumented
307 37 my $self = shift;
308 37 ▶ my $varName = shift || return;
Condition50%1/2
shift() || (return)
l!l
370
MC/DC0%0/1
shift() || (return)
shift()
Truth table50%1/2
A
A= shift()
Aresult
11
00
309 37 my $val = shift;
310
311 37 ▶ if (defined $val)
Branch: 1 branch
BranchTrueFalseTotal
if (defined $val) { } 0 37 37
312 {
313 0 $self->{'variables'}->{$varName} = $val;
314 } else {
315
316 37 $self->{'variables'}->{$varName} = undef;
317 }
318
319 }
320  
321 17 ▶sub globalVar {
Subroutine globalVar: called CC=5 SCAR=16.2
Pod undocumented
322 17 my $self = shift;
323 17 ▶ my $varName = shift || return;
Condition50%1/2
shift() || (return)
l!l
170
MC/DC0%0/1
shift() || (return)
shift()
Truth table50%1/2
A
A= shift()
Aresult
11
00
324 17 my $val = shift; #optional
325
326
327 17 ▶ if (defined $val)
Branch: 1 branch
BranchTrueFalseTotal
if (defined $val) 9 8 17
328 {
329 9 $self->{'variables'}->{$varName} = $val;
330
331 9 ▶ VoiceXML::Client::Util::log_msg("SETTING $varName to '$val'") if ($VoiceXML::Client::Debug > 1);
Branch: 1 branch
BranchTrueFalseTotal
if $VoiceXML::Client::Debug > 1 0 9 9
332 }
333
334 17 ▶ $self->{'variables'}->{$varName} = undef unless (exists $self->{'variables'}->{$varName});
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"variables"}{$varName} 2 15 17
335
336
337 17 return $self->{'variables'}->{$varName};
338 }
339  
340 4 ▶sub clearGlobalVar {
Subroutine clearGlobalVar: called CC=3 SCAR=11.4
Pod undocumented
341 4 my $self = shift;
342 4 ▶ my $varName = shift || return;
Condition50%1/2
shift() || (return)
l!l
40
MC/DC0%0/1
shift() || (return)
shift()
Truth table50%1/2
A
A= shift()
Aresult
11
00
343
344 4 ▶ if (exists $self->{'variables'}->{$varName})
Branch: 1 branch
BranchTrueFalseTotal
if (exists $self->{"variables"}{$varName}) 4 0 4
345 {
346 4 $self->{'variables'}->{$varName} = undef;
347 }
348 }
349
350 1 ▶sub pushPositionStack {
Subroutine pushPositionStack: called CC=1 SCAR=0.0
Pod undocumented
351 1 my $self = shift;
352  
353 1 unshift @{$self->{'itempositionstack'}}, $self->{'currentitem'} ;
354
355
356 }
357  
358 1 ▶sub latestPositionInStack {
Subroutine latestPositionInStack: called CC=2 SCAR=7.4
Pod undocumented
359 1 my $self = shift;
360
361
362 1 ▶ if (scalar @{$self->{'itempositionstack'}})
Branch: 1 branch
BranchTrueFalseTotal
if (scalar @{$self->{"itempositionstack"};}) 1 0 1
363 {
364 1 return $self->{'itempositionstack'}->[0];
365 }
366
367 0 return undef;
368
369 }
370  
371 1 ▶sub popPositionStack {
Subroutine popPositionStack: called CC=2 SCAR=7.2
Pod undocumented
372 1 my $self = shift;
373
374
375 1 ▶ if (scalar @{$self->{'itempositionstack'}})
Branch: 1 branch
BranchTrueFalseTotal
if (scalar @{$self->{"itempositionstack"};}) 1 0 1
376 {
377 1 return shift @{$self->{'itempositionstack'}};
378 }
379  
380 0 return undef;
381 }
382  
383 3 ▶sub execute {
Subroutine execute: called CC=17 SCAR=36.3
Pod undocumented
384 3 my $self = shift;
385 3 ▶ my $handle = shift || return undef;
Condition50%1/2
shift() || (return undef)
l!l
30
MC/DC0%0/1
shift() || (return undef)
shift()
Truth table50%1/2
A
A= shift()
Aresult
11
00
386 3 ▶ my $params = shift || {};
Condition50%1/2
shift() || {}
l!l
03
MC/DC0%0/1
shift() || {}
shift()
Truth table50%1/2
A
A= shift()
Aresult
11
00
387 3 ▶ my $itemToExec = shift || $self->getNextItem();
Condition33%1/3
shift() || $self->getNextItem
l!l&&r!l&&!r
030
MC/DC0%0/2
shift() || $self->getNextItem
shift() $self->getNextItem
Truth table33%1/3
A || B
A= shift()B= $self->getNextItem
ABresult
1X1
011
000
388
389 3 ▶ unless ($itemToExec)
Branch: 1 branch
BranchTrueFalseTotal
unless ($itemToExec) 0 3 3
390 {
391 0 warn "No form or other item to execute";
392 0 return undef;
393 }
394
395 3 my $retVal = $VoiceXML::Client::Flow::Directive{'CONTINUE'};
396
397 do {
398
399 11 $self->{'nextform'} = undef; # make certain we start with a clean slate
400
401 11 $retVal = $itemToExec->execute($handle, $params);
402
403 11 ▶ $self->proceedToNextItem() if ($retVal != $VoiceXML::Client::Flow::Directive{'JUMP'});
Branch: 1 branch
BranchTrueFalseTotal
if $retVal != $VoiceXML::Client::Flow::Directive{"JUMP"} 9 2 11
404 11 $itemToExec = $self->getNextItem();
405
406 11 ▶ if ($retVal == $VoiceXML::Client::Flow::Directive{'SUBRETURN'})
Branch: 1 branch
BranchTrueFalseTotal
if ($retVal == $VoiceXML::Client::Flow::Directive{"SUBRETURN"}) 1 10 11
407 {
408 1 my $latestPosInStack = $self->latestPositionInStack();
409 1 ▶ if (defined $latestPosInStack)
Branch: 1 branch
BranchTrueFalseTotal
if (defined $latestPosInStack) 1 0 1
410 {
411 1 $self->popPositionStack();
412 1 $self->{'currentitem'} = $latestPosInStack;
413 1 $itemToExec = $self->{'items'}->[$latestPosInStack];
414 1 $retVal = $VoiceXML::Client::Flow::Directive{'CONTINUE'};
415 }
416 }
417
418
419
420 } while ($itemToExec &&
421 ($retVal == $VoiceXML::Client::Flow::Directive{'CONTINUE'}
422 ||
423 3 ▶ $retVal == $VoiceXML::Client::Flow::Directive{'JUMP'}));
Branch: 1 branch
BranchTrueFalseTotal
$itemToExec and $retVal == $VoiceXML::Client::Flow::Directive{"CONTINUE"} || $retVal == $VoiceXML::Client::Flow::Directive{"JUMP"} and do { do { $self->{"nextform"} = undef; $retVal = $itemToExec->execute($handle, $params); $self->proceedToNextItem if $retVal != $VoiceXML::Client::Flow::Directive{"JUMP"}; $itemToExec = $self->getNextItem; if ($retVal == $VoiceXML::Client::Flow::Directive{"SUBRETURN"}) { my $latestPosInStack = $self->latestPositionInStack; if (defined $latestPosInStack) { $self->popPositionStack; $self->{"currentitem"} = $latestPosInStack; $itemToExec = $self->{"items"}[$latestPosInStack]; $retVal = $VoiceXML::Client::Flow::Directive{"CONTINUE"}; } ; } } } 8 3 11
Condition66%4/6
$itemToExec and $retVal == $VoiceXML::Client::Flow::Directive{"CONTINUE"} || $retVal == $VoiceXML::Client::Flow::Directive{"JUMP"}
!ll&&!rl&&r
308
$retVal == $VoiceXML::Client::Flow::Directive{"CONTINUE"} or $retVal == $VoiceXML::Client::Flow::Directive{"JUMP"}
l!l&&r!l&&!r
620
MC/DC33%1/3
$itemToExec and $retVal == $VoiceXML::Client::Flow::Directive{"CONTINUE"} || $retVal == $VoiceXML::Client::Flow::Directive{"JUMP"}
$itemToExec $retVal == $VoiceXML::Client::Flow::Directive{"CONTINUE"} $retVal == $VoiceXML::Client::Flow::Directive{"JUMP"}
Truth table75%3/4
A and B or C
A= $itemToExecB= $retVal == $VoiceXML::Client::Flow::Directive{"CONTINUE"}C= $retVal == $VoiceXML::Client::Flow::Directive{"JUMP"}
ABCresult
0XX0
1000
11X1
1011
424
425
426 3 ▶ if ($retVal == $VoiceXML::Client::Flow::Directive{'CONTINUE'})
Branch: 1 branch
BranchTrueFalseTotal
if ($retVal == $VoiceXML::Client::Flow::Directive{"CONTINUE"}) 0 3 3
427 {
428
429
430 0 warn "Made it through the entire VXML document but instructed to continue--aborting";
431 0 return $VoiceXML::Client::Flow::Directive{'ABORT'};
432 }
433  
434 return $retVal if ($retVal == $VoiceXML::Client::Flow::Directive{'ABORT'}
435 3 ▶ || $retVal == $VoiceXML::Client::Flow::Directive{'DONE'});
Branch: 1 branch
BranchTrueFalseTotal
if $retVal == $VoiceXML::Client::Flow::Directive{"ABORT"} or $retVal == $VoiceXML::Client::Flow::Directive{"DONE"} 3 0 3
Condition33%1/3
$retVal == $VoiceXML::Client::Flow::Directive{"ABORT"} or $retVal == $VoiceXML::Client::Flow::Directive{"DONE"}
l!l&&r!l&&!r
030
MC/DC0%0/2
$retVal == $VoiceXML::Client::Flow::Directive{"ABORT"} or $retVal == $VoiceXML::Client::Flow::Directive{"DONE"}
$retVal == $VoiceXML::Client::Flow::Directive{"ABORT"} $retVal == $VoiceXML::Client::Flow::Directive{"DONE"}
Truth table33%1/3
A or B
A= $retVal == $VoiceXML::Client::Flow::Directive{"ABORT"}B= $retVal == $VoiceXML::Client::Flow::Directive{"DONE"}
ABresult
1X1
011
000
436
437 0 ▶ if ($retVal == $VoiceXML::Client::Flow::Directive{'NEXTDOC'})
Branch: 1 branch
BranchTrueFalseTotal
if ($retVal == $VoiceXML::Client::Flow::Directive{"NEXTDOC"}) 0 0 0
438 {
439 # need to jump somewhere...
440 0 my $nextDoc = $self->nextDocument();
441 0 ▶ warn "Told to go to next doc, but nextDocument not set" unless ($nextDoc);
Branch: 1 branch
BranchTrueFalseTotal
unless $nextDoc 0 0 0
442
443 0 ▶ VoiceXML::Client::Util::log_msg("GOING TO $nextDoc") if ($VoiceXML::Client::Debug);
Branch: 1 branch
BranchTrueFalseTotal
if $VoiceXML::Client::Debug 0 0 0
444
445 }
446
447 0 return $retVal;
448
449 }
450
451 0 ▶sub nextDocument {
Subroutine nextDocument: not called CC=2 SCAR=17.9
Pod undocumented
452 0 my $self = shift;
453 0 my $setTo = shift; # optional
454
455 0 ▶ if (defined $setTo)
Branch: 1 branch
BranchTrueFalseTotal
if (defined $setTo) 0 0 0
456 {
457 0 $self->{'nextdocument'} = $setTo;
458 }
459
460 0 return $self->{'nextdocument'};
461 }
462
463  
464 0 ▶sub isaVXMLDocument {
Subroutine isaVXMLDocument: not called CC=1 SCAR=6.9
Pod undocumented
465 0 my $self = shift;
466
467 0 return 1;
468 }
469  
470 3 1;
« Client/Item/Grammar.pm ↑ Summary Client/Item/Form.pm »