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

JQ Expression does not work when packaging as Natively executable binary

XMLWordPrintable

    • False
    • False
      1. Build Kogito Runtimes 2.0.0-Snapshot
      2. Implement the Jq expression as above,
      3. Package as Native application
      4. Try running native application.
    • 2021 Week 49-51 (from Dec 6th)

      Trying to use the JQ expression 

      operation: ".number|sort_by(.age)"

      where `number` is an array of objects containing the key `age`, an integer value. This expression should sort the array by the value of `age`.

      This works when I run quarkus dev mode, but when I try to package this into a Jar, i get returned

      ```
      Error: Invalid or corrupt jarfile target/quarkus-app/app/data-processing-1.0.0-SNAPSHOT.jar
      ```

       and when packaging into native + making a call I get returned:

      ```
      2021-12-16 15:49:17,763 ERROR [org.jbp.wor.ins.imp.WorkflowProcessInstanceImpl] (executor-thread-0) Unexpected error (id 94abd4c9-1366-43c3-bfe7-7a669229bc48) while executing node square in process instance 26635399-e384-4df8-9f73-c64961f7416b: org.jbpm.workflow.instance.WorkflowRuntimeException: [trial:26635399-e384-4df8-9f73-c64961f7416b - square:5] -- Unable to evaluate content {"number":[{"name":"tom","age":20},{"name":"jeff","age":19}]} using query (.number | sort_by(.age))
          at org.jbpm.workflow.instance.impl.NodeInstanceImpl.executeAction(NodeInstanceImpl.java:253)
      ```

      Speaking to ftirados he suggested the corruption in Jar packaging is unrelated. But unsure

      Also note, that running a simpler expression on the same Native executable through a different workflow endpoint, works correctly. The workflow that works correctly uses the expression: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-expression-quarkus/src/main/resources/expression.sw.json#L11
      Im using the 2.0.0-Snapshot currently from Kogito-runtimes, main branch and packaging Natively using GraalVM in Docker, through the mvn command:

       

      ```
      mvn package -Pnative -Dquarkus.native.container-build=true     
      ```
      

       

              ftirados Francisco Javier Tirado Sarti
              prattyush.mangal@ibm.com Prattyush Mangal (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: