Activiti 5.11: wrong historicDetailResultMap_postgres

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-30-2012 01:48 PM
Hi,
After upgrade to Activiti 5.11 the query:
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:
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.
Now query works and is possible to cast returned HistoricDetail to HistoricVariableUpdate.
Can you apply patch on next release please?
Best regards!
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"/> </discriminator>‍‍‍‍‍‍
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"/> </discriminator>‍‍‍‍‍‍
Now query works and is possible to cast returned HistoricDetail to HistoricVariableUpdate.
Can you apply patch on next release please?
Best regards!
Labels:
- Labels:
-
Archive
4 REPLIES 4

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-30-2012 04:04 PM
Hi,
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).
…
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.
….
Now query works and is possible to cast returned HistoricDetail to HistoricVariableUpdate.
Can you apply patch on next release please?
Best regards!
Hi xandros,
1. The HistoricDetailVariableInstanceUpdateEntity is assigned to s.c. internal implementation classes.
all classes in packages that have .impl. (e.g. org.activiti.engine.impl.pvm.delegate) in them are implementation classes and should be considered internal. No stability guarantees are given on classes or interfaces that are in implementation classes. (c, userguide)
So no guarantee exists, that such class will be existed in next release.

2. The cast to interface implementation (HistoricDetailVariableInstanceUpdateEntity) is bad smell. You should be programming to the interface not the implementation class. If the needed informations are hidden, but those are needed, so the request to make it public would be better :geek:
3. The cast to interface HistoricVariableUpdate if only parent interface HistoricDetail
is available on the return result of method
historyService.createHistoricDetailQuery().processInstanceId(processInstanceId).variableUpdates().orderByTime().desc().list(); shows, that the method with HistoricVariableUpdate as returned list is needed too.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-30-2012 04:37 PM
Hi,
I try cast to HistoricDetailVariableInstanceUpdateEntity because cast to HistoricVariableUpdate not works. Reflection to returned HistoricDetail shows that it not implements HistoricVariableUpdate interface. This is my full code:
but never go into "if(hd instanceof HistoricVariableUpdate)" section.
In DB I have historic VariableUpdates and with workaround it works.
Can you test the original implementation on Postgres?
I try cast to HistoricDetailVariableInstanceUpdateEntity because cast to HistoricVariableUpdate not works. Reflection to returned HistoricDetail shows that it not implements HistoricVariableUpdate interface. This is my full code:
List<HistoricDetail> hds = historyService.createHistoricDetailQuery().processInstanceId(processInstanceId).variableUpdates().orderByTime().desc().list();
for(HistoricDetail hd : hds){
if(hd instanceof HistoricVariableUpdate){
HistoricVariableUpdate var = (HistoricVariableUpdate)hd;
}
}
but never go into "if(hd instanceof HistoricVariableUpdate)" section.
In DB I have historic VariableUpdates and with workaround it works.
Can you test the original implementation on Postgres?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-03-2013 04:38 AM
Hi, thanks for reporting this. I stumbled upon this issue today an will get it fixed asap…
https://jira.codehaus.org/browse/ACT-1512
https://jira.codehaus.org/browse/ACT-1512

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-06-2013 04:43 PM
OK, thanks!
