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

[SW]: Implement OpenAPI Error Forwarding to Workflow Caller

    XMLWordPrintable

Details

    • False
    • False
    • 2022 Week 05-07 (from Jan 31)

    Description

      • Produce a workflow which calls out to OpenAPI,
      • Send incorrect data through Workflow to OpenAPI Operation,
      • OpenAPI Sends back error

      Currently, when the OpenAPI Returns an Error, the running SW Quarkus Application will through an error at runtime, instead of propogating the OpenAPI Error back to the Workflow Caller (person who triggers the Workflow).

      To be more resilient to Errors as results of OpenAPIs we would like to send the OpenAPI Errors back to the User rather then the Internal Quarkus Errors. This way, the User can retry a call to the workflow with a better idea of what went wrong (perhaps they missed an Input).

       

      Current Behaviour:

      Error Returned to User is internal Quarkus Error.

      {"details":"Error id 7a1bf174-56d7-4122-8e7c-6259b3d8f264-1, org.jboss.resteasy.spi.UnhandledException: org.kie.kogito.process.ProcessInstanceExecutionException: Process instance with id aa0ab2e3-5e91-4db5-ade8-58ede73020d2 not found","stack":"org.jboss.resteasy.spi.UnhandledException: ....

      Viewing the Quarkus Application Logs, we can see the OpenAPI Returned a different Error 400, Input Error:

      2022-02-02 08:52:25,601 ERROR [org.jbp.wor.ins.imp.WorkflowProcessInstanceImpl] (executor-thread-0) Unexpected error (id f7bd1544-695d-43e7-8069-0d35001a0a4b) while executing node sendCallToApi in process instance b3494588-61e4-4418-9c9e-280de7c1bc40: org.jbpm.workflow.instance.WorkflowRuntimeException: [callrestapi:b3494588-61e4-4418-9c9e-280de7c1bc40 - sendCallToApi:6] -- {"code":400,"message":"Input error: unable to convert input to io.swagger.petstore.model.Order"} 

       

      Expected Behaviour:

      Propogate back the "400 Error Message" to the User rather then the Internal Quarkus Error.

       

       

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: