| 1 | |||||||||||||
| 2 | package VoiceXML::Client::Item::Goto; | ||||||||||||
| 3 | |||||||||||||
| 4 | |||||||||||||
| 5 | 3 | ▶ | use base qw (VoiceXML::Client::Item); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | 3 | ▶ | use VoiceXML::Client::Util; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 7 | |||||||||||||
| 8 | |||||||||||||
| 9 | =head1 COPYRIGHT AND LICENSE | ||||||||||||
| 10 | |||||||||||||
| 11 | |||||||||||||
| 12 | Copyright (C) 2007,2008 by Pat Deegan. | ||||||||||||
| 13 | All rights reserved | ||||||||||||
| 14 | http://voicexml.psychogenic.com | ||||||||||||
| 15 | |||||||||||||
| 16 | This library is released under the terms of the GNU GPL version 3, making it available only for | ||||||||||||
| 17 | free programs ("free" here being used in the sense of the GPL, see http://www.gnu.org for more details). | ||||||||||||
| 18 | Anyone wishing to use this library within a proprietary or otherwise non-GPLed program MUST contact psychogenic.com to | ||||||||||||
| 19 | acquire a distinct license for their application. This approach encourages the use of free software | ||||||||||||
| 20 | while allowing for proprietary solutions that support further development. | ||||||||||||
| 21 | |||||||||||||
| 22 | |||||||||||||
| 23 | This file is part of VoiceXML::Client. | ||||||||||||
| 24 | |||||||||||||
| 25 | |||||||||||||
| 26 | |||||||||||||
| 27 | VoiceXML::Client is free software: you can redistribute it and/or modify | ||||||||||||
| 28 | it under the terms of the GNU General Public License as published by | ||||||||||||
| 29 | the Free Software Foundation, either version 3 of the License, or | ||||||||||||
| 30 | (at your option) any later version. | ||||||||||||
| 31 | |||||||||||||
| 32 | VoiceXML::Client is distributed in the hope that it will be useful, | ||||||||||||
| 33 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||||||||||
| 34 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||||||||||
| 35 | GNU General Public License for more details. | ||||||||||||
| 36 | |||||||||||||
| 37 | You should have received a copy of the GNU General Public License | ||||||||||||
| 38 | along with VoiceXML::Client. If not, see <http://www.gnu.org/licenses/>. | ||||||||||||
| 39 | |||||||||||||
| 40 | |||||||||||||
| 41 | =cut | ||||||||||||
| 42 | |||||||||||||
| 43 | |||||||||||||
| 44 | |||||||||||||
| 45 | 3 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 46 | |||||||||||||
| 47 | 3 | ▶ | use vars qw{ | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 48 | $VERSION | ||||||||||||
| 49 | 3 | }; | |||||||||||
| 50 | |||||||||||||
| 51 | 3 | $VERSION = $VoiceXML::Client::Item::VERSION; | |||||||||||
| 52 | |||||||||||||
| 53 | |||||||||||||
| 54 | |||||||||||||
| 55 | |||||||||||||
| 56 | 1 | ▶ | sub init { | ||||||||||
|
Subroutine
init: called CC=4 SCAR=14.6
Pod
documented
| |||||||||||||
| 57 | 1 | my $self = shift; | |||||||||||
| 58 | |||||||||||||
| 59 | 1 | ▶ | $self->{'next'} = $self->{'XMLElement'}->attribute('next') || ''; | ||||||||||
|
Condition50%1/2
$self->{'XMLElement'}->attribute('next') || ''
MC/DC0%0/1
$self->{'XMLElement'}->attribute('next') || ''
$self->{'XMLElement'}->attribute('next')
Truth table50%1/2
A
A= $self->{'XMLElement'}->attribute('next')
| |||||||||||||
| 60 | 1 | ▶ | $self->{'nextitem'} = $self->{'XMLElement'}->attribute('nextitem') || ''; | ||||||||||
|
Condition50%1/2
$self->{'XMLElement'}->attribute('nextitem') || ''
MC/DC0%0/1
$self->{'XMLElement'}->attribute('nextitem') || ''
$self->{'XMLElement'}->attribute('nextitem')
Truth table50%1/2
A
A= $self->{'XMLElement'}->attribute('nextitem')
| |||||||||||||
| 61 | |||||||||||||
| 62 | 1 | ▶ | VoiceXML::Client::Util::log_msg("GOTO created " . $self->{'next'} . '/' . $self->{'nextitem'}) | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 63 | if ($VoiceXML::Client::Debug > 1); | ||||||||||||
| 64 | |||||||||||||
| 65 | 1 | return 1; | |||||||||||
| 66 | |||||||||||||
| 67 | } | ||||||||||||
| 68 | |||||||||||||
| 69 | |||||||||||||
| 70 | 1 | ▶ | sub execute { | ||||||||||
|
Subroutine
execute: called CC=7 SCAR=24.0
Pod
undocumented
| |||||||||||||
| 71 | 1 | my $self = shift; | |||||||||||
| 72 | 1 | my $handle = shift; | |||||||||||
| 73 | 1 | my $optParms = shift; | |||||||||||
| 74 | |||||||||||||
| 75 | 1 | ▶ | VoiceXML::Client::Util::log_msg("Executing <goto>") if ($VoiceXML::Client::Debug > 1); | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 76 | |||||||||||||
| 77 | 1 | my $vxmlDoc = $self->getParentVXMLDocument(); | |||||||||||
| 78 | |||||||||||||
| 79 | 1 | ▶ | if ($self->{'next'}) | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 80 | { | ||||||||||||
| 81 | # a uri to go to... | ||||||||||||
| 82 | 0 | $vxmlDoc->nextDocument($self->{'next'}); | |||||||||||
| 83 | |||||||||||||
| 84 | |||||||||||||
| 85 | 0 | ▶ | VoiceXML::Client::Util::log_msg("GOTO Setting next document to " . $self->{'next'}) if ($VoiceXML::Client::Debug); | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 86 | 0 | return $VoiceXML::Client::Flow::Directive{'NEXTDOC'}; | |||||||||||
| 87 | } | ||||||||||||
| 88 | |||||||||||||
| 89 | 1 | ▶ | if ($self->{'nextitem'}) | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 90 | { | ||||||||||||
| 91 | 1 | my $parentForm = $self->getParentForm(); | |||||||||||
| 92 | |||||||||||||
| 93 | |||||||||||||
| 94 | 1 | ▶ | if ($parentForm->nextItem($self->{'nextitem'})) | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 95 | { | ||||||||||||
| 96 | 0 | $vxmlDoc->nextFormId($parentForm->id()); | |||||||||||
| 97 | } else { | ||||||||||||
| 98 | 1 | $vxmlDoc->nextFormId($self->{'nextitem'}); | |||||||||||
| 99 | } | ||||||||||||
| 100 | |||||||||||||
| 101 | 1 | ▶ | VoiceXML::Client::Util::log_msg("GOTO Setting next item to " . $self->{'nextitem'}) if ($VoiceXML::Client::Debug); | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 102 | |||||||||||||
| 103 | 1 | return $VoiceXML::Client::Flow::Directive{'JUMP'}; | |||||||||||
| 104 | } | ||||||||||||
| 105 | |||||||||||||
| 106 | |||||||||||||
| 107 | 0 | VoiceXML::Client::Util::log_msg("Goto::execute called but no next/nextitem set?"); | |||||||||||
| 108 | |||||||||||||
| 109 | 0 | return $VoiceXML::Client::Flow::Directive{'ABORT'}; | |||||||||||
| 110 | } | ||||||||||||
| 111 | |||||||||||||
| 112 | |||||||||||||
| 113 | |||||||||||||
| 114 | 3 | 1; | |||||||||||