PromptStrategy extends AbstractTagStrategy { @Override public void execute(final VoiceXmlInterpreterContext context, final VoiceXmlInterpreter interpreter, final FormInterpretationAlgorithm fia, final FormItem item, final VoiceXmlNode node) throws JVoiceXMLEvent { final Object cond = getAttribute(Prompt.ATTRIBUTE_COND); if (Boolean.FALSE.equals(cond)) { LOGGER.info("cond '" + cond + "' evaluates to false: skipping prompt"); return; } final Prompt prompt = (Prompt) node; final Profile profile = context.getProfile(); final SsmlParser parser = new VoiceXml21SsmlParser(profile, prompt, context); final SsmlDocument document; try { document = parser.getDocument(); } catch (javax.xml.parsers.ParserConfigurationException pce) { throw new BadFetchError("Error converting to SSML!", pce); } final Speak speak = document.getSpeak(); final String lang = (String) getAttribute(Prompt.ATTRIBUTE_XML_LANG); if (lang != null) { speak.setXmlLang(lang); } final BargeInType bargeInType = getBargeInType(); final SpeakableSsmlText speakable = new SpeakableSsmlText(document, bargein, bargeInType); if (!speakable.isSpeakableTextEmpty()) { queueSpeakable(context, fia, speakable); } } PromptStrategy(); Collection<String> getEvalAttributes(); @Override void validateAttributes(final DataModel model); @Override void execute(final VoiceXmlInterpreterContext context,
            final VoiceXmlInterpreter interpreter,
            final FormInterpretationAlgorithm fia, final FormItem item,
            final VoiceXmlNode node);  }
@Test public void testExecute() throws Exception, JVoiceXMLEvent { final Block block = createBlock(); final Prompt prompt = block.appendChild(Prompt.class); prompt.addText("When you hear the name of the movie you want, just say it."); final Audio audio1 = prompt.appendChild(Audio.class); audio1.setSrc("godfather.wav"); audio1.addText("the godfather"); final Audio audio2 = prompt.appendChild(Audio.class); audio2.setSrc("high_fidelity.wav"); audio2.addText("high fidelity"); final Audio audio3 = prompt.appendChild(Audio.class); audio3.setSrc("raiders.wav"); audio3.addText("raiders of the lost ark"); setSystemOutputListener(this); final PromptStrategy strategy = new PromptStrategy(); final ImplementationPlatform platform = getImplementationPlatform(); platform.startPromptQueuing(30000); executeTagStrategy(prompt, strategy); final CallControlProperties props = new CallControlProperties(); platform.renderPrompts(null, null, props); final SsmlDocument ssml = new SsmlDocument(); final Speak speak = ssml.getSpeak(); speak.addText("When you hear the name of the movie you want, just say it."); final Audio ssmlAudio1 = speak.appendChild(Audio.class); ssmlAudio1.setSrc("godfather.wav"); ssmlAudio1.addText("the godfather"); final Audio ssmlAudio2 = speak.appendChild(Audio.class); ssmlAudio2.setSrc("high_fidelity.wav"); ssmlAudio2.addText("high fidelity"); final Audio ssmlAudio3 = speak.appendChild(Audio.class); ssmlAudio3.setSrc("raiders.wav"); ssmlAudio3.addText("raiders of the lost ark"); final SpeakableSsmlText speakable = new SpeakableSsmlText(ssml); Assert.assertEquals(speakable, queuedSpeakable); }