Skip to content

Commit

Permalink
kie-issues#2821: KIE Tools: TypeError when invoking Java method insid…
Browse files Browse the repository at this point in the history
…e BKM (apache#2831)

Co-authored-by: chinnamatli kusumalatha <[email protected]>
  • Loading branch information
Kusuma04-dev and chinnamatli kusumalatha authored Jan 3, 2025
1 parent fd78863 commit 88ce385
Showing 1 changed file with 27 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -332,21 +332,25 @@ export function JavaFunctionExpression({
// Class
if (u.rowIndex === 0) {
setExpression((prev: Normalized<BoxedFunctionJava>) => {
clazz.expression = {
...clazz.expression,
__$$element: "literalExpression",
text: {
__$$text: u.value,
},
};

// Do not inline this variable for type safety. See https://github.com/microsoft/TypeScript/issues/241
const ret: Normalized<BoxedFunction> = {
...prev,
expression: {
__$$element: "context",
...context,
contextEntry: [clazz, method],
contextEntry: [
{
...clazz,
expression: {
...clazz.expression,
__$$element: "literalExpression",
text: {
__$$text: u.value,
},
},
},
method,
],
},
};

Expand All @@ -356,22 +360,26 @@ export function JavaFunctionExpression({
// Method
else if (u.rowIndex === 1) {
setExpression((prev: Normalized<BoxedFunctionJava>) => {
method.expression = {
...method.expression,
__$$element: "literalExpression",
"@_id": method.expression["@_id"] ?? generateUuid(),
text: {
__$$text: u.value,
},
};

// Do not inline this variable for type safety. See https://github.com/microsoft/TypeScript/issues/241
const ret: Normalized<BoxedFunction> = {
...prev,
expression: {
__$$element: "context",
...context,
contextEntry: [clazz, method],
contextEntry: [
clazz,
{
...method,
expression: {
...method.expression,
__$$element: "literalExpression",
"@_id": method.expression["@_id"] ?? generateUuid(),
text: {
__$$text: u.value,
},
},
},
],
},
};
return ret;
Expand Down

0 comments on commit 88ce385

Please sign in to comment.