Hi
Is there possibility to audit changes in registered table, using standard audit trail feature from Documentum (as for example I can register that documentum audits changes for my custom object type)?
I think that for your registered table whether it's created in Sql Server or Oracle for example; you can create triggers for this table to track insert / update & delete actions to insert into another table lets say it will have the name "table_name_log", then you can register the log table also so you can execute DQLs on it and see track of events that happened on your original table. I didnt try that but i think it's possible.
Hmm, interesting idea, but I would need the name of the logged user on documentum repository, who did the changes to registered table...
if you register the audit event with the corresponding paramters they can be found easily
select user_name from dm_audittrail where event_name='<eventname>'
I'm sorry I didn't understand what you suggest. Can you elaborate your hint?
auditTrailObject = session.newObject("dm_audittrail");
auditTrailObject.setId(DmAuditTrailEnum.AUDITED_OBJECT_ID.getValue(), new DfId(objectId));
auditTrailObject.setString(DmAuditTrailEnum.EVENT_NAME.getValue(), "<event_name>");
auditTrailObject.setString(DmAuditTrailEnum.STRING_1.getValue(), "<auditvalue>");
auditTrailObject.save();
just a psuedo code for registering an event in audit trail table.
Now I am confused. I asked, can I use audit trail to track changes in my registered table which I have created and registered in documentum repository. Not changes to registered table it self (e.g. adding/removing field), but to content of that table (adding, removing, updating rows in that table). Now Ahmed sugested to use triggers for that, but I need the documentum user who did the changes to content of registered table. Do you maybe have idea how to get it, or you are trying to tell me that standard audit trail mechanism can be used to log changes of content of the registered table?
The only way you can do i suppose is
adding various events on that table like
adding a row creates one event
removing a row creates one event
updating a row creates one event
then registering all the events in the audit trail object so that you can be able to query them all
I am really sorry but I don't understand. How adding row in registered table creates event? How can I do it?
in your custom logic/ in service layer whereever you are writing the logic
of handling the registered table like
1)In your service class you are performing an insertion of a value in the
table
then in that class create a new audit trail object with your event name
like insertion
2)Save the auditrail object
now whenever an insertion operation is being carried out then a new audit
trail object gets created with the values you have passed to and finally
you can query up the audit trail object.
That's it.
cheers..!
Aha, now I think I understand you . You wanted to say that I can manually add records in audittrail table. That's possibility ofcourse, but that would mean that for each registered table I have to write a piece of custom code to achieve this. I wondered is there possibility to register event and that documentum it self takes care about auditing changes, as if it would with an object type. Thanks.
if you look into composer for any custom types you can create event for
that type and register those types but not sure in your case i.e for
registered table adding the event thru composer.
Well, probably I was not clear enough . I know that documentum can audit trail object types (somehow I thought it was clear from the first post), I just asked is the same possible for registered tables. Thanks.
If the registered tables do not contain data from an external source then why not convert them to custom Documentum types. Then you can use all the standard auditing functions.
Cost in this case is a migration script and update of your functionality to use Documentum types rather than reg tables.
Personally think reg tables a pain, only use them if I need access to external data.