gitgabrio commented on issue #1831:
URL:
https://github.com/apache/incubator-kie-issues/issues/1831#issuecomment-2663229143
@baldimir @yesamer
About **_invoke_005_**
This is the invoked `businessKnowledgeModel`:
```xml
<businessKnowledgeModel name="bkm_005" id="_bkm_005">
<variable name="bkm_005"/>
<encapsulatedLogic>
<formalParameter name="arg"/>
<literalExpression typeRef="number">
<text>[arg]</text>
</literalExpression>
</encapsulatedLogic>
</businessKnowledgeModel>
```
So:
1. it receives any possible argument as variable `arg` (`formalParameter`
without any specific type)
2. it change it to array (`literalExpression.text`)
3. it triies coerce to number (`literalExpression.typeRef`)
if invoked with `10`
10 -> [10] -> 10
This is the tested decision
```xml
<decision name="invoke_005" id="_invoke_005">
<variable name="invoke_005" typeRef="number"/>
<knowledgeRequirement>
<requiredKnowledge href="#_bkm_005"/>
</knowledgeRequirement>
<invocation typeRef="number"> <!-- bkm returns number array but
invocation type is a number -->
<literalExpression>
<text>bkm_005</text>
</literalExpression>
<binding>
<parameter name="arg"/>
<literalExpression>
<text>[10]</text>
</literalExpression>
</binding>
</invocation>
</decision>
```
1. the binding part creates an `arg` parameter that is it an `array`
2. but since the `invocation.TypeRef` is `number`, that single element array
is coerced to number
3. so, the number is sent as arg parameter to bkm_005
[10] -> 10 -> bkm_005(10)
The original
[comment](https://github.com/dmn-tck/tck/pull/238#issuecomment-497744315) from
Matteo also mention that, but I have the impression something changed in the
meantime.
See **_Result of invoke_005 is wrong._**
--
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]