Re: Use of AmGetUserEnvSessionItem() and AmSetUserEnvSessionItem() (157 Views)
Reply
Frequent Advisor
Scott_Hamilton
Posts: 50
Registered: ‎02-01-2011
Message 1 of 4 (157 Views)

Use of AmGetUserEnvSessionItem() and AmSetUserEnvSessionItem()

I would like to get more utility out of the API functions AmGetUserEnvSessionItem() and
AmSetUserEnvSessionItem(). I discovered these by chance in the ProgRef manual and started
using them to allow wizards to inter communicate. I know of no other way for a called wizard
to pass data back to its caller (this used to be possible in days of yore).

I would like to know if this is a bullet proof mechanism that will always be available. I also have
a few questions regarding use of this method:

   Where is the data stored when executing AmSetUserEnvSessionItem? It appears to just be out there
   somewhere. How persistent is this data structure? If the process that Sets it dies, is it still
   there?
   Is this data structure cordoned off within the user session space? In other words it two user both
   use the same wizard which calls AmSetUserEnvSessionItem are these data structures held seperately
   for each user session? The function names indicates that they are but I would like to know for sure.
   
I would be interested in knowing how you all feel about using these two functions in everyday use. I
have used them extensively in a large development environment but I always had a nagging feeling of
uncertainty as they are virtually undocumented and I am not sure for what use they were intended.

Scott

Please use plain text.
Advisor
Paul-Eric Paumard
Posts: 10
Registered: ‎09-08-2006
Message 2 of 4 (157 Views)

Re: Use of AmGetUserEnvSessionItem() and AmSetUserEnvSessionItem()

Scott,

 

I'm gathering info on this topic and will post answer as soon as possible.

Stay tuned.

Paul-Eric Paumard
HP Software
Please use plain text.
Advisor
Paul-Eric Paumard
Posts: 10
Registered: ‎09-08-2006
Message 3 of 4 (157 Views)

Re: Use of AmGetUserEnvSessionItem() and AmSetUserEnvSessionItem()

Scott,

 

These two functions AmGetUserEnvSessionItem() and AmSetUserEnvSessionItem() were originally created mainly to be used by the developers within AM. Therefore from an end user point of view, there is really no specific use for them.

 

That being said, to answer your questions:

 

Is this a bullet proof mechanism that will always be available?
Like any other exposed API, these functions follow the same rules. For now there is no reason for them to just disappear.

 

Where is the data stored?
It is stored as a record in the amSysConfig table.

 

How persistent is this data structure?
Since it is stored in amSysConfig table, the information is persistent between user sessions.

 

If two users both use the same wizard which calls AmSetUserEnvSessionItem() are these data structures held separately  for each user session?

Yes, the record is user dependent. The record in amSysConfig will have an ‘lEmplDeptId’ value equal to the user Id who generated the call of AmSetUserEnvSessionItem().

 

One usage you could get out of these functions for instance would be a Wizard that would have an additional page (or pages) the first time a user is running this Wizard.

 

Let me know if you have other questions.

Paul-Eric Paumard
HP Software
Please use plain text.
Frequent Advisor
Scott_Hamilton
Posts: 50
Registered: ‎02-01-2011
Message 4 of 4 (157 Views)

Re: Use of AmGetUserEnvSessionItem() and AmSetUserEnvSessionItem()

Thanks very much for the feedback. Very useful information that. Scott
Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation