Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-3879

Create Kogito version of Test Scenarios designer

    XMLWordPrintable

Details

    • 2019 Week 41-43 (from Okt 7), 2019 Week 47-49 (from Nov 18), 2019 Week 50-52 (from Dec 9), 2020 Week 01-03 (from Dec 30), 2020 Week 04-06 (from Jan 20), 2020 Week 07-09 (from Feb 10), 2020 Week 10-12 (from Mar 2), 2020 Week 13-15 (from Mar 23)
    • 5
    • High
    • NEW
    • NEW

    Description

      Scope of this PR is to create a Kogito/client-side only versions of scesim editor.
      From an architectural point of view, the actual implementation has been moved (in the past) inside a common module: `drools-wb-scenario-simulation-editor-client`.
      Access to it has been "hided" behind a wrapper interface with three actual implementations:

      • `drools-wb-scenario-simulation-editor-businesscentral-client` for BusinessCentral environment
      • `drools-wb-scenario-simulation-editor-kogito-testing` to provide a development/debugging setup for the Kogito/client-side only environment
      • `drools-wb-scenario-simulation-editor-kogito-runtime` that should be the one deployed in actual client-side only containers (e.g. VSCode).
        As agreed upon in the last summer (https://issues.redhat.com/browse/AF-2041), the kogito editors should depend upon a common library, `org.kie.workbench:kie-wb-common-kogito-webapp-base` to put all the code/maven configuration shared by the different editors in one single place.
        Currently, only the two kogito-related scesim modules fulfill that requirement; all other editors, starting from DMN, should be adapted to this approach.

      Kogito-testing module is a standalone showcase that provides some minimum interaction to:

      • load DMN files
      • create DMN-related scesim assets, selecting one of the imported DMN.
        Currently - RULE/data object model scesim is disabled.

      Kogito-runtime module is the version that should run purely client side. It does not provide any graphical widget to load/create/save asset.
      Some minimal tests may be done in the following way:

      1. full compilation (i.e. included GWT compilation) of the runtime module
      2. open the `drools-wb/drools-wb-screens/drools-wb-scenario-simulation-editor/drools-wb-scenario-simulation-editor-kogito-runtime/target/drools-wb-scenario-simulation-editor-kogito-runtime/index.html` file inside Chrome
      3. inside the Chrome dev console, issue the command `window.gwtEditorBeans.get("ScenarioSimulationEditorKogitoRuntimeScreen").get().setContent("")`; this will show the "New Scesim" popup, where user may choose to create a DMN or RULE scesim; of course, inside Chrome it is not possible to have a reference to other resources, so only "Rule" will work; at the same time, no Data model is available inside Chrome, so the right panel will be empty and the only expected result is an empty grid.
      4. edit the asset
      5. invoke window.gwtEditorBeans.get("ScenarioSimulationEditorKogitoRuntimeScreen").get().getContent() and store the returned xml
      6. invoke window.gwtEditorBeans.get("ScenarioSimulationEditorKogitoRuntimeScreen").get().setContent method with the stored xml

      Some tricks: to avoid CORS and other policy-related issues:

      1. set chrome://flags/#allow-insecure-localhost for invalid certificates error
      2. start chrome from cli with the command `chrome --allow-file-access-from-files` to allow loading from file.

      /----/
      The "run scenario" functionality won't be implemented by this PR.
      All the functionalities related to file system/resource access will be simulated in the testing modules (but only for the DMN models), and for the runtime module will depend on the API/environment provided by VSCode

      Attachments

        Issue Links

          Activity

            People

              yamer@redhat.com Yeser Amer
              gcardosi Gabriele Cardosi (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: