Where am I?

Contains tips for configurators working with Aware IM
Post Reply
RocketRod
Posts: 907
Joined: Wed Aug 06, 2008 4:22 am
Location: Melbourne

Where am I?

Post by RocketRod »

As a developer there are times when you may want to create a process based on where a user is located within your application. For example a help system or tip system where the page displayed is relevant to the BO or query currently displayed. One simple method to achieve this is to have an attribute(s) on the regular user BO that stores the names of the currently displayed queries or BOs. In other words the users current position in your application. Then it's a simple matter of using that in any process or way you might like to choose. For example:

1. Display a help page = LoggedInSystemUser.TempAwareName

2. Display a tip = LoggedInSystemUser.TempAwareName

The question is how do you get the position of the user and store it? Simple. Put in the initialization script a start process with parameters call :

AwareApp.startProcessWithInit('StorePosition','main','Position','AwareName=MyQueryName@AwareType=Query')

or

AwareApp.startProcessWithInit('StorePosition','main','Position','AwareName=MyBOName@AwareType=BO')

Then in your process StorePosition (which has the Position BO passed as a parameter),

LoggedInSystemUser.TempAwareName=Position.AwareName
LoggedInSystemUser.TempAwareName=Position.AwareType

This ends up with

LoggedInSystemUser.TempAwareName='MyBoName'
LoggedInSystemUser.TempAwareName='Query'

So I know my user is in the query called MyBoName. Now knowing that I can do whatever I like! A couple of things to note.

1. You need to clean out the Position BO instances now and then.
2. It only keeps the last spot that the user was in.

Cheers Rod
hpl123
Posts: 2579
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Nice

Post by hpl123 »

Nice..
Henrik (V8 Developer Ed. - Windows)
Post Reply