More than 4000 characters in DMN table input

Hi Camunda fans,

I’m having a problem when executing a DMN decision on an input string longer than 4000 characters. I am determining type of document based on document content. The decision itself executes OK, but right after that an exception occurs when camunda tries to insert an HistoricDecisionInputInstanceEntity into table ACT_HI_DEC_IN :

org.camunda.bpm.engine.ProcessEngineException: ENGINE-03004 Exception while executing Database Operation ‘INSERT HistoricDecisionInputInstanceEntity[17f601d4-1d79-11ed-819d-8c8d28c7c361]’ with message ’

Error flushing statements. Cause: org.apache.ibatis.executor.BatchExecutorException: org.camunda.bpm.engine.impl.history.event.HistoricDecisionInputInstanceEntity.insertHistoricDecisionInputInstance (batch index #3) failed. 2 prior sub executor(s) completed successfully, but will be rolled back. Cause: org.h2.jdbc.JdbcBatchUpdateException: Value too long for column “TEXT_ VARCHAR(4000)”: “STRINGDECODE('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam et odio nec velit bibendum blandit sit amet sed dui… (5008)”; SQL statement:

insert into ACT_HI_DEC_IN(
ID_,
DEC_INST_ID_,
CLAUSE_ID_,
CLAUSE_NAME_,
VAR_TYPE_,
BYTEARRAY_ID_,
DOUBLE_,
LONG_,
TEXT_,
TEXT2_,
TENANT_ID_,
CREATE_TIME_,
ROOT_PROC_INST_ID_,
REMOVAL_TIME_
) values (
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?,
?
) [22001-200]

My decision table looks like this (simplified):

I have a unit test that can simulate the issue:

I am passing the documentContent parameter wrapped in Variables.objectValue(...) so that it is stored as object reference when passing to DMN engine. This seems to work OK for the decision engine itself, as I can see that it executes with a correct result. However I suspect that when Camunda creates HistoricDecisionInputInstanceEntity it always stores the value into text_ field and somehow does not store it as object reference. (my wild guess is DefaultDmnHistoryEventProducer.createHistoricDecisionInputInstances() where it takes the untyped value?).

How should I pass the parameter with more than 4000 characters into DMN table so that it does not cause exception when inserting into ACT_HI_DEC_IN table?

Thanks for your support