You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kie.apache.org by "phungvannarich-kepler-aavn (via GitHub)" <gi...@apache.org> on 2024/12/24 09:00:02 UTC
[I] Unable to run Test Scenario (SCESIM) with Java code in a DMN rule [incubator-kie-issues]
phungvannarich-kepler-aavn opened a new issue, #1732:
URL: https://github.com/apache/incubator-kie-issues/issues/1732
Hi, here is my configuration in the DMN file:



Here is my Java class:

This is test configuration:

Here is my Test Scenario (SCESIM) configuration:

When I run the test scenario, there are no logs from the Java function, and the return value is always null.
Could you please help me figure out what’s wrong with my code?
%TSTTREE2,test,true,1,false,-1,test,,
%TSTTREE3,#1: test(test),false,1,false,-1,#1: test(test),,
%TESTS 2,test
%TESTS 3,#1: test(test)
%FAILED 3,#1: test(test)
%TRACES
org.drools.scenariosimulation.backend.runner.IndexedScenarioAssertionError: #1 test: Failed in "UpdateFunction": The expected value is ""Data from Java Code"" but the actual one is "null" (test)
at org.drools.scenariosimulation.backend.runner.AbstractScenarioRunner.defineFailureException(AbstractScenarioRunner.java:139)
at org.drools.scenariosimulation.backend.runner.AbstractScenarioRunner.singleRunScenario(AbstractScenarioRunner.java:127)
at org.drools.scenariosimulation.backend.runner.AbstractScenarioRunner.run(AbstractScenarioRunner.java:103)
at org.kogito.scenariosimulation.runner.KogitoJunitActivator.runChild(KogitoJunitActivator.java:35)
at org.kogito.scenariosimulation.runner.KogitoJunitActivator.runChild(KogitoJunitActivator.java:26)
at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:93)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:40)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:520)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:748)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:443)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:211)
Caused by: org.drools.scenariosimulation.backend.runner.ScenarioException: Failed in "UpdateFunction": The expected value is ""Data from Java Code"" but the actual one is "null"
at org.drools.scenariosimulation.backend.runner.AbstractRunnerHelper.throwScenarioException(AbstractRunnerHelper.java:286)
at org.drools.scenariosimulation.backend.runner.AbstractRunnerHelper.validateAssertion(AbstractRunnerHelper.java:272)
at org.drools.scenariosimulation.backend.runner.AbstractRunnerHelper.run(AbstractRunnerHelper.java:104)
at org.drools.scenariosimulation.backend.runner.AbstractScenarioRunner.internalRunScenario(AbstractScenarioRunner.java:150)
at org.drools.scenariosimulation.backend.runner.AbstractScenarioRunner.singleRunScenario(AbstractScenarioRunner.java:124)
... 16 more
%TRACEE
%TESTE 3,#1: test(test)
%TESTS 2,test
%RUNTIME2102
--
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: commits-unsubscribe@kie.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [I] Unable to run Test Scenario (SCESIM) with Java code in a DMN rule [incubator-kie-issues]
Posted by "yesamer (via GitHub)" <gi...@apache.org>.
yesamer closed issue #1732: Unable to run Test Scenario (SCESIM) with Java code in a DMN rule
URL: https://github.com/apache/incubator-kie-issues/issues/1732
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [I] Unable to run Test Scenario (SCESIM) with Java code in a DMN rule [incubator-kie-issues]
Posted by "yesamer (via GitHub)" <gi...@apache.org>.
yesamer commented on issue #1732:
URL: https://github.com/apache/incubator-kie-issues/issues/1732#issuecomment-2575314673
@phungvannarich-kepler-aavn In addition to @jomarko question, can you please tell us which Kogito version are you using? Can you please share the reproducer?
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [I] Unable to run Test Scenario (SCESIM) with Java code in a DMN rule [incubator-kie-issues]
Posted by "jomarko (via GitHub)" <gi...@apache.org>.
jomarko commented on issue #1732:
URL: https://github.com/apache/incubator-kie-issues/issues/1732#issuecomment-2567624128
is the `Class name` in the second provided screenshot correct?
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [I] Unable to run Test Scenario (SCESIM) with Java code in a DMN rule [incubator-kie-issues]
Posted by "yesamer (via GitHub)" <gi...@apache.org>.
yesamer commented on issue #1732:
URL: https://github.com/apache/incubator-kie-issues/issues/1732#issuecomment-2679477953
I tested the feature with another example (https://github.com/dmarrazzo/dmn-calls-java) and it worked.
Without the complete reproducer, it's not easy to determine what's wrong in your code.
According to your screenshots, the only error I see is the method signature of the BKM node.
You should use the FQCN in the parameter (eg. `executeRuleFunction(java.lang.String)` instead of `executeRuleFunction(String)`
Closing as an answer has been provided. Feel free to reopen.
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org