Open Edition

 View Only
Expand all | Collapse all

scesim file testing across multiple dmn connected with services

  • 1.  scesim file testing across multiple dmn connected with services

    Posted Wed December 13, 2023 09:24 AM

    Hi

    We have a project that has about 13 dmn files, and they are connected using the services.
    We have dmn files that have 1 - 4 imported dmn services from other dmn, so a lot of inter dependency across them.
    We want to use scesim files to perform scenario testing now.
    Its fine for the bottom level dmn with no dependency, all straight forward.
    The issues are coming when we generate scesim files on the dmn that have service dependencies to other dmn.
    We are getting errors saying it cannot evaluate the service DMN to get the Expected vlaue.
    This is a snip of the error log:
    org.drools.scenariosimulation.backend.runner.IndexedScenarioException: #1 Scenario 1: DMN execution has not generated a decision result with name Eligibility.Customer Permanent Canadian Resident Indicator (Application Auto Decline Indicator)
     at org.drools.scenariosimulation.backend.runner.AbstractScenarioRunner.defineFailureException(AbstractScenarioRunner.java:142)
     at org.drools.scenariosimulation.backend.runner.AbstractScenarioRunner.singleRunScenario(AbstractScenarioRunner.java:125)
     at org.drools.scenariosimulation.backend.runner.AbstractScenarioRunner.run(AbstractScenarioRunner.java:101)
     at org.kogito.scenariosimulation.runner.KogitoJunitActivator.runChild(KogitoJunitActivator.java:32)
     at org.kogito.scenariosimulation.runner.KogitoJunitActivator.runChild(KogitoJunitActivator.java:23)
    Caused by: org.drools.scenariosimulation.backend.runner.ScenarioException: DMN execution has not generated a decision result with name Eligibility.Customer Permanent Canadian Resident Indicator
     at org.drools.scenariosimulation.backend.runner.DMNScenarioRunnerHelper.verifyConditions(DMNScenarioRunnerHelper.java:188)
     at org.drools.scenariosimulation.backend.runner.AbstractRunnerHelper.run(AbstractRunnerHelper.java:97)
     at org.drools.scenariosimulation.backend.runner.AbstractScenarioRunner.internalRunScenario(AbstractScenarioRunner.java:148)
     at org.drools.scenariosimulation.backend.runner.AbstractScenarioRunner.singleRunScenario(AbstractScenarioRunner.java:122)
     
    Hoping you can assist on this.


    ------------------------------
    Kishan Kumar
    ------------------------------


  • 2.  RE: scesim file testing across multiple dmn connected with services

    Posted Thu December 14, 2023 11:08 AM

    Hi thank you for this question, it is seems to be a really important use case of SceSim.

    Included models general troubles
    Before I respond in more detail, let my say, that included models are for now not in 100% state. Execution of models that includes another model causes us some troubles, see this issues bellow, that are not for SceSim but for the DMN Runner, but behind the scene, both need to execute a DMN model.
    - https://github.com/apache/incubator-kie-issues/issues/403
    - https://github.com/apache/incubator-kie-issues/issues/406

    VSCode Included models existing issues
    Furthermore, I checked also existing issues for the VSCode and Included models, I found one, could you please check if that may be somehow similar to your issue?
    - https://github.com/apache/incubator-kie-issues/issues/602

    I tried to follow your use case locally:
    Environment

    • https://github.com/apache/incubator-kie-kogito-examples/tree/main => kogito version (2.0.0-SNAPSHOT)
    • VS Code KIE DMN Editor - v0.32.0

    I created two files with services


    Then I used them in third file
    And created a scesim that was successfully executed
    I think we will need details of your project (with customer sensitive data washed of course), because the issue you are experiencing is probably related to some details like:
    • naming of nodes
    • usage of nodes
    • types of nodes
    • content of decision service nodes
    • ...

    Sorry that for now I do not have proper answer for you. I believe we will figure out the rootcause together


    ------------------------------
    Jozef Marko
    Software Developer
    IBM
    ------------------------------



  • 3.  RE: scesim file testing across multiple dmn connected with services

    Posted Fri December 15, 2023 02:33 AM

    Hi @Kishan Kumar, and thank you @Jozef Marko for your reply.

    According to the error message, I tend to agree with Jozef and I guess the root cause of the issue is related to the nodes management.
    Please consider that any change on the DMN file will be not automatically updated in scesim column grid, but requires a manual change. 
    To give you an example: Let's suppose you have a DMN file with a decision node with "A" as a name. Now, you create a scesim file based on that DMN file. You should already see an "A" instance with its fields in the grid. You add your data and save the scesim file. Let's now suppose that, for any reason, you want to modify the original DMN file, renaming the decision node "A" to "B". This change will be not automatically reflected in the scesim file, you will need to substitute the "A" instance with "B". That works like a Junit test: if you change the API of the target class you want to test, you need to update its test class accordingly.
    In my opinion, this is the root cause of your issue, please double-check it and if that is not the case, please give us more information (having the reproducer helps a lot as Jozef said)
    Thanks, 

    Yeser



    ------------------------------
    Yeser Amer
    ------------------------------