RunOperationOnList: Operation´s subcontext cached

Hello!

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:

  • id: OP_1
  • List: listUser
  • insolate: false
  • item: item
  • newTx: false
  • parameters:
  • rollbackGlobal…:false
  • timeout:

The OP_2 loggin a info message by console. This show the item value.

  • ConsoleLog::message: @{Context[“item”]}
  • ConsoleLog::level: info

Problem´s description

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 org.nuxeo.ecm.automation.core.operations.execution.RunOperationOnList 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, org.nuxeo.ecm.automation.core.impl.OperationServiceImpl::run() recover the chain instance from cache:

(L192) CacheKey cacheKey = new CacheKey(operationType.getId(), inputType.getName());
(L193) chain = compiledChains.get(cacheKey);

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?

thanks, regards.

1 votes

0 answers

1902 views

ANSWER