Audit Trail module: Loggin of reference (set) - readable old/new values

1
Hi guys, For the Audit-Trail module I face the following challenge: When the java-action creates a logline for a reference or reference set, all information about the referenced object is copied to the new/old values string which makes it quite unreadable. Is there a way to only see one attribute/member in de new/old values instead of all? I read something about using the Model Reflection module (#6 ), but I don't know how I have to do this. Thanks, Jacob
asked
1 answers
2

How I implemented this is by creating an extra attribute on the reference table from the MxModelReflection. With this, for every reference you can maintain what is the key attribute of the referenced object you want to show. You could populate these values after startup or in the front end of the model reflection.

Now comes the hard part; I created an extra java action to change the logging of the full referenced object. First in the before commit Java action of the Audit Trail module I retrieve all logged references in a sub micro flow. For each reference I call this java action I created, to change the logging from full associated object to just the key attribute of that associated object, by doing a lookup on the key attribute that was set in the MxModelReflection reference table.  

So, the key part of this Java actions is that it used the key attribute, let’s say ‘Name’ and searches for ‘Name: <value>’ part in the already created logline with as new value the full associated object, so something like a ‘Attribute a: <value attribute a>, ‘Name: <value name>, Attribute b: <value attribute b>,….’. The Java action only picks <value name> out of this string and sets it as it’s new value. This actually needs to be done both for the oldvalue and newvalue attribute.

Hope this points you in the right direction!

answered