<?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 5.10 HistoricTaskInstanceQuery extension. in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/5-10-historictaskinstancequery-extension/m-p/117883#M83197</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would like to extend HistoricTaskInstanceQuery with possibility to select tasks finished after due time. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;How can I manage it on the 5.10 tag? (I think new features could be added only to the 5.12-SNAPSHOT).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The reason for 5.10 is that 5.11 has issues with database. When it is not possible to extend 5.10, I have to upgrade to 5.12-snapshot. In that case I will write jUnit test which will simulate error and will ask another question.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 Jan 2013 13:50:00 GMT</pubDate>
    <dc:creator>gromar</dc:creator>
    <dc:date>2013-01-18T13:50:00Z</dc:date>
    <item>
      <title>5.10 HistoricTaskInstanceQuery extension.</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/5-10-historictaskinstancequery-extension/m-p/117883#M83197</link>
      <description>Hello.I would like to extend HistoricTaskInstanceQuery with possibility to select tasks finished after due time. How can I manage it on the 5.10 tag? (I think new features could be added only to the 5.12-SNAPSHOT).The reason for 5.10 is that 5.11 has issues with database. When it is not possible to</description>
      <pubDate>Fri, 18 Jan 2013 13:50:00 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/5-10-historictaskinstancequery-extension/m-p/117883#M83197</guid>
      <dc:creator>gromar</dc:creator>
      <dc:date>2013-01-18T13:50:00Z</dc:date>
    </item>
    <item>
      <title>Re: 5.10 HistoricTaskInstanceQuery extension.</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/5-10-historictaskinstancequery-extension/m-p/117884#M83198</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You could just checkout the 5.10 tag and modify it locally (or fork on github), alter the source-code and build the engine-jar yourself. You can suggest the change to us, by applying the change to the current 5.12 master and creating a pull-request (or attaching a patch to a JIRA-issue).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jan 2013 14:01:05 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/5-10-historictaskinstancequery-extension/m-p/117884#M83198</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2013-01-18T14:01:05Z</dc:date>
    </item>
    <item>
      <title>Re: 5.10 HistoricTaskInstanceQuery extension.</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/5-10-historictaskinstancequery-extension/m-p/117885#M83199</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In that case it would be better to upgrade process-monitor project to the latest activiti version.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried to upgrade from Activiti 5.10 -&amp;gt; 5.11. I have created new test which is failing with 5.11 but was totally OK with 5.10.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Could you please show me what I am doing wrong here?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Description:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="https://github.com/gro-mar/activiti-crystalball/blob/Activiti-5.11/simulator/src/test/java/org/activiti/crystalball/simulator/TwoEnginesTest.java" rel="nofollow noopener noreferrer"&gt;TwoEnginesTest.java&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;Test puts process engine into defined state (generateLiveDB()), &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;deploys simple process:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[img]&lt;/SPAN&gt;&lt;A href="https://raw.github.com/gro-mar/activiti-crystalball/Activiti-5.11/simulator/src/test/process/org/activiti/crystalball/simulator/TwoEngines.png" rel="nofollow noopener noreferrer"&gt;https://raw.github.com/gro-mar/activiti-crystalball/Activiti-5.11/simulator/src/test/process/org/activiti/crystalball/simulator/TwoEngines.png&lt;/A&gt;&lt;SPAN&gt;[/img]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and runs the test (starts deployed process).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt; @Test&lt;BR /&gt; public void test() {&lt;BR /&gt;&amp;nbsp; // prepare params&lt;BR /&gt;&amp;nbsp; Map&amp;lt;String, Object&amp;gt; params = new Hashtable&amp;lt;String, Object&amp;gt;();&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; params.put( "tempDir", System.getProperty("tempDir", "target") );&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; params.put( "runningDatabaseFile", LIVE_DB+".h2.db");&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // start process&lt;BR /&gt;&amp;nbsp; runtimeService.startProcessInstanceByKey(&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MONITOR_PROCESS_KEY, "GENERATOR-KEY-1", params).getId();&lt;BR /&gt; }&lt;BR /&gt;&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;In this one node process groovy script is called (starts new "simulation" process engine and runs simulation on the top of it):&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt; import org.apache.commons.io.*;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; import static org.junit.Assert.*;&lt;BR /&gt; import java.util.List;&lt;BR /&gt; import org.activiti.engine.IdentityService;&lt;BR /&gt; import org.activiti.engine.identity.User;&lt;BR /&gt; import org.springframework.context.support.ClassPathXmlApplicationContext;&lt;BR /&gt; import org.processmonitor.simulator.*;&lt;BR /&gt;&lt;BR /&gt; // create copy of the running process engine database and set system property to this file&lt;BR /&gt;&lt;BR /&gt;FileUtils.copyFile( FileUtils.getFile(runningDatabaseFile), FileUtils.getFile( tempDir+"/TwoEngines-simulationRunDB"+Thread.currentThread().getId()+".h2.db"))&lt;BR /&gt;System.setProperty("_SIM_DB_PATH", tempDir+"/TwoEngines-simulationRunDB"+Thread.currentThread().getId())&lt;BR /&gt; &lt;BR /&gt;&amp;nbsp; ClassPathXmlApplicationContext appContext = new ClassPathXmlApplicationContext("/org/processmonitor/simulator/SimEngine-h2-context.xml")&lt;BR /&gt;&amp;nbsp; IdentityService identityService = appContext.getBean("identityService")&lt;BR /&gt;&amp;nbsp; IdentityService simIdentityService = appContext.getBean("simIdentityService")&lt;BR /&gt;&amp;nbsp; List&amp;lt;User&amp;gt; simUsers = simIdentityService.createUserQuery().list();&lt;BR /&gt;&amp;nbsp; List&amp;lt;User&amp;gt; users = identityService.createUserQuery().list();&lt;BR /&gt;&amp;nbsp; assertTrue("Copied identity service is not the same as source&amp;nbsp; identity service", simUsers.size() == users.size());&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; SimulationRun simRun = appContext.getBean(SimulationRun.class)&lt;BR /&gt;&amp;nbsp; resultEventList = simRun.execute(new Date(), null)&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; assertTrue("Simulation result event list is empty", resultEventList.size() &amp;gt; 0);&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; appContext.close()&lt;BR /&gt;&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem is that &lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;assertTrue("Simulation result event list is empty", resultEventList.size() &amp;gt; 0);&lt;BR /&gt;&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;is failing because of various reasons:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Identity service is not the same as "live" process engine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;TaskService is not the same.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;etc…&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The same test without process deploy and start is not failing (see &lt;/SPAN&gt;&lt;A href="https://github.com/gro-mar/process-monitor/blob/Activiti-5.11/simulator/src/test/java/org/processmonitor/simulator/TwoEnginesWithoutProcessTest.java" rel="nofollow noopener noreferrer"&gt;TwoEnginesWithoutProcessTest.java&lt;/A&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Both tests are passing with activiti-5.10 &lt;/SPAN&gt;&lt;A href="https://github.com/gro-mar/process-monitor" rel="nofollow noopener noreferrer"&gt;master branch&lt;/A&gt;&lt;A _jive_internal="true" href="https://community.alfresco.com/" rel="nofollow noopener noreferrer"&gt;&lt;BR /&gt;&lt;BR /&gt;Could you help me please?'&amp;gt;.&lt;BR /&gt;&lt;BR /&gt;Could you help me please?&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jan 2013 18:20:39 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/5-10-historictaskinstancequery-extension/m-p/117885#M83199</guid>
      <dc:creator>gromar</dc:creator>
      <dc:date>2013-01-21T18:20:39Z</dc:date>
    </item>
    <item>
      <title>Re: 5.10 HistoricTaskInstanceQuery extension.</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/5-10-historictaskinstancequery-extension/m-p/117886#M83200</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Not really sure why you're using a process to spawn off a new process-engine to run the simulation in… Is the issue that is presenting occurring due to the simulation NOT working well on the 5.11? Or is the original process-spawning 5.11 engine causing issues?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2013 08:26:41 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/5-10-historictaskinstancequery-extension/m-p/117886#M83200</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2013-01-22T08:26:41Z</dc:date>
    </item>
    <item>
      <title>Re: 5.10 HistoricTaskInstanceQuery extension.</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/5-10-historictaskinstancequery-extension/m-p/117887#M83201</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Simulation is working well on 5.11. in the case when it is not called from process simulation node (see &lt;/SPAN&gt;&lt;A href="https://github.com/gro-mar/process-monitor/blob/Activiti-5.11/simulator/src/test/java/org/processmonitor/simulator/TwoEnginesWithoutProcessTest.java" rel="nofollow noopener noreferrer"&gt;TwoEnginesWithoutProcessTest.java&lt;/A&gt;&lt;SPAN&gt; )&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;From my point of view the 5.11 engine is causing this issues - it is not possible to execute another process engine instance from the running process instance.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Both tests are passing with activiti-5.10 &lt;A href="https://github.com/gro-mar/activiti-crystalball" rel="nofollow noopener noreferrer"&gt;master branch&lt;/A&gt;&lt;A _jive_internal="true" href="https://community.alfresco.com/" rel="nofollow noopener noreferrer"&gt;.&lt;/A&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2013 09:06:07 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/5-10-historictaskinstancequery-extension/m-p/117887#M83201</guid>
      <dc:creator>gromar</dc:creator>
      <dc:date>2013-01-22T09:06:07Z</dc:date>
    </item>
    <item>
      <title>Re: 5.10 HistoricTaskInstanceQuery extension.</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/5-10-historictaskinstancequery-extension/m-p/117888#M83202</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This has to do with the way service-calls are handled from within a running process. In order to have the API-calls (rg, from a service-task) use the same transaction, some work has been done in the 5.11 release… So I presume the command-contexts of engine A is taken over by engine B. At least, that's what I suspect is the issue.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It's off course a highly unusual use case, to spawn a second engine from the first one. I get why you're using a separate engine for simulation (to not influence the production-engine), but not sure why the simulation should run in an engine, booted within another engine…&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2013 09:28:13 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/5-10-historictaskinstancequery-extension/m-p/117888#M83202</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2013-01-22T09:28:13Z</dc:date>
    </item>
    <item>
      <title>Re: 5.10 HistoricTaskInstanceQuery extension.</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/5-10-historictaskinstancequery-extension/m-p/117889#M83203</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The reason: Only for presentation purposes. It is easier to communicate with business people process diagrams as code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Question&lt;/STRONG&gt;&lt;SPAN&gt;: How to fix this issue?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2013 09:48:14 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/5-10-historictaskinstancequery-extension/m-p/117889#M83203</guid>
      <dc:creator>gromar</dc:creator>
      <dc:date>2013-01-22T09:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: 5.10 HistoricTaskInstanceQuery extension.</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/5-10-historictaskinstancequery-extension/m-p/117890#M83204</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ok, so the problem here is exactly how Fred describes it. By fixing transactions in 5.11, and introducing command context reuse, we've broken your use case (albeit it is a very, very exceptional use case &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; )&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem here is that the command context stack is cached thread local for further service invocations. You are using different services, but the thread local cache is the same for all these instances.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Luckily you can disable this behavior, by calling&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;nbsp; public void setContextReusePossible(boolean isContextReusePossible) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.isContextReusePossible = isContextReusePossible;&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;&lt;/CODE&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;on CommandContextInterceptor.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You could override&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;public class StandaloneProcessEngineConfiguration extends ProcessEngineConfigurationImpl {&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; protected Collection&amp;lt; ? extends CommandInterceptor&amp;gt; getDefaultCommandInterceptorsTxRequired() {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return createDefaultCommandInterceptors(true);&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;and pass true there.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2013 10:23:53 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/5-10-historictaskinstancequery-extension/m-p/117890#M83204</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2013-01-22T10:23:53Z</dc:date>
    </item>
  </channel>
</rss>

