Genesys CTI User Forum

Genesys CTI User Forum => Genesys CTI Technical Discussion => Topic started by: Mikael Jansson on September 25, 2009, 07:53:36 AM

Title: Parse XML string in routing strategy
Post by: Mikael Jansson on September 25, 2009, 07:53:36 AM
Hi !
In ounr email enviromment we get a sting in "xml-format".

Ex:
<TechnicalHeader><Reply-to></Reply-to><CustomerId></CustomerId><MailItemId></MailItemId><ActionCode>FORWARD</ActionCode><UserID></UserID><ChannelId></ChannelId></TechnicalHeader>

What I need to do is to update the key <ActionCode>.(ex change  FORWARD to REPLY).
Dont't find any function in Sting maipulation to do this in a good way.

Using routing 7.6.

Anyone got any ideas.

Regards Mikael
Title: Re: Parse XML string in routing strategy
Post by: René on September 25, 2009, 08:29:50 AM
Hi Mikael,

As you know there are no functions related to XML available in IRD. If you need just change value of one parameter then I would use StrReplace function (StrReplace[<variable>,'<ActionCode>FORWARD</ActionCode>','<ActionCode>REPLY</ActionCode>']). I know it isn't "elegant" solution but it should work. if you don't know initial value of the key "ActionCode" then you would need to do some string parsing (using IRD functions StrChar and StrSub).

R.
Title: Re: Parse XML string in routing strategy
Post by: BenTaylor on September 25, 2009, 09:53:57 AM
I think it would be best to write your own subroutine to do this. As René says, you're going to have to use the string manipulation functions to make it work.
Title: Re: Parse XML string in routing strategy
Post by: Mikael Jansson on September 25, 2009, 10:05:24 AM
Thanks, hpofylle somewhere in the future this would be included now when we have soap in the system this will be more and more used i guess.
I will post my solution here soon.
/ Micke
Title: Re: Parse XML string in routing strategy
Post by: Mikael Jansson on September 25, 2009, 10:50:09 AM
Hi !
Here comes my solution, it's not pretty but it does the job.  ;)

It's a strategy that will be converted to a subroutine that takes teh xml-sting, tag to be updated and value.

Regards
Micke