It works partially with the <foreach>.
Partially because I can only use the ecma script variables in certain types of tags. For example, the ones in green below are working fine, perhaps mcp does not allow me to do the same on the ones in red (Unlesss I´m doing something wrong).
<script>
var parameters = {};
parameters.prompts = ["1.vox","2.vox"];
parameters.inputmodes = "dtmf";
parameters.bargein = "true";
parameters.minlength = "1";
parameters.maxlength = "5";
var interdigittimeout = "3s";
</script>
<property name="inputmodes" value="
parameters.inputmodes" />
<property name="bargein" value="
parameters.bargein" /> <
block name="Input1P0">
<prompt gvp:langexpr="AppState.APP_LANGUAGE">
<foreach array="parameters.prompts" item="itemCollection">
<audio expr="'../Documentos/prompts/' + itemCollection"></audio>
</foreach>
</prompt>
.....
.....
.....
Thanks ina advance for your help.
------------------------------
Amauri de Oliveira
Alctel Telecom
http://amaurioliveira.com------------------------------
Original Message:
Sent: 09-04-2018 19:25
From: Jason Mclennan
Subject: Print scxml/vxml statements using Ecma script and loops
Is there any reason you can't use a standard loop + prompt blocks available in composer?
------------------------------
Jason Mclennan
Commonwealth Bank of Australia
Original Message:
Sent: 09-01-2018 04:27
From: Amauri de Oliveira
Subject: Print scxml/vxml statements using Ecma script and loops
Hello all.
Does anyone knows how to create loops inside ecma script to print scxml or vxml ? The idea is to iterate through an array of prompts and play each one of them.
------------------------------
Amauri de Oliveira
Alctel Telecom
http://amaurioliveira.com
------------------------------