Decision Management

Expand all | Collapse all

Fail calling decision services in embedded runtime from BAW

Jump to Best Answer
  • 1.  Fail calling decision services in embedded runtime from BAW

    Posted Fri July 02, 2021 09:31 AM
    Hi,

    I've created a simple decision service and deployed it to the embedded runtime.

    Calling it from Postman works fine, but not as a service task from a BAW Service Flow where I get a "Error 404: Not Found" as response back.

    The OpenAPI definition seems to be compiled okay, but suspect when calling it the URL gets messed up and endpoint is not to be found.

    Any idea how to monitor what is actually been sent from BAW, or any ideas how to solve the problem?

    curl -X GET "https://ads-runtime-cp4ba-sandbox-project-3.cp4ba-sandbox-3-f5b8d29bbb59ac356f29c367678c92d8-0000.eu-de.containers.appdomain.cloud/ads/runtime/api/v1/deploymentSpaces/embedded/decisions/decisions%2Fjonas_sandbox2%2Floan_approval%2FloanApprovalDecisionService%2F7%2FloanApprovalDecisionService-7.jar/openapi?outputFormat=JSON" -H "accept: */*" -H "Authorization: Basic [PRIVATE]"

    {
      "openapi" : "3.0.1",
      "info" : {
        "title" : "decisions.jonas_sandbox2.loan_approval",
        "description" : "decisions.jonas_sandbox2.loan_approval",
        "version" : "7"
      },
      "servers" : [ {
        "url" : "https://ads-runtime-cp4ba-sandbox-project-3.cp4ba-sandbox-3-f5b8d29bbb59ac356f29c367678c92d8-0000.eu-de.containers.appdomain.cloud/ads/runtime/api/v1/deploymentSpaces/embedded/decisions/decisions%2Fjonas_sandbox2%2Floan_approval%2FloanApprovalDecisionService%2F7%2FloanApprovalDecisionService-7.jar/operations"
      } ],
      "security" : [ {
        "Basic" : [ ]
      }, {
        "UMS" : [ ]
      } ],
      "paths" : {
        "/loan-Approval-Decision-Model/execute" : {
          "post" : {
            "tags" : [ "loanApproval" ],
            "description" : "Execute loan-Approval-Decision-Model",
            "operationId" : "loan-Approval-Decision-Model",
            "requestBody" : {
              "content" : {
                "application/json" : {
                  "schema" : {
                    "$ref" : "#/components/schemas/loan-Approval-Decision-Model_input"
                  }
                }
              }
            },
            "responses" : {
              "200" : {
                "description" : "Decision execution success",
                "content" : {
                  "application/json" : {
                    "schema" : {
                      "type" : "boolean"
                    }
                  }
                }
              },
              "404" : {
                "description" : "A decision or decision operation was not found",
                "content" : {
                  "application/json" : {
                    "schema" : {
                      "$ref" : "#/components/schemas/decisions.jonas_sandbox2.loan_approval_Incident"
                    }
                  }
                }
              },
              "500" : {
                "description" : "A runtime exception occurred while executing a decision",
                "content" : {
                  "application/json" : {
                    "schema" : {
                      "$ref" : "#/components/schemas/decisions.jonas_sandbox2.loan_approval_Incident"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "components" : {
        "schemas" : {
          "Borrower" : {
            "type" : "object",
            "properties" : {
              "age" : {
                "type" : "integer"
              },
              "credits" : {
                "type" : "number",
                "format" : "double"
              },
              "income" : {
                "type" : "number",
                "format" : "double"
              },
              "name" : {
                "type" : "string"
              }
            }
          },
          "Request" : {
            "type" : "object",
            "properties" : {
              "amount" : {
                "type" : "number",
                "format" : "double"
              },
              "terms" : {
                "type" : "integer"
              }
            }
          },
          "loan-Approval-Decision-Model_input" : {
            "type" : "object",
            "properties" : {
              "borrower" : {
                "$ref" : "#/components/schemas/Borrower"
              },
              "request" : {
                "$ref" : "#/components/schemas/Request"
              }
            },
            "x-dba-parameter-wrapper" : true
          },
          "decisions.jonas_sandbox2.loan_approval_Incident" : {
            "type" : "object",
            "properties" : {
              "incidentId" : {
                "type" : "string",
                "description" : "A unique identifier for the incident."
              },
              "incidentCategory" : {
                "type" : "string",
                "description" : "The category of the incident, for instance \"Decision not found\"."
              },
              "stackTrace" : {
                "type" : "string",
                "description" : "An associated stack trace, if the decision runtime is configured to provide it. By default, the stack trace is null."
              }
            },
            "description" : "The description of the decision execution failure."
          }
        },
        "securitySchemes" : {
          "Basic" : {
            "type" : "http",
            "scheme" : "basic"
          },
          "UMS" : {
            "type" : "http",
            "scheme" : "bearer"
          }
        }
      }
    }


    ------------------------------
    Jonas
    ------------------------------


  • 2.  RE: Fail calling decision services in embedded runtime from BAW
    Best Answer

    Posted Sat July 03, 2021 02:35 AM
    I managed to make it work by converting the open API 3.0 definition exported from ADS to swagger 2.0.

    ------------------------------
    Jonas
    ------------------------------



  • 3.  RE: Fail calling decision services in embedded runtime from BAW

    Posted Sun July 04, 2021 08:53 AM
    But i was not able to do that with API 3.0

    ------------------------------
    Lexi Edwards
    ------------------------------



  • 4.  RE: Fail calling decision services in embedded runtime from BAW

    Posted Sun July 04, 2021 09:29 AM

    Me neither, why I had to convert it. Strange though, since 3.0 should be supported according to the documentation

    What makes everything even more strange is that a rule update requires a new version of the service, even though the contract is the same. This is leading to tightly coupling between the process and the rules. The main reason why we in the first place consider to use ADS instead of built-in decisions in BAW.



    ------------------------------
    Jonas
    ------------------------------



  • 5.  RE: Fail calling decision services in embedded runtime from BAW

    Posted Wed July 14, 2021 08:42 AM
    Same here, i was not able to do that with API 3.0.

    ------------------------------
    Karen Betty
    ------------------------------