Some rule questions

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
Elmar
Posts: 62
Joined: Tue Mar 06, 2007 12:19 pm

Some rule questions

Post by Elmar »

Hi there.

As a newbie to AwareIM I have some -probably easy- questions.

1.) I have some BO´s grouped in in BO Groups. AwareIM offers my to apply rules that I create for one BO to other BO´s within this group. My question is how to refer to the rules owning BO without hardcoding it´s name? That way I could really use the rules on the other BO´s in this group.

2.) I have an object of type Appoinment that potentially contains child objects. These objects each carry a duration attribute. The sum of these objects plus the starttime of the container Appointment object should result in the Appointment endtime.

To accomplish this I figured out that I need to implement the recalculation rule in the child object each time an object instance is created or changed

I figured ot that it could be something like this (Exercise is the parent container & and Activity is the child object):

If Activity IS NEW OR Activity WAS CHANGED Then
FIND Activity WHERE Exercise = ThisExercise
ThisExercise.EndTime = ThisExercise.StartTime + Activity.Duration

But I don´t know how to reference the parent BO correctly from within the rule of the child object... and if this is the right way to do it anyway
:D.

Thanks for reading.
Elmar
aware_support2
Posts: 595
Joined: Sun Apr 24, 2005 2:22 am
Contact:

Post by aware_support2 »

Hi Elmar,

1) You can use the group name rather than object name when adding a rule to an object. This way the same rule can be applied to other member-objects without having to make any changes. If you later make a change to such a rule on one of the objects, the system will prompt you whether to apply the change to identical rules on other member-objects.

2) Your rule could look like this:

If Exercise.Activities WAS CHANGED OR Activity FROM Exercise.Activities WAS CHANGED Then
Exercise.EndTime = Exercise.StartTime + SUM Activity.Duration WHERE (Activity IN Exercise.Activities)
Aware IM Support Team
Elmar
Posts: 62
Joined: Tue Mar 06, 2007 12:19 pm

Post by Elmar »

Wow. Now that looks very elegant. I have to get a better feeling for the query language and how objects are referenced in AwareIM.

Will give your example a go and get back with the results.
Thanks a lot.

Elmar
Elmar
Posts: 62
Joined: Tue Mar 06, 2007 12:19 pm

Post by Elmar »

Hi there.

If I try to apply this rule it gives me the warning that:
Possibly wrong object identifier Exercise is used in path Exercise.EndTime...
Possibly wrong object identifier Exercise is used in path Exercise.Activity...
Possibly wrong object identifier Exercise is used in path Exercise.StartTime...

So I still think I need to write something like (I know the Syntax is not AwareStyle):
This.(Exercise)Parent.<Attribute>

I am surely missing something obvious here and it would be great if you could help me out.

Thanks,
Elmar
Elmar
Posts: 62
Joined: Tue Mar 06, 2007 12:19 pm

Post by Elmar »

Sorry. I figured out that I have to use this rule in the Exercise parent object.
Post Reply