Genesys CTI User Forum

Genesys CTI User Forum => Genesys CTI Technical Discussion => Topic started by: gen_den on October 20, 2017, 03:48:56 AM

Title: How to call SCXML from IRD
Post by: gen_den on October 20, 2017, 03:48:56 AM
Hi Experts,

can you please let me know how I can call the SCXML flows from IRD?
My requirement is that from my IRD strategy  I need to execute SCXML flows, which will return some values. The value returned will be a JSON object.

How can i handle that ? Any suggestions ?

Thanks
Title: Re: How to call SCXML from IRD
Post by: Kubig on October 20, 2017, 07:48:12 AM
You can easily call ORS strategies via HTTP interface of ORS component - for more information follow the ORS documentation. Of course, you can "transfer" the interaction to the routing point or IQ where the ORS executed the logic.
Title: Re: How to call SCXML from IRD
Post by: gen_den on October 20, 2017, 07:54:04 AM
Thanks Kubig for the response. I used the Web Service block in IRD. I can hit SCXML but the JSON response which i am getting is not getting handled properly. in IRD i used all the data types to handle this response. But may be its JSON Object it doesnt save in any variable and the value is blank in logs.

I will try to post some logs
Title: Re: How to call SCXML from IRD
Post by: Kubig on October 20, 2017, 08:31:58 AM
Try to use this function in IRD "KVListFromJSON"
Title: Re: How to call SCXML from IRD
Post by: water235 on October 20, 2017, 03:08:59 PM
I was able to do something like this,
1. create a new InteractionData.
2. Create a RP - where you can load the SXCML logic
3. from URS transfer the call to that RP where you have got the SCXML
4. Include the logic in SCXML to attach the data on this Interaction Data that you created in URS. (Make check for looks) or redirect the call to a different RP on URS again
5.  once you get the data - do whatever you want to do.
7. you can convert the json to a string and attach to the attached data as well. (if you would prefer)
Title: Re: How to call SCXML from IRD
Post by: cavagnaro on October 20, 2017, 03:46:14 PM
[quote author=water235 link=topic=10701.msg48595#msg48595 date=1508512139]
I was able to do something like this,
1. create a new InteractionData.
2. Create a RP - where you can load the SXCML logic
3. from URS transfer the call to that RP where you have got the SCXML
4. Include the logic in SCXML to attach the data on this Interaction Data that you created in URS. (Make check for looks) or redirect the call to a different RP on URS again
5.  once you get the data - do whatever you want to do.
7. you can convert the json to a string and attach to the attached data as well. (if you would prefer)
[/quote]Seems kinda a lit bit complicated for just grabbing JSON. There are functions already in IRD that let you do this.

Enviado de meu E6633 usando Tapatalk

Title: Re: How to call SCXML from IRD
Post by: water235 on October 20, 2017, 05:00:30 PM
may be , but if he has the scxml, it is jsut attaching and reading the data -
he could directly use strigfy fn in scxml and attach in the attach data and his work is done.
Title: Re: How to call SCXML from IRD
Post by: cavagnaro on October 20, 2017, 06:43:52 PM
Or just use the IRD function that will do exactly the same and no need to have another point of control into his call flow.
Just different points of view


Enviado de meu E6633 usando Tapatalk

Title: Re: How to call SCXML from IRD
Post by: terry on October 20, 2017, 08:53:16 PM
Store entire JSON doc in some variable. Turn it into KVList by reassigning to LIST variable or by using KVListFromJSON function and after that use KVList access functions (like KVListGetStringValue) to get specific values. 
Title: Re: How to call SCXML from IRD
Post by: vmc on October 21, 2017, 01:00:52 AM
Agree with most responses.  I've handled JSON queries completely within URS/IRD.

Less complicated and easier to troubleshoot.

Sent from my Redmi Note 3 using Tapatalk

Title: Re: How to call SCXML from IRD
Post by: gen_den on October 21, 2017, 05:10:52 AM
Thank you Guys.. for the comments.
I will try the suggestions and let you know :)