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

[Fix #3415] Allow constant values in user task assignments #3416

Merged
merged 2 commits into from
Feb 28, 2024

Conversation

fjtirado
Copy link
Contributor

@fjtirado fjtirado commented Feb 26, 2024

Fix #3415

The older regular expression check does not longer makes sense, It prevents variables in user task model generated classes to be assigned to constant values.

@kie-ci3
Copy link
Contributor

kie-ci3 commented Feb 26, 2024

PR job #1 was: UNSTABLE
Possible explanation: This should be test failures

Reproducer

build-chain build full_downstream -f 'https://raw.githubusercontent.com/${AUTHOR:apache}/incubator-kie-kogito-pipelines/${BRANCH:main}/.ci/buildchain-config-pr-cdb.yaml' -o 'bc' -p apache/incubator-kie-kogito-runtimes -u #3416 --skipParallelCheckout

NOTE: To install the build-chain tool, please refer to https://github.com/kiegroup/github-action-build-chain#local-execution

Please look here: https://ci-builds.apache.org/job/KIE/job/kogito/job/main/job/pullrequest_jobs/job/kogito-runtimes-pr/job/PR-3416/1/display/redirect

Test results:

  • PASSED: 2262
  • FAILED: 2

Those are the test failures:

org.kie.kogito.codegen.process.ProcessGenerationIT.testProcessGeneration(String)[25] Value <#{person.name}> is not valid for datatype: org.jbpm.process.core.datatype.impl.type.ObjectDataType@4fffe3d1
org.kie.kogito.codegen.tests.UserTaskIT.testUserTaskWithIOexpressionProcess Value <#{person.name}> is not valid for datatype: org.jbpm.process.core.datatype.impl.type.ObjectDataType@4fffe3d1

@kie-ci3
Copy link
Contributor

kie-ci3 commented Feb 26, 2024

PR job #2 was: UNSTABLE
Possible explanation: This should be test failures

Reproducer

build-chain build full_downstream -f 'https://raw.githubusercontent.com/${AUTHOR:apache}/incubator-kie-kogito-pipelines/${BRANCH:main}/.ci/buildchain-config-pr-cdb.yaml' -o 'bc' -p apache/incubator-kie-kogito-runtimes -u #3416 --skipParallelCheckout

NOTE: To install the build-chain tool, please refer to https://github.com/kiegroup/github-action-build-chain#local-execution

Please look here: https://ci-builds.apache.org/job/KIE/job/kogito/job/main/job/pullrequest_jobs/job/kogito-runtimes-pr/job/PR-3416/2/display/redirect

Test results:

  • PASSED: 2210
  • FAILED: 2

Those are the test failures:

org.kie.kogito.codegen.process.ProcessGenerationIT.testProcessGeneration(String)[117] Value <#{person.name}> is not valid for datatype: org.jbpm.process.core.datatype.impl.type.ObjectDataType@4fffe3d1
org.kie.kogito.codegen.tests.UserTaskIT.testUserTaskWithIOexpressionProcess Value <#{person.name}> is not valid for datatype: org.jbpm.process.core.datatype.impl.type.ObjectDataType@4fffe3d1

@kie-ci3
Copy link
Contributor

kie-ci3 commented Feb 26, 2024

PR job #3 was: UNSTABLE
Possible explanation: This should be test failures

Reproducer

build-chain build full_downstream -f 'https://raw.githubusercontent.com/${AUTHOR:apache}/incubator-kie-kogito-pipelines/${BRANCH:main}/.ci/buildchain-config-pr-cdb.yaml' -o 'bc' -p apache/incubator-kie-kogito-runtimes -u #3416 --skipParallelCheckout

NOTE: To install the build-chain tool, please refer to https://github.com/kiegroup/github-action-build-chain#local-execution

Please look here: https://ci-builds.apache.org/job/KIE/job/kogito/job/main/job/pullrequest_jobs/job/kogito-runtimes-pr/job/PR-3416/3/display/redirect

Test results:

  • PASSED: 2626
  • FAILED: 2

Those are the test failures:

org.kie.kogito.codegen.process.ProcessGenerationIT.testProcessGeneration(String)[25] Value <#{person.name}> is not valid for datatype: org.jbpm.process.core.datatype.impl.type.ObjectDataType@4fffe3d1
org.kie.kogito.codegen.tests.UserTaskIT.testUserTaskWithIOexpressionProcess Value <#{person.name}> is not valid for datatype: org.jbpm.process.core.datatype.impl.type.ObjectDataType@4fffe3d1

Copy link
Contributor

@elguardian elguardian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

expressions are something we cannot removed as they are used. You can add constants if you like in other way. not very sure what is the feedback that triggers removing this feature.
I am not against to support constants as such but you might need to find another way.

@fjtirado
Copy link
Contributor Author

fjtirado commented Feb 26, 2024

@elguardian We are not removing anything, we are allowing setting constants but adding the variable in the case the value is not an expression. If case it is an expression, the code behaves as before. Maybe my initial description was not precise, sorry about that, if you check the code, you will see that the check was moved. If the value is an expression (match the regular expression) the value is not set. The previous position of the check was preventing constant values to be added (it rejected any value that is not an expression, hence the impossibility to use anything that was not an expression as value)

@fjtirado fjtirado requested a review from elguardian February 26, 2024 16:09
Copy link
Contributor

@gmunozfe gmunozfe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, just add a test at ActivityGenerationModelTest#testUserTaskProcessWithTaskModels in jbpm-bpmn2, modifying the BPMN2-UserTask.bpmn2 to check that the constant is treated correctly.

@fjtirado fjtirado requested a review from gmunozfe February 27, 2024 20:19
Copy link
Contributor

@gmunozfe gmunozfe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks for adding the test, nice! @fjtirado

@fjtirado fjtirado merged commit 41cfa19 into apache:main Feb 28, 2024
6 checks passed
rgdoliveira pushed a commit to rgdoliveira/kogito-runtimes that referenced this pull request Mar 11, 2024
…che#3416)

* [Fix apache#3415] Allow constant values in user task assignments

* [Fix apache#3415] Gonzalos comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot assing a constant value to a user task variable
4 participants