Currently, looking at the code in d:\2015.1\xaf\devexpress.expressapp.modules\devexpress.expressapp.audittrail\module.cs only the default XPDictionary is considered:
C#private void application_SetupComplete(object sender, EventArgs e) {
lock(setupLockObject) {
enumDescriptor = new EnumDescriptor(typeof(AuditOperationType));
AuditTrailService.Instance.SetXPDictionary(XpoTypesInfoHelper.GetXpoTypeInfoSource().XPDictionary);
if(AuditTrailService.Instance.AuditDataStore == null) {
if(auditDataItemPersistentType != null) {
When several XPObjectSpaceProviders are registered, this default XPDictionary does not contain any types. When the AuditTrailViewController class works, it calls the following method:
C#private void BeginAudit(ObjectView view) {
if(view.CurrentObject != null) {
AuditTrailService.Instance.BeginObjectsAudit(((XPObjectSpace)view.ObjectSpace).Session, view.CurrentObject);
}
}
which leads to the ObjectAuditProcessor class call below:
C#public void BeginObjectAudit(object obj) {
if(IsDisposed) {
return;//throw new ObjectDisposedException(GetType().Name);
}
Guard.ArgumentNotNull(obj, "obj");
if(IsObjectToAudit(obj) && !IsObjectAudited(obj)) { //!!!!!!!!!!!!
BeginObjectAuditCore(obj, GetPropertiesToAudit(obj.GetType()));
}
}
Here nothing is to be audited at the highlighted line, because no type is found in the default dictionary.
To avoid this problem, it is important to re-implement the default AuditTrail APIs to take into account multiple registered type info sources (very similar to what have done for the security system in Security - Exception occurs when checking permissions for an object mapped to another database in scenario with multiple EFObjectSpaceProvider registerations).
Currently, as a workaround, you can only manually control which XPDictionary to be audited as shown below:
C#//Global.asax.cs
...
protected void Session_Start(Object sender, EventArgs e)
WebApplication.Instance.SetupComplete += Instance_SetupComplete;
void Instance_SetupComplete(object sender, EventArgs e) {
...
AuditTrailService.Instance.SetXPDictionary(((XpoTypeInfoSource)WebApplication.Instance.ObjectSpaceProviders[0].EntityStore).XPDictionary);
}
...