Skip to content

Aiida status messages

Background

A status message (status_message)will be created after interpretation and validation. The status_messageis part of the JSON item and contains validation information of the item and its fields.

Status messages

Parameter Comment
type Defines what type of status message it is. See the definitions below.
message A text describing the status. In the normal case this is a warning.
metadata Contain metadata about the status. Often a list of fields or items.

Status messages can contain following status types

Parameter Comment
REQUIRED_VALUE A required value is missing. For example Invoice number is missing.
CANNOT_SHARE_VALUE Two or more fields are using the same value. For example VAT and Total can't share the same value.
DUPLICATE_ITEM At least one or more duplicate items exists.This means that another item has the same OCR and/or Invoice number within a collection.
INVALID_VALUE A value can't be parsed(bad format) or validation is false(for example OCR number checksum etc.).
INVALID_VALUE_COMBINATION Two or more values do not work in combination. For example that VAT is not a valid % rate of Total or Due Date is earlier than Invoice Date.

Example

[
  {
    "type": "DUPLICATE_ITEM",
    "message": "Duplicate warning, field values of 'Fakturanummer' exists in other items (https://app.dev.aiida.io/b7b45c42-06c6-11ea-bdfc-327afa3b762a/workflow/d703d553-9ffc-416f-a031-1f3763627582/item/cbdbbd88-b8d0-11eb-bb78-12a619e7adf8, https://app.dev.aiida.io/b7b45c42-06c6-11ea-bdfc-327afa3b762a/workflow/d703d553-9ffc-416f-a031-1f3763627582/item/2dc21c92-bd61-11eb-813f-0eb4bc4070be) in same collection",
    "metadata": {
      "fields": [
        "fd810d99-8e63-4814-ace5-7c048b49ccaf"
      ],
      "items": [
        "cbdbbd88-b8d0-11eb-bb78-12a619e7adf8",
        "2dc21c92-bd61-11eb-813f-0eb4bc4070be"
      ]
    }
  },
  {
    "type": "DUPLICATE_ITEM",
    "message": "Duplicate warning, field values of 'OCR' exists in other items (https://app.dev.aiida.io/b7b45c42-06c6-11ea-bdfc-327afa3b762a/workflow/d703d553-)ffc-416f-a031-1f3763627582/item/cbdbbd88-b8d0-11eb-bb78-12a619e7adf8, https://app.dev.aiida.io/b7b45c42-06c6-11ea-bdfc-327afa3b762a/workflow/d703d553-9ffc-416f-a031-1f3763627582/item/2dc21c92-bd61-11eb-813f-0eb4bc407011) in same collection",
    "metadata": {
      "fields": [
        "c080f592-7192-4609-8442-bd9e16b5709b"
      ],
      "items": [
        "cbdbbd88-b8d0-11eb-bb78-12a619e7adf8",
        "2dc21c92-bd61-11eb-813f-0eb4bc4070be"
      ]
    }
  },
  {
    "type": "INVALID_VALUE_COMBINATION",
    "message": "Invalid combination of values for fields 'Moms' and 'Totalt'",
    "metadata": {
      "fields": [
        "7579fd4a-b5c6-4b92-a98c-9a4181d10e84",
        "b9cc9245-f52a-4a4c-84e3-f3081b56d209",
        "223c2303-85de-4c93-9707-d0d6d60b7f2e"
      ]
    }
  },
  {
    "type": "INVALID_VALUE_COMBINATION",
    "message": "Invalid combination of values for fields 'Moms' and 'Totalt'",
    "metadata": {
      "fields": [
        "7579fd4a-b5c6-4b92-a98c-9a4181d10e84",
        "b9cc9245-f52a-4a4c-84e3-f3081b56d209",
        "223c2303-85de-4c93-9707-d0d6d60b7f2e"
      ]
    }
  }
]