eagles9999 wroteHi Ben,
No. You cannot create variables. I guess you are suggesting something like a Virtual in Magic. That is not possible in Aware.
However, there are other alternatives that are just as good, if not better....
Depending on you situation you can....
Option 1. Create a Non Persistent BO which will act like a variable repository all the while you can keep it in context. Once it is out of context it is gone. Much like a Virtual in Magic....once the task ends...it's dead.
Option 2. You can add number of scratch attributes to either the RegularUser (which means is available independently to all users) or to the SystemSettings (means there is only one instance of the Attributes)
I use a combination of both depending on the circumstances.
Regarding a tight loop and speed issue.....
Once the Instance of the BO is in context then it is as tight in the loop as you will get. It is not going back and forward to the DB to get it unless you are updating it every pass (in which case it will execute all the Rules of that BO)
Otherwise, it will behave just like the type of Virtual that you are used to.
Hope that helps.
Thanks Mark;
The none persistent BO is a good idea, but I have to be careful.
I thought about using system setting being in context, but the problem is that every 60 or 90 seconds that variable has to get updated, which means a DB trip.
Here is my situation. I have to run a background process (none user related) every xxx seconds (could be 60 or 90 or 120 or etc).
So in scheduling I write a simple rule:
If CURRENT_TIME>= Previously_Checked+60 Then process1
I need to have a variable that I called "Previously_Checked" which gets sets in Process1. So as the rule engine keeps evaluating the above rule, once the CURRENT_TIME is over Previously_Checked+60, then Process1 kicks in and the Previously_Checked variable gets updated with CURRENT_TIME
If I put the Previously_Checked in SystemSetting, every 60 seconds, it's going to update the DB. So I kind of ruled it out.
I could use the none persistent, but I need to have a guarantee that BO stays as long as the server is up.
That's my case.