AnsweredAssumed Answered

Activiti 5.11: wrong historicDetailResultMap_postgres

Question asked by xandros on Dec 30, 2012
Latest reply on Jan 6, 2013 by xandros

After upgrade to Activiti 5.11 the query:

List<HistoricDetail> hds = historyService.createHistoricDetailQuery().processInstanceId(processInstanceId).variableUpdates().orderByTime().desc().list();

return HistoricDetail that not implements HistoricDetailVariableInstanceUpdateEntity, then is impossible access variable informations (via cast).

I use POSTGRES as DB and I think only this db is affected, indeed after some investigation I found a problem in HistoricDetail.xml:

The "createHistoricDetailQuery" use "historicDetailResultMap" that in case of POSTGRES is remapped to "historicDetailResultMap_postgres".
In "historicDetailResultMap_postgres" definition there is:

<discriminator javaType="string" column="TYPE_">
      <case value="VariableUpdate" resultMap="historicVariableUpdateResultMap_postgres"/>
      <case value="FormProperty" resultMap="historicFormPropertyResultMap"/>

but "historicVariableUpdateResultMap_postgres" is not defined, then the MyBatis fails to map data.

My workaround is change "historicVariableUpdateResultMap_postgres" in "historicVariableUpdateResultMap" that is defined after in HistoricDetail.xml.

<discriminator javaType="string" column="TYPE_">
      <case value="VariableUpdate" resultMap="historicVariableUpdateResultMap"/>
      <case value="FormProperty" resultMap="historicFormPropertyResultMap"/>

Now query works and is possible to cast returned HistoricDetail to HistoricVariableUpdate.

Can you apply patch on next release please?

Best regards!