cancel
Showing results for 
Search instead for 
Did you mean: 

Form properties values recording into Activiti6 problem

edumitre
Champ on-the-rise
Champ on-the-rise

Hi,

Activiti 6 didn't seems to support historization into the DB (table ACT_HI_DETAIL) for long (>2000) string form values as for the variables. Is this a design limitation, a misconfiguration or a bug  ...? 

Thanks for your help !

Following the complete scenario :

When attempting to submit a task form with a huge String value via the API WS http://localhost:8082/activiti-app/api/form/form-data (POST) an error is raised claiming the value to be inserted into the ACT_HI_DETAIL is too big :

INTO ACT_HI_DETAIL (ID_, TYPE_, PROC_INST_ID_, ACT_INST_ID_, EXECUTION_ID_, TASK_ID_, TIME_, NAME_, TEXT_) VALUES    (?, ?, ?, ?, ?, ?,   ?,  ?,  ?)  INTO ACT_HI_DETAIL (ID_, TYPE_, PROC_INST_ID_, ACT_INST_ID_, EXECUTION_ID_, TASK_ID_, TIME_, NAME_, TEXT_) VALUES          (?,   ?,  ?,  ?,  ?,  ?, ?,    ?, ?)  ...

Cause: java.sql.SQLDataException: ORA-01401: inserted value too large for column

The method preparing the form data insertion (org.activiti.engine.impl.persistence.entity.HistoricDetailEntityManagerImpl#copyAndInsertHistoricDetailVariableInstanceUpdateEntity) seems to differ from the one preparing the variable variable insertion (org.activiti.engine.impl.persistence.entity.HistoricDetailEntityManagerImpl#copyAndInsertHistoricDetailVariableInstanceUpdateEntity) precisely on the binary support for the huge values :

public HistoricDetailVariableInstanceUpdateEntity copyAndInsertHistoricDetailVariableInstanceUpdateEntity(VariableInstanceEntity variableInstance) {
  HistoricDetailVariableInstanceUpdateEntity historicVariableUpdate = historicDetailDataManager.createHistoricDetailVariableInstanceUpdate();
  historicVariableUpdate.setProcessInstanceId(variableInstance.getProcessInstanceId());
  historicVariableUpdate.setExecutionId(variableInstance.getExecutionId());
  historicVariableUpdate.setTaskId(variableInstance.getTaskId());
  historicVariableUpdate.setTime(getClock().getCurrentTime());
  historicVariableUpdate.setRevision(variableInstance.getRevision());
  historicVariableUpdate.setName(variableInstance.getName());
  historicVariableUpdate.setVariableType(variableInstance.getType());
  historicVariableUpdate.setTextValue(variableInstance.getTextValue());
  historicVariableUpdate.setTextValue2(variableInstance.getTextValue2());
  historicVariableUpdate.setDoubleValue(variableInstance.getDoubleValue());
  historicVariableUpdate.setLongValue(variableInstance.getLongValue());

  if (variableInstance.getBytes() != null) {
    historicVariableUpdate.setBytes(variableInstance.getBytes());
  }

  insert(historicVariableUpdate);
  return historicVariableUpdate;
}

public HistoricFormPropertyEntity insertHistoricFormPropertyEntity(ExecutionEntity execution, 
    String propertyId, String propertyValue, String taskId) {
 
  HistoricFormPropertyEntity historicFormPropertyEntity = historicDetailDataManager.createHistoricFormProperty();
  historicFormPropertyEntity.setProcessInstanceId(execution.getProcessInstanceId());
  historicFormPropertyEntity.setExecutionId(execution.getId());
  historicFormPropertyEntity.setTaskId(taskId);
  historicFormPropertyEntity.setPropertyId(propertyId);
  historicFormPropertyEntity.setPropertyValue(propertyValue);
  historicFormPropertyEntity.setTime(getClock().getCurrentTime());

  HistoricActivityInstanceEntity historicActivityInstance = getHistoryManager().findActivityInstance(execution, true, false);
  if (historicActivityInstance != null) {
    historicFormPropertyEntity.setActivityInstanceId(historicActivityInstance.getId());
  }
 
  insert(historicFormPropertyEntity);
  return historicFormPropertyEntity;
}
1 ACCEPTED ANSWER

gdharley
Elite Collaborator
Elite Collaborator

Eugene,

This is a lonbg standing issue with storing of form variables in the history tables.

The first time I ran across it was version 5.12.

A couple of options:
1. Don't use full or audit history log level

2. Dont save large form data (doesnt really make sense anyway)

3. Overload the history manager to handle long data (a pretty easy overload).

Cheers,

Greg

View answer in original post

10 REPLIES 10

edumitre
Champ on-the-rise
Champ on-the-rise

Hello Greg,

Thanks for your answer.

Unfortunately we need to store the values entered by miscellaneous actors for audit and regulation needs.

This is a long standing issue with storing of form variables in the history tables.

Yeah, we have had this issue with Activiti 5 ant this was one on the main reasons we have to migrate to Activiti 6 which has pretty good support for huge variable values history recording.

Don't use full or audit history log level

This is the first thing I've tried but it had triggers some weird behaviors (form values no longer available between tasks ...), so I give up and I patched the code by imitating the way the activiti-engine stores big variable values.

Overload the history manager to handle long data (a pretty easy overload).

This seems to be cleaner than changing the activiti engine, I will look how one can accomplish that.

Many thanks !

Eugene