GET_CHANGES output - Audit BO

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
wings
Posts: 133
Joined: Mon Oct 20, 2008 7:59 am
Location: Australia

GET_CHANGES output - Audit BO

Post by wings »

I am using the new function GET_CHANGES to implement an audit of BO's.

The formatted output of this uses tabs and CR/LF and when I display the data it is not formatted correctly as follows:

Modified instance 200288 of Address
AttributeOld valueNew value
HouseNumber222
FormattedAddress11/2 Jones Street11/22 Jones Street
UpdatedOn 2009-09-27T15:20:00 2009-09-30T18:50:00
UnitNumber111

This is not readable. I could write a rule to replace the tabs and CR/LF and mark it up as html but there isn't a function that allows me to replace tabs or CR/LF that I can find.

Any suggestions?
Using 4.8 Build 1266
tazzmaxx
Posts: 125
Joined: Tue Sep 02, 2008 2:13 pm

Post by tazzmaxx »

I have noticed that GET_CHANGES does not work for any system related changes.

I have GET_CHANGES implemented so that if there was any change to the record an audit is created. When something like a status change (which is made by a rule) occurs then the GET_CHANGES function does not work. Why is this so? Shouldn't it capture all changes whether they are made directly or indirectly to the record?
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Post by tford »

Can you describe your situation in detail so I can see if I can reproduce it?
Tom - V8.8 build 3137 - MySql / PostGres
aware_support
Posts: 7532
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Post by aware_support »

You can try replacing '\t' and '\n' symbols using REPLACE function (not sure if it will work, though)

If GET_CHANGES is used in the rules of an object, it should be the last to execute, which you can achive by setting the priority of the rule
Aware IM Support Team
tazzmaxx
Posts: 125
Joined: Tue Sep 02, 2008 2:13 pm

Post by tazzmaxx »

I have a rule that fires when a record changes that calls the GET_CHANGES function. The rule is as follows:

If Client WAS CHANGED Then
CREATE AuditRecord WITH AuditRecord.Description=GET_CHANGES(Client),AuditRecord.AuditObject=AuditObjects,AuditRecord.BOID=Client.ID,AuditRecord.BOName=Client.ObjectIdentifier,AuditRecord.MadeBy=LoggedInSystemUser.LoginName

I have changed the priority of this rule to the lowest value but it does not work when processes change the record only when changes are made directly to the record.

An example is a process that automatically changes the Status of the this record from one status to another. This is the type of information that we must have an audit record for. When the process runs the record changes to another status and a audit record is written that looks like the following:

Modified instance of 11462 of Client
Attribute Old value New value


There is nothing under the old and new values.

Any ideas?

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

Post by tford »

Do you have any PROTECT action on Client?
Tom - V8.8 build 3137 - MySql / PostGres
tazzmaxx
Posts: 125
Joined: Tue Sep 02, 2008 2:13 pm

Post by tazzmaxx »

Hi Tom,

Yes, PROTECT is being used in another rule on the Client BO
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Post by tford »

You will have to allow system changes in the PROTECT.
Tom - V8.8 build 3137 - MySql / PostGres
tazzmaxx
Posts: 125
Joined: Tue Sep 02, 2008 2:13 pm

Post by tazzmaxx »

I removed PROTECT completely from Client and it still operates the same. Could it be anything else?
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Post by tford »

Have you looked at the logs?
Tom - V8.8 build 3137 - MySql / PostGres
tazzmaxx
Posts: 125
Joined: Tue Sep 02, 2008 2:13 pm

Post by tazzmaxx »

I always do...but in this case I did not see anything. I am creating a separate bsv to see if I can create the same outside of my larger bsv.
tazzmaxx
Posts: 125
Joined: Tue Sep 02, 2008 2:13 pm

Post by tazzmaxx »

Hey Tom,

I created a separate bsv and I still have the problem with system changes to the record.

The design is such that an audit record should be created for any change to the Client record but if I fire off a process to change the status from state to another the system does not record anything.

Would you have a few extra minutes to check out the bsv?

Thanks
tazzmaxx
Posts: 125
Joined: Tue Sep 02, 2008 2:13 pm

Post by tazzmaxx »

Support,

Can you confirm whether or not GET_CHANGES is supposed to work for system changes. I cannot get it to work for something as simple as changing a status via a process from one state to another. The GET_CHANGES function only seems to work for changes made within the BO.

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

Post by tford »

Yes, GET_CHANGES works for system changes.

I created a BSV with this rule on the RegularUser BO:

CREATE Logit WITH Logit.Hold=GET_CHANGES(RegularUser)

It created new instances of Logit BO when changes were made to RegularUser.
Tom - V8.8 build 3137 - MySql / PostGres
tazzmaxx
Posts: 125
Joined: Tue Sep 02, 2008 2:13 pm

Post by tazzmaxx »

I agree that it will create a record for the changes but it will not tell you what changes were made. Please try the following and let me know what you get:

1. Add a new attribute to RegularUser called Status with the options of OPEN or CLOSED

2. Create a process called StatusChange and enter the following rule:

RegularUser.Status = 'CLOSED'

3. Add a button to the RegularUser form and click the button

You will have a Logit record created but it will only have the following:

Modified instance 12423 of RegularUser
Attribute Old value New value

This is nice because it states that a change was made but it appears that the GET_CHANGES does not work for system changes. I would expect to see that the Old value was Null and the New Value is CLOSED
Post Reply