How to get the currentsession in Core.getListenersRegistry().registerBeforeCommitListener?

I create a registerBeforeCommitListener and run it in after strat up microflow, When a object is commit the Listener is run, but the context is not the context witch commit the object ,it is the context when run in run it in after strat up microflow. I want to recored the user who operate the object so i need get the the current context or current session, how can i get the current context or current session in the registerBeforeCommitListener? public class OperationLogListenerAction extends CustomJavaAction<java.lang.Void> { public OperationLogListenerAction(IContext context) { super(context); } @java.lang.Override public java.lang.Void executeAction() throws Exception { // BEGIN USER CODE Core.getListenersRegistry().registerBeforeCommitListener(objs -> { // 预处理已提交的实体 for (IMendixObject obj : objs) { try { if(isRecord(obj)) { CreateLogObject.createAuditLogItems(obj, getContext()); } } catch (CoreException e) { // TODO Auto-generated catch block e.printStackTrace(); } } });
0 answers