Source of the configuration value in IncidentContext

I created a service task, which invokes a JavaDelegate. The java delegate creates an incident like so

IncidentContext incidentContext = new IncidentContext();
incidentContext.setActivityId(execution.getCurrentActivityId());
incidentContext.setExecutionId(execution.getProcessInstanceId());
incidentContext.setProcessDefinitionId(execution.getProcessDefinitionId());
incidentContext.setConfiguration(“myConfig”);
IncidentEntity ie = createAndInsertIncidents(FAILED_JOB_HANDLER-TYPE, incidentContext, “”);
incidentEntity.createRecursiveIncidents();

On the cockpit page, an attempt to modify and ‘startBefore’ the serviceTask in error results in an another IncidentContext being created by Camunda. This incident context is populated with a configuration value and a jobDefinitionId. All other attributes of the instance are null.

I was expecting the configuration value in the IncidentContext generated by Camunda to be identical to the value I populated the incidentContext with intially when the incident was created… but it’s not. And that’s a problem because in the DefaultIncidentHandler class this configuration value is used to fetch the lists of incidents that can be deleted, see line 82 @

Can you advise please ? Can you explain how Camunda populates the incident context when the task is modified, specifically in respect to the configuration… and also what am I doing wrong :slight_smile: