Timing of INSERT to RegularUser BO

Contains tips for configurators working with Aware IM
Post Reply
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Timing of INSERT to RegularUser BO

Post by tford »

I recently built functionality into a BSV that allows users to "watch" certain changes in milestones of prospects in our system (a very crude version of what Facebook does). The system instances in a MilestoneLog BO as attributes of Prospect are changed. Another process sweeps through the MilestoneLog entries that have not been posted yet to the users "watching" each milestone & INSERTs then the MilestoneLog instances to the appropriate RegularUsers. I struggled with getting this final part to work properly when I tried to execute it during the creation of each MilestoneLog entry.

One issue is that the system was inserting instances to RegularUser accounts of OTHER users (users who are watching for changes in Milestones that I was making for example). Because I make extensive use of storing filters in RegularUser, I was finding that the system was making changes to a BO instance I had on the screen.

I couldn't easily account for this situation in Auto Refresh so I decided to have the last part (INSERTing the BOs to the RegularUser accounts) happen when each user is logging in. When a user logs in, the system now goes out and identifies MilestoneLog entries that have not been posted to that RegularUser account & INSERTs them accordingly. When that process runs, the system does NOT post MilestoneLog entries to other users.
Tom - V8.8 build 3137 - MySql / PostGres
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Re: Timing of INSERT to RegularUser BO

Post by tford »

I found the NMB_OF_SESSIONS function today which now allows me to determine if each RegularUser is Logged In who is to be notified of a Milestone change.

This now allows me to have a process that iterates through the Milestone Log entries that have not been posted to the notify RegularUser instances at a variety of times:
- Each time to new Milestone Log entry is created
- When a user logs in
- When a user logs out
Tom - V8.8 build 3137 - MySql / PostGres
Post Reply