07-29-2021 02:20 AM - edited 07-29-2021 02:21 AM
Hi All.
I am trying to get the session id for the each call and trying to pass that to Cisco AQM as meta data.
The session ID has to be retrieved by data type Long, but when I pass this value to AQM its not accepting as its not string.
How can I convert this Long data type to String? Any one has java codes for that?
Kind regards
Pragash
07-29-2021 05:37 AM
You don't have to do anything that complex. You can use a "set" step and set a string variable to the value of the "long" variable.
07-29-2021 06:49 PM
07-30-2021 12:00 AM - edited 08-02-2021 12:42 AM
I would think that it would be caused by the L at the end of the Long variable. I don’t think that you can have any letters in a string variable as it expects only digits. You could use the substring function in the expression language to strip that, likely you’d also need to get the length off the content of the long variable, anyway if it could vary in length. Do a search on Google and I’m sure you’ll be on your way in no time.
This is a good starting point for many things that can be done by the expression editor and modifications of strings https://www.google.se/amp/s/samiamsamdotcom.wordpress.com/2014/01/06/operating-on-strings-part-i/amp/
08-01-2021 08:29 PM
Thanks Rogger for your time and reply. I figured out this last night.
1. I set the variable to S_ConSessLong2String (String)
2. In the value under Java tab added this code Long.toString(L_SessionInfo) - L_SessionInfo - Long data type received from Get Session Info step. Refer 5 and 6 Image.
08-02-2021 12:35 AM
Great that you where able to find a workable solution and thank you for reporting your solution for the greater benefit of the community.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide