AnsweredAssumed Answered

Form properties values recording into Activiti6 problem

Question asked by edumitre on Mar 1, 2017
Latest reply on Mar 3, 2017 by edumitre

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;
}

Outcomes