IDEMPIERE-6136 ModelEventDelegate doesn't works with DocAction, PostCreate, PostUpdate and PostDelete annotation (#2346)
This commit is contained in:
parent
39fff47de6
commit
47f1336df4
|
|
@ -31,6 +31,7 @@ import java.util.stream.Collectors;
|
||||||
|
|
||||||
import org.adempiere.base.BaseActivator;
|
import org.adempiere.base.BaseActivator;
|
||||||
import org.adempiere.base.event.annotations.BaseEventHandler;
|
import org.adempiere.base.event.annotations.BaseEventHandler;
|
||||||
|
import org.compiere.model.PO;
|
||||||
import org.compiere.util.CLogger;
|
import org.compiere.util.CLogger;
|
||||||
import org.compiere.util.Env;
|
import org.compiere.util.Env;
|
||||||
import org.compiere.util.Ini;
|
import org.compiere.util.Ini;
|
||||||
|
|
@ -332,8 +333,11 @@ public class EventManager implements IEventManager {
|
||||||
} else {
|
} else {
|
||||||
Map<String, Object> map = new HashMap<String, Object>(3);
|
Map<String, Object> map = new HashMap<String, Object>(3);
|
||||||
map.put(EventConstants.EVENT_TOPIC, topic);
|
map.put(EventConstants.EVENT_TOPIC, topic);
|
||||||
if (data != null)
|
if (data != null) {
|
||||||
map.put(EVENT_DATA, data);
|
map.put(EVENT_DATA, data);
|
||||||
|
if (data instanceof PO po)
|
||||||
|
map.put(TABLE_NAME_PROPERTY, po.get_TableName());
|
||||||
|
}
|
||||||
map.put(EVENT_ERROR_MESSAGES, new ArrayList<String>());
|
map.put(EVENT_ERROR_MESSAGES, new ArrayList<String>());
|
||||||
if (copySessionContext)
|
if (copySessionContext)
|
||||||
map.put(EVENT_CONTEXT, getCurrentSessionContext());
|
map.put(EVENT_CONTEXT, getCurrentSessionContext());
|
||||||
|
|
|
||||||
|
|
@ -28,12 +28,13 @@ import java.util.ArrayList;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
import org.adempiere.base.event.IEventTopics;
|
import org.adempiere.base.event.IEventTopics;
|
||||||
|
import org.adempiere.base.event.POEventData;
|
||||||
import org.compiere.model.PO;
|
import org.compiere.model.PO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Event data for {@link IEventTopics#DOCACTION}.
|
* Event data for {@link IEventTopics#DOCACTION}.
|
||||||
*/
|
*/
|
||||||
public class DocActionEventData {
|
public class DocActionEventData implements POEventData {
|
||||||
|
|
||||||
public String docStatus;
|
public String docStatus;
|
||||||
public Object processing;
|
public Object processing;
|
||||||
|
|
@ -70,4 +71,9 @@ public class DocActionEventData {
|
||||||
this.po = po;
|
this.po = po;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PO getPo() {
|
||||||
|
return po;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue