<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Activiti 5.11: wrong historicDetailResultMap_postgres in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/activiti-5-11-wrong-historicdetailresultmap-postgres/m-p/122259#M86098</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After upgrade to Activiti 5.11 the query:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;List&amp;lt;HistoricDetail&amp;gt; hds = historyService.createHistoricDetailQuery().processInstanceId(processInstanceId).variableUpdates().orderByTime().desc().list();&lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;return HistoricDetail that not implements HistoricDetailVariableInstanceUpdateEntity, then is impossible access variable informations (via cast).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I use POSTGRES as DB and I think only this db is affected, indeed after some investigation I found a problem in HistoricDetail.xml:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The "createHistoricDetailQuery" use "historicDetailResultMap" that in case of POSTGRES is remapped to "historicDetailResultMap_postgres". &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;In "historicDetailResultMap_postgres" definition there is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;lt;discriminator javaType="string" column="TYPE_"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;case value="VariableUpdate" resultMap="historicVariableUpdateResultMap_postgres"/&amp;gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;case value="FormProperty" resultMap="historicFormPropertyResultMap"/&amp;gt; &lt;BR /&gt;&amp;lt;/discriminator&amp;gt;&lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;but "historicVariableUpdateResultMap_postgres" is not defined, then the MyBatis fails to map data.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My workaround is change "historicVariableUpdateResultMap_postgres" in "historicVariableUpdateResultMap" that is defined after in HistoricDetail.xml.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;lt;discriminator javaType="string" column="TYPE_"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;case value="VariableUpdate" resultMap="historicVariableUpdateResultMap"/&amp;gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;case value="FormProperty" resultMap="historicFormPropertyResultMap"/&amp;gt; &lt;BR /&gt;&amp;lt;/discriminator&amp;gt;&lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Now query works and is possible to cast returned HistoricDetail to HistoricVariableUpdate.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you apply patch on next release please?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best regards!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 30 Dec 2012 18:48:31 GMT</pubDate>
    <dc:creator>xandros</dc:creator>
    <dc:date>2012-12-30T18:48:31Z</dc:date>
    <item>
      <title>Activiti 5.11: wrong historicDetailResultMap_postgres</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-5-11-wrong-historicdetailresultmap-postgres/m-p/122259#M86098</link>
      <description>Hi,After upgrade to Activiti 5.11 the query:List&amp;lt;HistoricDetail&amp;gt; hds = historyService.createHistoricDetailQuery().processInstanceId(processInstanceId).variableUpdates().orderByTime().desc().list();‍‍‍return HistoricDetail that not implements HistoricDetailVariableInstanceUpdateEntity, then is</description>
      <pubDate>Sun, 30 Dec 2012 18:48:31 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-5-11-wrong-historicdetailresultmap-postgres/m-p/122259#M86098</guid>
      <dc:creator>xandros</dc:creator>
      <dc:date>2012-12-30T18:48:31Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti 5.11: wrong historicDetailResultMap_postgres</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-5-11-wrong-historicdetailresultmap-postgres/m-p/122260#M86099</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;After upgrade to Activiti 5.11 the query:&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;List&amp;lt;HistoricDetail&amp;gt; hds = historyService.createHistoricDetailQuery().processInstanceId(processInstanceId).variableUpdates().orderByTime().desc().list();&lt;BR /&gt;&lt;/CODE&gt;&lt;BR /&gt;return HistoricDetail that not implements HistoricDetailVariableInstanceUpdateEntity, then is impossible access variable informations (via cast).&lt;BR /&gt;…&lt;BR /&gt;&lt;BR /&gt;but "historicVariableUpdateResultMap_postgres" is not defined, then the MyBatis fails to map data.&lt;BR /&gt;&lt;BR /&gt;My workaround is change "historicVariableUpdateResultMap_postgres" in "historicVariableUpdateResultMap" that is defined after in HistoricDetail.xml.&lt;BR /&gt;….&lt;BR /&gt;&lt;BR /&gt;Now query works and is possible to cast returned HistoricDetail to HistoricVariableUpdate.&lt;BR /&gt;&lt;BR /&gt;Can you apply patch on next release please?&lt;BR /&gt;&lt;BR /&gt;Best regards!&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi xandros,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1. The &lt;/SPAN&gt;&lt;EM&gt;&lt;A href="http://svn.codehaus.org/activiti/activiti/trunk/modules/activiti-engine/src/main/java/org/activiti/engine/impl/persistence/entity/HistoricDetailVariableInstanceUpdateEntity.java" rel="nofollow noopener noreferrer"&gt;HistoricDetailVariableInstanceUpdateEntity&lt;/A&gt;&lt;/EM&gt;&lt;SPAN&gt; is assigned to s.c. &lt;/SPAN&gt;&lt;STRONG&gt;internal implementation classes&lt;/STRONG&gt;&lt;SPAN&gt;. &lt;/SPAN&gt;&lt;BR /&gt;&lt;EM&gt;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.&lt;STRONG&gt; No stability guarantees are given on classes &lt;/STRONG&gt;or interfaces that are in implementation classes. &lt;/EM&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;A href="http://www.activiti.org/userguide/index.html#internal" rel="nofollow noopener noreferrer"&gt;c&lt;/A&gt;&lt;SPAN&gt;, userguide)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So no guarantee exists, that such class will be existed in next release. &lt;img id="smileyindifferent" class="emoticon emoticon-smileyindifferent" src="https://connect.hyland.com/i/smilies/16x16_smiley-indifferent.png" alt="Smiley Indifferent" title="Smiley Indifferent" /&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2. The cast to interface implementation (&lt;/SPAN&gt;&lt;EM&gt;HistoricDetailVariableInstanceUpdateEntity&lt;/EM&gt;&lt;SPAN&gt;) 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: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;3. The cast to interface &lt;/SPAN&gt;&lt;A href="http://www.activiti.org/javadocs/org/activiti/engine/history/HistoricVariableUpdate.html" rel="nofollow noopener noreferrer"&gt;&lt;EM&gt;HistoricVariableUpdate&lt;/EM&gt;&lt;/A&gt;&lt;SPAN&gt; if only parent interface &lt;/SPAN&gt;&lt;A href="http://www.activiti.org/javadocs/org/activiti/engine/history/HistoricDetail.html" rel="nofollow noopener noreferrer"&gt;&lt;EM&gt;HistoricDetail&lt;/EM&gt;&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt; is available on the return result of method&lt;/SPAN&gt;&lt;BR /&gt;&lt;EM&gt;historyService.createHistoricDetailQuery().processInstanceId(processInstanceId).variableUpdates().orderByTime().desc().list();&lt;/EM&gt;&lt;SPAN&gt; shows, that the method with &lt;/SPAN&gt;&lt;EM&gt;HistoricVariableUpdate&lt;/EM&gt;&lt;SPAN&gt; as returned list is needed too.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Dec 2012 21:04:47 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-5-11-wrong-historicdetailresultmap-postgres/m-p/122260#M86099</guid>
      <dc:creator>udoderk</dc:creator>
      <dc:date>2012-12-30T21:04:47Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti 5.11: wrong historicDetailResultMap_postgres</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-5-11-wrong-historicdetailresultmap-postgres/m-p/122261#M86100</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;List&amp;lt;HistoricDetail&amp;gt; hds = historyService.createHistoricDetailQuery().processInstanceId(processInstanceId).variableUpdates().orderByTime().desc().list();&lt;BR /&gt;for(HistoricDetail hd : hds){&lt;BR /&gt;&amp;nbsp; if(hd instanceof HistoricVariableUpdate){&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; HistoricVariableUpdate var = (HistoricVariableUpdate)hd;&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;}&lt;BR /&gt;&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;but never go into "if(hd instanceof HistoricVariableUpdate)" section.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;In DB I have historic VariableUpdates and with workaround it works.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you test the original implementation on Postgres?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Dec 2012 21:37:30 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-5-11-wrong-historicdetailresultmap-postgres/m-p/122261#M86100</guid>
      <dc:creator>xandros</dc:creator>
      <dc:date>2012-12-30T21:37:30Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti 5.11: wrong historicDetailResultMap_postgres</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-5-11-wrong-historicdetailresultmap-postgres/m-p/122262#M86101</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi, thanks for reporting this. I stumbled upon this issue today an will get it fixed asap…&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://jira.codehaus.org/browse/ACT-1512" rel="nofollow noopener noreferrer"&gt;https://jira.codehaus.org/browse/ACT-1512&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jan 2013 09:38:43 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-5-11-wrong-historicdetailresultmap-postgres/m-p/122262#M86101</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2013-01-03T09:38:43Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti 5.11: wrong historicDetailResultMap_postgres</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-5-11-wrong-historicdetailresultmap-postgres/m-p/122263#M86102</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;OK, thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 06 Jan 2013 21:43:36 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-5-11-wrong-historicdetailresultmap-postgres/m-p/122263#M86102</guid>
      <dc:creator>xandros</dc:creator>
      <dc:date>2013-01-06T21:43:36Z</dc:date>
    </item>
  </channel>
</rss>

