Entity Master: simple audit info (who and when)
Description
Every persistent entity, extending AbstractPersistentEntity, includes information about who/when created it and who/when changed it last. This information needs to be made available to users with the relevant privileges. The following is proposed:
-
[ ] 1. Create action-entity
EntityAuditInfoAction(aka functional entity) with propertyentity: AbstractPersistenEntityas@Require. The value of this property should represent an entity instance for which the audit info needs to be obtained. EntityEntityAuditInfoActionshould be registered as one of the standard platform domain entity types inPlatformDomainTypes. -
[ ] 2. Security token
EntityAuditInfoAction_CanExecute_Tokenneeds to be registered as one of the standard platform security tokens inSecurityTokenProvider. -
[ ] 3. Provide a master for
EntityAuditInfoActionthat would display thekeyanddesc(if present) ofEntityAuditInfoAction.entityin the master title and theentitypropertiesid,version,createdBy,createdDate,lastUpdatedBy,lastUpdatedDatein the body of the master with 2x3 layout. The standard button CANCEL should read CLOSE and there is no need for button SAVE. -
[ ] 4. A producer is required to process the action context and populate
EntityAuditInfoAction.entitywith the value of master entity. Event is the master entity is null or not persisted, try assigning it – the relevant validation should take place inEntityAuditInfoAction. IfEntityAuditInfoActionbecomes invalid, propagate the validation result back to the client by throwing a correspondingResultinstance. There could an edge-case, where master entity is not an instance ofAbstractPersistentEntity. In that case simply throwfailurewith message "No audit information is available.". -
[ ] 5. Unlike other standard platform-level masters and centres that get registered at the level of concrete applications,
EntityAuditInfoActionmaster needs to be registered at the platform level. -
[ ] 6. Enhance the Entity Master dialog to include an action to invoke the master for
EntityAudtInfoAction(icons:info-outline) as illustrated in the image below (label 1). The action's configuration should include a master entity in its context to be processed in the producer. This action should be displayed only for masters, which correspond to entities extendingAbstractPersistentEntity.
Once the full data auditing functionality is supported, the same mechanism can be used to invoke a review of the full entity change history.
Expected outcome
Ability to quickly view who and when initially created and was the last user to change a persistent entity instance.