Audit Records

Contains tips for configurators working with Aware IM
PEFS
Posts: 207
Joined: Mon Jun 12, 2006 11:25 pm

Audit Records

Post by PEFS »

Hello Aware IM,

I am the proud new owner of your product and have been having a great time developing web applications.

I have several apps that I would like to web enable. Many of these apps have code incorporated to capture the navigational movements of my administrators and the details of any changes.

The detail audit table has the following data:

Object Modified (Business Object)
Object Field Modified (Attribute)
Object Field Reference (ID, Name...etc)
Date/Time Modified
Type of Activity (Addition, Delete, Append, Update)
Original Data
Modified Data
User who Modified Record

From what I can tell this should be possible in Aware IM but since I am new at this I have not been able to make this work yet.

As you can imagine my audit tables have been very large in the past because it tracked everything that was added and deleted (as well as, updates to a record).

I hope that you can help me.

Thank you,

PEFS
aware_support2
Posts: 595
Joined: Sun Apr 24, 2005 2:22 am
Contact:

Post by aware_support2 »

Hello PEFS,

There are many ways to capture change history. I will describe a generic approach, which you can extend depending on the depth of information you want to record.

Object AuditTrail keeps a single change event and has the following attributes:
Name: MadeOn, Type: Timestamp, Initial value: CURRENT_TIMESTAMP
Name: MadeBy, Type: SystemUser
Name: ObjectID, Type: Number
Name: Description, Type: Text

To capture a change to a particular attribute, add a rule like the following to the object of interest (Person in this example):

If NOT(Person IS NEW) AND Person.DateOfBirth WAS CHANGED
Then CREATE AuditTrail WITH AuditTrail.MadeBy = LoggedInSystemUser, AuditTrail.ObjectID = Person.ID, AuditTrail.Description = 'Changed DateOfBirth on Person from <<OLD_VALUE(Person.DateOfBirth)>> to <<Person.DateOfBirth>>'


To capture creation of a new object, add a rule like this:

If Person IS NEW
Then CREATE AuditTrail WITH AuditTrail.MadeBy = LoggedInSystemUser, AuditTrail.ObjectID = Person.ID, AuditTrail.Description = 'Created new Person'


To capture deletion of an object, add a rule like this to the Rules When Object Is Deleted for the object:

CREATE AuditTrail WITH AuditTrail.MadeBy = LoggedInSystemUser, AuditTrail.ObjectID = Person.ID, AuditTrail.Description = 'Deleted Person'


You can also keep track of users logging in and out of the system. Please see sections Handling Login Events and Handling Logout Events in the Aware IM User Guide for details.
Aware IM Support Team
PEFS
Posts: 207
Joined: Mon Jun 12, 2006 11:25 pm

Thank you!

Post by PEFS »

Great feedback and advice.

I was able to get it to work except for the deletion part. I am unsure of where to add the rule.

Is there something I have to add to the IF section of the rule?

Thanks again for you help.
aware_support2
Posts: 595
Joined: Sun Apr 24, 2005 2:22 am
Contact:

Post by aware_support2 »

Unlike rules invoked when an object is created or changed, rules for object deletion are specified in a separate place. In the Configuration Tool tree on the left, expand the node for the object to which you are adding the rules. Right click "Rules (when object is deleted)" and click New. You do not need to add any conditions (the IF section) to the rule.
Aware IM Support Team
PEFS
Posts: 207
Joined: Mon Jun 12, 2006 11:25 pm

Post by PEFS »

I have added the deletion audit code and it works great.

Thank you for your prompt assistance!

Do you have any documents beyond the standard documentation with tips and hints on Business Rule possibilities?
aware_support2
Posts: 595
Joined: Sun Apr 24, 2005 2:22 am
Contact:

Post by aware_support2 »

Rule Language Reference contains detailed definitions of all rule elements, How To has some tips on using rules, and there is a lot of information about rules in User Guide. All of these documents can be found in the DOCS directory under Aware IM installation directory. Specific examples of rules can also be found in this forum.
Aware IM Support Team
autonomy2
Posts: 65
Joined: Thu May 18, 2006 10:58 am
Location: Sydney

Clarification

Post by autonomy2 »

Hi Support.

Am interested in implementing the approach suggested in this post;

Object AuditTrail keeps a single change event and has the following attributes:
Name: MadeOn, Type: Timestamp, Initial value: CURRENT_TIMESTAMP
Name: MadeBy, Type: SystemUser

Name: ObjectID, Type: Number
Name: Description, Type: Text

If the goal was to monitor changes to multiple BO's, the attribute ObjectID could still be used, irrespective of the business object? The AuditTrail Object would just require the business object ID as input?

If this is correct, then I assume that the ID's generated by AwareIM are unique to each Business Space version and increment with each instance created.
autonomy2
Posts: 65
Joined: Thu May 18, 2006 10:58 am
Location: Sydney

System Changes

Post by autonomy2 »

Hi Support.

Another question in regards to the suggested 'AuditTrail' approach.

If an attribute was updated by a Schedule System process, would this approach still work?
aware_support2
Posts: 595
Joined: Sun Apr 24, 2005 2:22 am
Contact:

Post by aware_support2 »

Every object instance has a unique ID within a business space.

The approach will work whenever an attribute is changed regardless of how the change was initiated (i.e. via web browser, scheduling, incoming email, external service request, etc.)
Aware IM Support Team
wings
Posts: 133
Joined: Mon Oct 20, 2008 7:59 am
Location: Australia

Post by wings »

Hi

Is it possible to audit when an object is viewed/accessed even thoug no changes have been made.
aware_support
Posts: 7525
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Post by aware_support »

Yes. Just make sure that an object is only accessed via a process. A process would create an audit record first and then show the form of the object by using the VIEW action.
Aware IM Support Team
Craig
Posts: 85
Joined: Sun Apr 26, 2009 1:26 pm

Post by Craig »

If NOT(Person IS NEW) AND Person.DateOfBirth WAS CHANGED
Is there a way to create an audit record not just when DateOfBirth is modified , but any of the BO Person attribute values has been changed.
aware_support
Posts: 7525
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Post by aware_support »

Yes, just check this:

If Person WAS CHANGED Then
...
Aware IM Support Team
Craig
Posts: 85
Joined: Sun Apr 26, 2009 1:26 pm

Post by Craig »

Support,

With this syntax How do i capture the details of the field which was changed? its not possible to record this with <<OLD_VALUE(Person)>> .
So how do i capture the change
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Post by tford »

Craig,
You could just have a before and after snapshot of the instance.
Tom
Tom - V8.8 build 3137 - MySql / PostGres
Post Reply