camunda / camunda-bpm-platform

Flexible framework for workflow and decision automation with BPMN and DMN. Integration with Quarkus, Spring, Spring Boot, CDI.
https://camunda.com/
Apache License 2.0
4.11k stars 1.55k forks source link

Null ProcessDefinitionVersion on HistoricActivityInstanceEventEntity #2506

Closed ThorbenLindhauer closed 1 year ago

ThorbenLindhauer commented 3 years ago

This issue was imported from JIRA:

Field Value
JIRA Link CAM-13036
Reporter wg1RpX
What is this name? This pseudonym name was generated based on the user name in JIRA to protect the personal data of our JIRA users. You can use this identifier to search for issues by the same reporter.
Has restricted visibility comments false

Environment (Required on creation):

Spring boot starter 7.14.0

Description (Required on creation; please attach any relevant screenshots, stacktraces, log files, etc. to the ticket): 

HistoricActivityInstanceEventEntity in implemented Event Listener returns null ProcessDefinitionVersion, despite returning correct ProcessDefinitionKey, ProcessDefinitionId and despite correct ProcessDefinitionVersion being returned when querying Process Instances from REST API History endpoint (GET /history/process-instance) and from REST API process-definition endpoint (GET /process-definition).

Steps to reproduce (Required on creation):

  1. Implement onHistoryEvent listener, ex.

@Component class HistoryListener { @EventListener public void onHistoryEvent(HistoricActivityInstanceEventEntity historyEvent)

{ Integer processDefinitionVersion = historyEvent.getProcessDefinitionVersion(); // processDefinitionVersion is null }

}

  1. Deploy and instantiate some Process Definition

  2. Observe data in raised event

    Observed Behavior (Required on creation):

getProcessDefinitionVersion() on HistoricActivityInstanceEventEntity returns null

Expected behavior (Required on creation):

getProcessDefinitionVersion() on HistoricActivityInstanceEventEntity should return correct Process Definition Version number.

 

Links:

ThorbenLindhauer commented 3 years ago

This comment was imported from JIRA and written by user @ThorbenLindhauer


Hi wg1RpX,

Thanks for reporting this bug. Due to other priorities, we are currently not able to fix it but would appreciate a contribution. I think org.camunda.bpm.engine.impl.history.producer.DefaultHistoryEventProducer.initActivityInstanceEvent(HistoricActivityInstanceEventEntity, ExecutionEntity, PvmScope, String, String, HistoryEventType) is the place to start looking. If you are interested in contributing, please let me know in case of questions.

Cheers, Thorben

vivekchand commented 1 year ago

Any updates on this issue? We are facing the same issue. processDefinitionVersion is null for all HistoryEvents!

ThorbenLindhauer commented 1 year ago

Hi, we are currently not planning to work on this, but you could make a code contribution if you like.

vivekchand commented 1 year ago

Sure, I can share an MR for that.

vivekchand commented 1 year ago

I created an MR for this https://github.com/camunda/camunda-bpm-platform/pull/3592

@ThorbenLindhauer Please review & let me know if I need to make any changes

ThorbenLindhauer commented 1 year ago

Closing due to inactivity.