Uploaded image for project: 'Kogito'
  1. Kogito
  2. KOGITO-9201

SWF - getSelectedDefinition API function doesn't translate all fields

    XMLWordPrintable

Details

    • False
    • None
    • False
    • Hide
      1. Open a workflow swf-example-actions.sw.json using swf editor in any channel except the VSCode.
      2. Open console and switch to serverless-workflow-combined-editor frame.
      3. Select the node.
      4. Execute the following command:
        editor.session.getSelectedDefinition().then(definition => console.log(definition))
        

      Actual result

      Promise is rejected.

      Expected result

      The object with all elements that are present in the source definition is returned.
      The fields names and values are the same as in the source definition.

      Show
      Open a workflow swf-example-actions.sw.json using swf editor in any channel except the VSCode. Open console and switch to serverless-workflow-combined-editor frame. Select the node. Execute the following command: editor.session.getSelectedDefinition().then(definition => console.log(definition)) Actual result Promise is rejected. Expected result The object with all elements that are present in the source definition is returned. The fields names and values are the same as in the source definition.
    • ---
    • ---

    Description

      getSelectedDefinition function from SWF Combined Editor API doesn't work properly.

      The function:

      editor.session.getSelectedDefinition()
      

      There are two issues:

      • Some of the fields are not translated at all. Error message for Rejected Promise:
      {"stack":"Error: Failed to execute 'postMessage' on 'Window': function prj(){} could not be cloned.\n    at Object.postMessage (http://127.0.0.1:5500/serverless-workflow-diagram-editor-envelope.js:15822:69)\n    at __webpack_modules__.36729.EnvelopeClient.send (http://127.0.0.1:5500/serverless-workflow-diagram-editor-envelope.js:13186:18)\n    at EnvelopeBusMessageManager.send (http://127.0.0.1:5500/serverless-workflow-diagram-editor-envelope.js:13156:97)\n    at __webpack_modules__.30927.EnvelopeBusMessageManager.respond (http://127.0.0.1:5500/serverless-workflow-diagram-editor-envelope.js:12977:14)\n    at http://127.0.0.1:5500/serverless-workflow-diagram-editor-envelope.js:13028:23"}
      
      • Private fields in jstypes are not translated correctly.
        • Some workflows work. For example you can remove actions from attached workflow and follow the steps to reproduce. In this case "b: true" will be part of the definition elements instead of "end: true".

      Combined Editor API can be accessed using serverless-logic-web-tools:

      1. Run a web server in the root folder: build_artifacts/packages/serverless-logic-web-tools/dist
      2. Open index.html in your browser (located at root build_artifacts/packages/serverless-logic-web-tools/dist/index.html)
      3. Open web console

      Attachments

        Issue Links

          Activity

            People

              eignatow Eder Ignatowicz
              lterifaj@redhat.com Lubomir Terifaj
              Lubomir Terifaj Lubomir Terifaj
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: