martinweiler opened a new pull request, #7232:
URL: https://github.com/apache/incubator-kie/pull/7232

   This is a follow-up to https://github.com/apache/incubator-kie/pull/7199, 
which led to failing tests.
   
   **Change**: Stop `OutputExpressionAssignment` from leaking 
`FormalExpression_N` as a process variable
   
   **Description**
   
   `OutputExpressionAssignment.execute()` ended with 
`producer.accept(to.getId(), value)`. `to.getId()` is the XML `id` of the 
`<to>` element, for example `FormalExpression_3`. It is not a declared 
variable. For an output such as `<to>#{account.person}</to>`, MVEL already 
writes the value into the target object. The extra `producer.accept` call then 
created an undeclared process variable, and `NodeInstanceImpl.setVariable` 
logged "Could not find variable" and stored it at process level. Before the new 
`unbind()` logic, only declared fields were copied back, so nobody noticed. Now 
the stray entry ended up in `additionalProperties`, which made 
`BusinessRuleTaskIT.testBusinessRuleTaskWithIOExpression` fail with `Expected 
size: 1 but was: 2`.
   
   **Changes**
   - `OutputExpressionAssignment`:
     - Expressions that point to an object property (`#{a.b}`) are still 
written by MVEL, and nothing is passed to the producer.
     - A bare variable (`#{y}`) is now passed to the producer under the 
variable name. Previously its value was lost and the `to.getId()` entry was the 
only side effect. This case only reaches the class when the assignment declares 
a language, because otherwise the BPMN parser simplifies `#{y}` to `y`.
   - New `OutputExpressionAssignmentTest` covers a bare variable, a bare 
variable with whitespace, and a property path, and it asserts that nothing is 
produced for the property path.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to