Search code examples
databasealfrescoactiviti

Alfresco activiti error too long for type character varying(255) ACT_HI_TASKINST


I have an Alfresco (5.2.4) workflow which runs upon activiti engine. When a user submit a task and the User task block is completed I receive this error:

2019-03-28 10:02:28,024  ERROR [impl.interceptor.CommandContext] [http-bio-8080-exec-17] Error while closing command context
org.apache.ibatis.exceptions.PersistenceException: 
### Error updating database.  Cause: org.postgresql.util.PSQLException: ERRORE: il valore è troppo lungo per il tipo character varying(255)
### The error may involve org.activiti.engine.impl.persistence.entity.HistoricTaskInstanceEntity.insertHistoricTaskInstance-Inline
### The error occurred while setting parameters
### SQL: insert into ACT_HI_TASKINST (         ID_,         PROC_DEF_ID_,         PROC_INST_ID_,         EXECUTION_ID_,         NAME_,         PARENT_TASK_ID_,         DESCRIPTION_,         OWNER_,         ASSIGNEE_,         START_TIME_,         CLAIM_TIME_,         END_TIME_,         DURATION_,         DELETE_REASON_,         TASK_DEF_KEY_,         FORM_KEY_,         PRIORITY_,         DUE_DATE_,         CATEGORY_,         TENANT_ID_       ) values (         ?,         ?,         ?,         ?,         ?,         ?,         ?,         ?,         ?,         ?,         ?,         ?,         ?,         ?,         ?,         ?,         ?,         ?,         ?,         ?       )
### Cause: org.postgresql.util.PSQLException: ERRORE: il valore è troppo lungo per il tipo character varying(255)
    at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
    at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:172)
    at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:157)
    at org.activiti.engine.impl.db.DbSqlSession.flushRegularInsert(DbSqlSession.java:830)
    at org.activiti.engine.impl.db.DbSqlSession.flushPersistentObjects(DbSqlSession.java:811)
    at org.activiti.engine.impl.db.DbSqlSession.flushInserts(DbSqlSession.java:794)
    at org.activiti.engine.impl.db.DbSqlSession.flush(DbSqlSession.java:615)

For what I've serached so far, I found activiti automatically store the history of "steps" that are executed inside the workflow, and because of that it raise an error.

I would like to know if there is some DB table definition I can look for to search what column may it be which exceeds the 255 chars total.

In the case I can't modify my javascript code on user's task completion, Is there a way to increase that lenght number?

Thanks

P.S.: I found this documentation for activiti, but there is nothing about DB definition

UPDATE

I've been able to connect directly to my activiti DB searching for connections properties inside alfresco-global.properties. Therefore I'm able to see that table structure and look for varchar(255) fields. They are 7:

  • name_
  • owner_
  • assignee_
  • form_key_
  • category_
  • tenant_id_

Does anyone know how to see print the exact query activiti does?


Solution

  • I found the cause of my activiti query error, inside my workflow definition. It was an incomplete activiti:assignee property which caused the problem. I wrote activiti:assignee="${mywf_assignee}" instead of activiti:assignee="${mywf_assignee.properties.userName}". So basically the query would attempt to write the entire nodeRef inside assignee_ column, which is more than 255 chars.

    Sadly I did not find a way to show the activiti complete sql query .