Focal Point
[SOLVED] parameter in fex not refreshed

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/1087070776

July 03, 2015, 01:54 PM
as2010
[SOLVED] parameter in fex not refreshed
Hi,

I have a web appliction which calls focexec via url like this:

_http://host?WFServlet=fign00001

I have in web client the setting _site_profile = -INCLUDE ig1.fex\n

This fex generates a random number like this:
-SET &nounce = ABS( RDUNIF(I1)*10000000);

My problem is I need this number to be unique in each http requests. If I throw several requestes like this:

_http://host?WFServlet=fign00001&par=a
_http://host?WFServlet=fign00002&par=a
_http://host?WFServlet=fign00001&par=a

the nounce varaible has allways the same value in all 3 requests which I don't want.

Is there anyway to force the &nounce variable to always be updated?

Thanks so much for your help.

This message has been edited. Last edited by: <Kathryn Henning>,


7706M
AIX 7.1
HTML
July 04, 2015, 10:42 PM
j.gross
quote:
-SET &nounce = ABS( RDUNIF(I1)*10000000);

Look up the syntax of the function.

RDUNIF returns a floating-point value, between 0 and 1. But by specifying an integer format (I1), I believe you are forcing whatever result is computed to then be truncated to an integer, so &nounce will always be zero. Change it to a D format ('D1' will do) and see what happens.


- Jack Gross
WF through 8.1.05
July 05, 2015, 10:06 PM
StuBouyer
Parameter values get calculated before the report syntax is checked and run.

The only way to get a new value for &nonce is to run the command again, but it will still be the same value in multiple locations if you use it multiple times.

For your example the simplest option would be to concat the parameter with servlet name - thus it would always be unuqie

_http://host?WFServlet=fign00001&par=fign00001|a
_http://host?WFServlet=fign00002&par=fign00002|a
_http://host?WFServlet=fign00001&par=fign00003|a

alternatively you can programatically write out your requests and DEFINE the nonce values as a field name - a tad more complicated but will give you different versions of nonce


WebFOCUS 8.2.03 (8.2.06 in testing)
July 06, 2015, 06:21 AM
as2010
@j.gross: THe value is not zero.

@StuBouyer: My solution was to put the focexec name in the nouce with the user and the timestamp. This covers almost all the possibilities.
I thought to pass the nouce value in the request:

_http://host?WFServlet=fign00001?par=a&nounce=123456
_http://host?WFServlet=fign00002?par=a&nounce=78901
_http://host?WFServlet=fign00001?par=a&nounce=53145

So the value would be calculated in web application (javascript) which demands the requestes and then is read in focexec.

Thank you so much.

AS


7706M
AIX 7.1
HTML