Hi Guys, so I have been wrecking my Brain to try and solve this. Here is the scenario.
I have a need to develop a network where users can be linked to other users on more than one level by means of referring other users. The problem I have is with context in Aware IM to be able to link a user to the user above him and also to the user above the user above him. i.e. 2 levels up.
So to illustrate:
User = Pete
MyNum - Pete123
Referred By - <UNDEFINED>
User = John
MyNum - John123
Referred By - Pete123
User = Eddie
MyNum - Eddie123
Referred By - John123
If got User Setup with a Peer/Multiple relationship to itself i.e. other users.
A user can register himself and if he completes the ReferredBy number on Regsitration then I Do the following to create the relationship:
****** PART1 *******
IF User IS NEW and User.ReferredBy is DEFINED
FIND User WHERE User.MyNum = ThisUser.ReferredBy
INSERT ThisUser IN ThatUser.User
******* PART1 ******
This works perfectly. The headache comes in with the AutoCreating the relationship with Pete. So When Eddie Registers and tells the system he was referred by John123. However, now I want to check to see if John's "ReferredBy" is completed and if So then Eddie must be Added To John's Parent's.user also. (In This case...Pete).
The problem is that there will always be three Users Who has to be in context to be able to do this... and as we know You can only handle two in AwareIM using 'this' and 'that'.
If tried many variations but cannot seem to figure out how to model this to work or if it is even possible.
Let me know if anyone has any fancy ideas. ๐
Thnx for allowing me to pick your brains.
Kind Regards
Hein