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

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

The newest version!
{
  "id": "jsonservicecall",
  "version": "1.0",
  "name": "Service Call Workflow",
  "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"
        }
      ],
      "default": {
        "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