Skip to main content

checkAttributes

A Workflow Engine function that checks the existence of attributes and optionally validates their values (regex, equality, similarity), with the function to set a default value. This action depends on the addition of an "Attribute Checker" configuration in the "Additional Configurations" integration.

This function is available as a feature of the Add-ons v2.7 download and later.

This function is available for event, alert, and Situation workflows.

Back to Workflow Engine Functions Reference.

Arguments

Workflow Engine function checkAttributes takes the following arguments:

Name

Required

Type

Description

groupNames

yes

object

A list ([...]) of attribute group names to evaluate, as configured in the “Additional Configuration” section of the integration tile.

Example

The following example demonstrates typical use of Workflow Engine function checkAttributes.

The event workflow includes an action named checkAttributes, where the groupName parameter is set to ['TEST'].

Scenario: No Attribute Checker Group named "TEST" is defined in the Additional Configuration integration tile.

Outcome: The action returns false, and the event remains unchanged.

An Attribute Checker Group named "TEST" is defined in the Additional Configuration integration tile with the following settings:

[
  {
    "regex": "",
    "defaultValue": "",
    "attributeName": "custom_info.test.field_exists"
  },
  {
    "regex": "",
    "defaultValue": "UNKNOWN",
    "attributeName": "custom_info.test.field_has_default"
  },
  {
    "regex": "RIGHT VALUE",
    "defaultValue": "",
    "attributeName": "custom_info.test.field_has_value"
  }
]

Scenario: The event does not contain the field custom_info.test.field_exists.

Outcome: The action returns false, and the event remains unchanged.

Scenario: The event contains:

{
	...
	"custom_info": {
		"test": {
			"field_exists": "a value",
			"field_has_value": "WRONG VALUE"
		}
	}
	...
}

Outcome: The action returns false, and the event remains unchanged.

Scenario: The event contains:

{
	...
	"custom_info": {
		"test": {
			"field_exists": "a value",
			"field_has_value": "RIGHT VALUE"
		}
	}
	...
}

Outcome: The action returns true, and the event is updated to include the default value for custom_info.test.field_has_default:

{
	...
	"custom_info": {
		"test": {
			"field_exists": "a value",
			"field_has_default": "UNKNOWN",
			"field_has_value": "RIGHT VALUE"
		}
	}
	...
}