{
  "version": "1.8.2",
  "timeZone": "Etc/UTC",
  "title": "Python API example",
  "orderPreparation": {
    "parameters": {
      "color_blue": {
        "type": "String",
        "default": "\"blue\""
      },
      "color_red": {
        "type": "String",
        "default": "\"red\""
      },
      "color_orange": {
        "type": "String",
        "default": "\"orange\""
      },
      "num_of_days": {
        "type": "Number",
        "default": "3"
      },
      "is_end_of_month": {
        "type": "Boolean",
        "default": "true"
      },
      "password": {
        "type": "String",
        "default": "\"secret\""
      }
    },
    "allowUndeclared": false
  },
  "instructions": [
    {
      "TYPE": "Execute.Named",
      "jobName": "job-python-get-arguments",
      "label": "job-python-get-arguments"
    },
    {
      "TYPE": "Execute.Named",
      "jobName": "job-python-list-arguments",
      "label": "job-python-list-arguments"
    }
  ],
  "jobs": {
    "job-python-get-arguments": {
      "agentName": "testAgent",
      "withSubagentClusterIdExpr": false,
      "executable": {
        "TYPE": "InternalExecutable",
        "internalType": "Python_Graal",
        "script": "class JS7Job(js7.Job):\n    def processOrder(self, js7Step):\n        # Access argument by name\n        js7Step.getLogger().info(\"[getAllArgumentsAsNameValueMap] by name:\")\n        color_blue = js7Step.getAllArgumentsAsNameValueMap()[\"color_blue\"]\n        js7Step.getLogger().info(f\"argument color_blue={color_blue}\")"
      },
      "skipIfNoAdmissionForOrderDay": false,
      "killAtEndOfAdmissionPeriod": false,
      "parallelism": 1,
      "graceTimeout": 1,
      "failOnErrWritten": false,
      "warnOnErrWritten": false,
      "isNotRestartable": false
    },
    "job-python-list-arguments": {
      "agentName": "testAgent",
      "withSubagentClusterIdExpr": false,
      "executable": {
        "TYPE": "InternalExecutable",
        "internalType": "Python_Graal",
        "script": "class JS7Job(js7.Job):\n    def processOrder(self, js7Step):\n        logger = js7Step.getLogger()\n\n        # Get list of all arguments\n        args = js7Step.getAllArguments()\n\n        logger.info(\"[getAllArguments]:\")\n\n        for key, arg in args.items():\n            logger.info(f\"argument: {key}={arg.getValue()}\")"
      },
      "skipIfNoAdmissionForOrderDay": false,
      "killAtEndOfAdmissionPeriod": false,
      "parallelism": 1,
      "graceTimeout": 1,
      "failOnErrWritten": false,
      "warnOnErrWritten": false,
      "isNotRestartable": false
    }
  }
}