AnsweredAssumed Answered

How can I audit my java methods?

Question asked by saruqui on May 16, 2013
Latest reply on May 20, 2013 by saruqui
I don't know what steps do I need to follow in order to audit my own methods. I've tried this:

public interface WfService {

   
   @Auditable(parameters="node")
   WorkflowPath initWf(NodeRef node) throws Exception;

}


– wfAudit.xml –
<Audit xmlns="http://www.alfresco.org/repo/audit/model/3.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://www.alfresco.org/repo/audit/model/3.2 alfresco-audit-3.2.xsd">
   <DataExtractors>
      <DataExtractor name="simpleValue" registeredName="auditModel.extractor.simpleValue" />
      <DataExtractor name="nullValue" registeredName="auditModel.extractor.nullValue" />
   </DataExtractors>
   <DataGenerators>
      <DataGenerator name="currentUser" registeredName="auditModel.generator.user" />
   </DataGenerators>
   <PathMappings>
      <PathMap source="/alfresco-api/post/WfService/initWf" target="/InitWf" />
   </PathMappings>
   <Application name="InitWf" key="InitWf">
      <AuditPath key="in">
         <RecordValue key="node" dataExtractor="simpleValue" dataSource="/InitWf/args/node" />
      </AuditPath>
      <AuditPath key="out">
         <RecordValue key="value" dataExtractor="simpleValue" dataSource="/InitWf/result" />
      </AuditPath>

   </Application>
</Audit>

Do I have to add anything else (setup, annotations…)?

The audit configuration setting is enabled so I can audit Alfresco services.

I'm using Alfresco 4.0.2

Thanks in advance

Saru

Outcomes