Audit

From JRapid

Jump to: navigation, search

The "auditlevel" attribute is used to specify that all changes made to the entity should be logged in the database. This is useful when system administrators want to keep a complete track of all changes made to the information.

To audit an entity you should import the "audit" template. This template is composed of the "AuditEntity" entity which stores records at an Entity level and the "AuditProperty" entity which stores records at Property level.

<entity label="Audit Entity" name="AuditEntity">
     <property display="primary" label="Entity" name="entity"/>
     <property label="Row Id" name="rowId"/>
     <property display="secondary" label="Date" name="auditDate" type="datetime"/>
     <property label="Username" name="username"/>
     <property display="secondary" label="Action Name" name="actionName"/>
</entity>
<entity label="Audit Property" name="AuditProperty">
     <property label="Entity" name="entity"/>
     <property label="Property" name="property"/>
     <property label="Row Id" name="rowId"/>
     <property label="username" name="username"/>
     <property label="Old value" name="oldValue"/>
     <property label="New value" name="newValue"/>
     <property label="Date" name="auditDate" type="datetime"/>
</entity> 

Entities which specify the "auditlevel" attribute have a "History" link in their forms which shows both "AuditEntity" and "AuditProperty" records for the entity.

History

Usage:

To enable auditing for an entity you can check the "audit" property in the Advanced tab in the Editing Entity Window.

audit

or directly specify the "auditlevel" attribute in the entity element.

<entity auditlevel="ALL_PROPERTIES" label=LABEL name=NAME />

Example:

  • Audit for a "Company" Entity

In this example a Company is being audited.

<entity auditlevel="ALL_PROPERTIES" label="Company" name="Company" />

The "admin" user has updated three times a Company instance.

Audit example

See also: