Hello,
We haven’t used SCXML very much in OCS, but have played around with it for POC purposes.
In the SCXML samples provided with OCS, I have noticed what seems to be some JavaScript functions embedded in tags as you might see in HTML source code. OCS Guides do make vague reference to JavaScript in SCXML files.
I am wondering if anyone has attempted to use the JavaScript object XmlHttpRequest from within an SCXML treatment.
Here is my reason for asking. I would like to enable pre dial validation in OCS for a campaign. I want the pre dial validation to do 2 things:
- Set CPN digits dynamically based on some data attached to the individual record (there is a nice OCS SCXML sample on how this is done, works nicely for us)
- Consume an endpoint and receive HTTP 200 or HTTP 409 indicating whether or not the record is still eligible to be dialed (explained in OCS deployment guide)
I see that accomplishing these 2 items is possible, but maybe not at the same time.
For example to accomplish item 1:
Set pre-dial-validation to true
set validation-uri to URI of my SCXML file that will set CPN digits for that outbound record
To accomplish item 2:
Set pre-dial-validation to true
set validation-uri to URI of web service endpoing that returns HTTP 200 if it is okay to call record or HTTP 409 if it is not okay to call record with a JSON payload (OCS deployment guide explains this well)
My trouble is, how do I accomplish both at the same time only specifying 1 validation-uri? I asked specifically about XmlHttpRequest JavaScript object in SCXML because perhaps it is possible for me to consume an endpoint within the SCXML script.
Any thoughts are appreciated. I am actively testing and will follow up if I come up with a way to do this.
Regards,
Andrew