I have added one specific entity in the entity log from CUBA Administration. So whenever changes made by user related to the entity from the entity log ,at the time Email notification need to send for the particular user. How i can add email alert to entity log…
Yeah Andrey i need an entity log… Here my requirement is , For example i’m havin saas_Project Entity.
In saas_Project Entity if we made any changes means all the the changes will store in Entity log. In that Entity log ,We can fetch all the details like who changed , from which entity, what is the change type and attribute changes also, like old value and new value. So the thing is, whenever changes happen in an any entity, that record will be capture in entity log. That newly inserted record from entity log details i need to get, the whole record. This the thing i need…How i can get that…?
I think you can achieve this by creating entity listener for EntityLogItem entity. I would start from implementing the interface com.haulmont.cuba.core.listener.AfterCompleteTransactionListener. As an example, you can have a look at com.haulmont.cuba.security.listener.EntityLogItemDetachListener class in CUBA framework.
The above code I have written to get access EntityLogItem entity. But once after updating the Db the above method doesn’t execute. So i can’t get details from EntityLogItem entity. What is the mistake i have made in my code…?
I meant native CUBA listeners, not Spring transaction listeners. Since you cannot specify an additional listener to a system entity, you need to extend it and add a listener to the extended entity. Please have a look at the Entity Extension guide to understand the code. Please note that EntityLogItem is a system entity, so I had to extend the base table separately in 30.create-db.sql file:
alter table SEC_ENTITY_LOG add column DTYPE varchar(255) ^
update SEC_ENTITY_LOG set DTYPE = 'logger_TransactionalEntityLogItem' where DTYPE is null ^
The example is attached. Do not forget to enable entity logging for the Test entity in the application.