Skip to content

Commit 5215d0c

Browse files
authored
feat(engine): adds process definition data to history events (#5155)
#5291
1 parent 549af14 commit 5215d0c

File tree

6 files changed

+381
-88
lines changed

6 files changed

+381
-88
lines changed

engine/src/main/java/org/camunda/bpm/engine/impl/history/producer/CacheAwareHistoryEventProducer.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@
2323
import org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager;
2424
import org.camunda.bpm.engine.impl.history.event.*;
2525
import org.camunda.bpm.engine.impl.history.handler.DbHistoryEventHandler;
26+
import org.camunda.bpm.engine.impl.interceptor.CommandContext;
2627
import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity;
28+
import org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity;
2729
import org.camunda.bpm.engine.runtime.Incident;
2830

2931
/**
@@ -114,4 +116,16 @@ protected <T extends HistoryEvent> T findInCache(Class<T> type, String id) {
114116
.getCachedEntity(type, id);
115117
}
116118

119+
@Override
120+
protected ProcessDefinitionEntity getProcessDefinitionEntity(String processDefinitionId) {
121+
CommandContext commandContext = Context.getCommandContext();
122+
ProcessDefinitionEntity entity = null;
123+
if(commandContext != null) {
124+
entity = commandContext
125+
.getDbEntityManager()
126+
.getCachedEntity(ProcessDefinitionEntity.class, processDefinitionId);
127+
}
128+
return (entity != null) ? entity : super.getProcessDefinitionEntity(processDefinitionId);
129+
}
130+
117131
}

0 commit comments

Comments
 (0)