All Downloads are FREE. Search and download functionalities are using the official Maven repository.

o.examples.serverless-workflow-service-calls-quarkus.1.20.0.Final.source-code.countryservice.sw.json Maven / Gradle / Ivy

There is a newer version: 1.25.0.Final
Show newest version
{
  "id": "jsonservicecall",
  "version": "1.0",
  "name": "Service Call Workflow",
  "expressionLang": "jsonpath",
  "description": "JSON based service call workflow",
  "start": "GetCountryInfo",
  "functions": [
    {
      "name": "countryInfoFunction",
      "operation": "restcountries.json#getByName1"
    },
    {
      "name": "classifySmallMediumFunction",
      "metadata": {
        "interface": "org.kogito.serverless.examples.CountriesClassifierResource",
        "operation": "classifySmallMedium",
        "type": "service"
      }
    },
    {
      "name": "classifyLargeFunction",
      "metadata": {
        "interface": "org.kogito.serverless.examples.CountriesClassifierResource",
        "operation": "classifyLarge",
        "type": "service"
      }
    }
  ],
  "states": [
    {
      "name": "GetCountryInfo",
      "type": "operation",
      "actionMode": "sequential",
      "actions": [
        {
          "name": "getCountryInfo",
          "functionRef": {
            "refName": "countryInfoFunction",
            "arguments": {
              "name": "$.name"
            }
          }
        }
      ],
      "transition": "ClassifyByPopulation"
    },
    {
      "name": "ClassifyByPopulation",
      "type": "switch",
      "dataConditions": [
        {
          "condition": "${ $.response[0].[?(@.population < 20000000)] }",
          "transition": "ClassifyAsSmallOrMedium"
        },
        {
          "condition": "${ $.response[0].[?(@.population >= 20000000)] }",
          "transition": "ClassifyAsLarge"
        }
      ],
      "defaultCondition": {
        "transition": "ClassifyAsSmallOrMedium"
      }
    },
    {
      "name": "ClassifyAsSmallOrMedium",
      "type": "operation",
      "actionMode": "sequential",
      "actions": [
        {
          "name": "classifyIntoSmallOrMedium",
          "functionRef": "classifySmallMediumFunction"
        }
      ],
      "end": true
    },
    {
      "name": "ClassifyAsLarge",
      "type": "operation",
      "actionMode": "sequential",
      "actions": [
        {
          "name": "classifyIntoLarge",
          "functionRef": "classifyLargeFunction"
        }
      ],
      "end": true
    }
  ]
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy