<?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 RunOperationOnList: Operation´s subcontext cached in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/runoperationonlist-operation-s-subcontext-cached/m-p/323296#M10297</link>
    <description>&lt;P&gt;Hello!&lt;/P&gt;
&lt;P&gt;I am building a operation chain (OP_1) that this call to other operation chain (OP_2). The first operation use the RunOperationOnList with the next configuration:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;id: OP_1&lt;/LI&gt;
&lt;LI&gt;List: listUser&lt;/LI&gt;
&lt;LI&gt;insolate: false&lt;/LI&gt;
&lt;LI&gt;item: item&lt;/LI&gt;
&lt;LI&gt;newTx: false&lt;/LI&gt;
&lt;LI&gt;parameters:&lt;/LI&gt;
&lt;LI&gt;rollbackGlobal...:false&lt;/LI&gt;
&lt;LI&gt;timeout:&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;The OP_2 loggin a info message by console. This show the item value.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;ConsoleLog::message: @{Context["item"]}&lt;/LI&gt;
&lt;LI&gt;ConsoleLog::level: info&lt;/LI&gt;
&lt;/UL&gt;
&lt;H3&gt;&lt;STRONG&gt;Problem´s description&lt;/STRONG&gt;&lt;/H3&gt;
&lt;P&gt;When I launch OP_1 with listUser = {'User_1', 'User_2', 'User_3'}. OP_2 is executed three times (All OK) but show in logger 'User_1' always (ERROR!!). I have debugged &lt;STRONG&gt;org.nuxeo.ecm.automation.core.operations.execution.RunOperationOnList&lt;/STRONG&gt; and I have checked that the vars send to subContext is correct. The problem is in each execution the OP_1. When execute OP_1, &lt;STRONG&gt;org.nuxeo.ecm.automation.core.impl.OperationServiceImpl::run()&lt;/STRONG&gt; recover the chain instance from cache:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;(L192) CacheKey cacheKey = new CacheKey(operationType.getId(), inputType.getName());
(L193) chain = compiledChains.get(cacheKey);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This override the vars sended in the new subcontext, and execute the operation with old subcontext (first call). How can we ignore the cache instance?&lt;/P&gt;
&lt;P&gt;thanks, regards.&lt;/P&gt;</description>
    <pubDate>Mon, 22 May 2017 11:02:43 GMT</pubDate>
    <dc:creator>Javi_Rodríguez</dc:creator>
    <dc:date>2017-05-22T11:02:43Z</dc:date>
    <item>
      <title>RunOperationOnList: Operation´s subcontext cached</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/runoperationonlist-operation-s-subcontext-cached/m-p/323296#M10297</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;
&lt;P&gt;I am building a operation chain (OP_1) that this call to other operation chain (OP_2). The first operation use the RunOperationOnList with the next configuration:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;id: OP_1&lt;/LI&gt;
&lt;LI&gt;List: listUser&lt;/LI&gt;
&lt;LI&gt;insolate: false&lt;/LI&gt;
&lt;LI&gt;item: item&lt;/LI&gt;
&lt;LI&gt;newTx: false&lt;/LI&gt;
&lt;LI&gt;parameters:&lt;/LI&gt;
&lt;LI&gt;rollbackGlobal...:false&lt;/LI&gt;
&lt;LI&gt;timeout:&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;The OP_2 loggin a info message by console. This show the item value.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;ConsoleLog::message: @{Context["item"]}&lt;/LI&gt;
&lt;LI&gt;ConsoleLog::level: info&lt;/LI&gt;
&lt;/UL&gt;
&lt;H3&gt;&lt;STRONG&gt;Problem´s description&lt;/STRONG&gt;&lt;/H3&gt;
&lt;P&gt;When I launch OP_1 with listUser = {'User_1', 'User_2', 'User_3'}. OP_2 is executed three times (All OK) but show in logger 'User_1' always (ERROR!!). I have debugged &lt;STRONG&gt;org.nuxeo.ecm.automation.core.operations.execution.RunOperationOnList&lt;/STRONG&gt; and I have checked that the vars send to subContext is correct. The problem is in each execution the OP_1. When execute OP_1, &lt;STRONG&gt;org.nuxeo.ecm.automation.core.impl.OperationServiceImpl::run()&lt;/STRONG&gt; recover the chain instance from cache:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;(L192) CacheKey cacheKey = new CacheKey(operationType.getId(), inputType.getName());
(L193) chain = compiledChains.get(cacheKey);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This override the vars sended in the new subcontext, and execute the operation with old subcontext (first call). How can we ignore the cache instance?&lt;/P&gt;
&lt;P&gt;thanks, regards.&lt;/P&gt;</description>
      <pubDate>Mon, 22 May 2017 11:02:43 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/runoperationonlist-operation-s-subcontext-cached/m-p/323296#M10297</guid>
      <dc:creator>Javi_Rodríguez</dc:creator>
      <dc:date>2017-05-22T11:02:43Z</dc:date>
    </item>
  </channel>
</rss>

