UserDefined Variables

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
phaider
Posts: 37
Joined: Mon Dec 08, 2008 10:49 am
Location: Austria
Contact:

UserDefined Variables

Post by phaider »

Hello,
i am a beginner with AwareIM and was exploring the basic concept of AwareIm. I miss the possibility of assigning user defined variables (Strings, integer, etc...) for using them within processes during the execution of rules.
Didn't i only find it? or is there a workaround.
What concept exist for such a request
Regards
Peter
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Post by tford »

Peter,

You can store variables in the attributes of either RegularUser or SystemSettings and they will always be in context and able to be used in processes.

RegularUser would be used for variables that are user specific while SystemSettings would be used for variables that apply to all users.

To refer to a RegularUser atttribute in a process rule, the format is: LoggedInRegularUser.AttributeName.

Tom
Tom - V8.8 build 3137 - MySql / PostGres
phaider
Posts: 37
Joined: Mon Dec 08, 2008 10:49 am
Location: Austria
Contact:

Post by phaider »

Tom,

thanks for your answer - i can accept that.

But - i have a feature request for future releases of AwareIM.

Temporarly attributes (=variables, values will expire, when execution of the process is finished) for processes - handled like attributes for BO; maybe i comes in the future...

Peter
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Post by tford »

There are also non peresisted BOs.

If you'd like to share what you are trying to accomplish in a process, maybe we can help.
Tom - V8.8 build 3137 - MySql / PostGres
GertV
Posts: 112
Joined: Thu Sep 10, 2009 9:39 am
Location: Bangkok, Thailand
Contact:

Post by GertV »

Hi Tom,

I need the same feature and tried your solution. So in a process I do the following:

LoggedInRegularUser.CurrentObject=Nieuwsbrieven.ID

When I run this I get the following error message:

-Unable to find business objects to modify attribute RegularUser.CurrentObject

From your previous post I understood that the RegularUser object is always in context. Am I missing something?
Gert (running V8.0 build 2378 on Windows Server 2008)
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Post by tford »

Yes, LoggedInRegularUser is always in context.

Can you share more about how you are using this rule?
Tom - V8.8 build 3137 - MySql / PostGres
GertV
Posts: 112
Joined: Thu Sep 10, 2009 9:39 am
Location: Bangkok, Thailand
Contact:

Post by GertV »

Hi Tom,

With pleasure. I need to send newsletters to two different BO's, one is Members, the other Friends. On the newsletter form I created a button that calls a procedure SendNewsletters.

This procedure does the following:

LoggedInRegularUser.CurrentObject=Newsletter.ID
(whereby CurrentObject is a numeric field in RegularUser)
SendNewsletterToMember
SendNewsletterToFriend
(The latter are two procedures that handle the sending of the Newsletter to the two different BO's. They have been tested and work)

Just running this gives me the error -Unable to find business objects to modify attribute RegularUser.CurrentObject the moment the procedure starts. It looks to me that this means that LoggedInRegularUser is therefor not in the context.
Gert (running V8.0 build 2378 on Windows Server 2008)
GertV
Posts: 112
Joined: Thu Sep 10, 2009 9:39 am
Location: Bangkok, Thailand
Contact:

Post by GertV »

Hi Tom,

With pleasure. I need to send newsletters to two different BO's, one is Members, the other Friends. On the newsletter form I created a button that calls a procedure SendNewsletters.

This procedure does the following:

LoggedInRegularUser.CurrentObject=Newsletter.ID
(whereby CurrentObject is a numeric field in RegularUser)
SendNewsletterToMember
SendNewsletterToFriend
(The latter are two procedures that handle the sending of the Newsletter to the two different BO's. They have been tested and work)

Just running this gives me the error -Unable to find business objects to modify attribute RegularUser.CurrentObject the moment the procedure starts. It looks to me that this means that LoggedInRegularUser is therefor not in the context.
Gert (running V8.0 build 2378 on Windows Server 2008)
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Post by tford »

To narrow down the problem, try running this process from a Query of the Newsletter BO.
Tom - V8.8 build 3137 - MySql / PostGres
GertV
Posts: 112
Joined: Thu Sep 10, 2009 9:39 am
Location: Bangkok, Thailand
Contact:

Post by GertV »

Sorry Tom, it's happening from the query form of Newsletters.
Gert (running V8.0 build 2378 on Windows Server 2008)
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Post by tford »

A shot in the dark here.

I wonder if CurrentObject might be a reserved word. Maybe try to make the attribute name RegularUser.ChosenNewsletter
Tom - V8.8 build 3137 - MySql / PostGres
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Post by tford »

Does it have the same error message if you eliminate calling the 2 other processes so that you just have 1 rule in the process?
Tom - V8.8 build 3137 - MySql / PostGres
GertV
Posts: 112
Joined: Thu Sep 10, 2009 9:39 am
Location: Bangkok, Thailand
Contact:

Post by GertV »

Tom,

Followed both suggestions. No change. Here's the error message again:

-Unable to find business objects to modify attribute RegularUser.ChosenNewsletter
Gert (running V8.0 build 2378 on Windows Server 2008)
BobK
Posts: 548
Joined: Thu Jan 31, 2008 2:14 pm
Location: Cincinnati, Ohio, USA

Post by BobK »

Gert,

Are you still having a problem with this?

I am thinking that the newsletter object is what the error message is referring to that cant be found.

Are you running this process when trying to create a newsletter or on an existing newsletter object?
Bob
GertV
Posts: 112
Joined: Thu Sep 10, 2009 9:39 am
Location: Bangkok, Thailand
Contact:

Post by GertV »

Bob, Tom and others suffering with this,

I found out the following:

My business object group SystemUser had to BO's underneath: RegularUser and Members.

I got the error when I logged in as a member, however when I logged in as admin it worked. If you do the following it works in all cases.

Define a field say ChosenNewsletter in Members and when you save it, make sure AwareIm updates the other BO's in the group as well. Now, in my case,I needed to save the Newsletter I was working on, so I defined the following rule:

LoggedInSystemUser.ChosenNewsletter=Newsletter.ID

This will work for both admin and a member that is logged in.

Credits go to Tom, without whom I would not have been able to figure this out.
Gert (running V8.0 build 2378 on Windows Server 2008)
Post Reply