Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kie-issues#1734: KIE Tools: TypeError when invoking Java method inside BKM #2831

Merged
merged 2 commits into from
Jan 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading