Validations

Configure data validation rules for entities.

Overview

You can create validations for your data, which will allow for any set of source data to undergo simple validation or combination checking. Such user-defined validations are general, i.e. they refer to all Fynapse modules. You can define validations for Defined Entities and Protected Entities.

The subject of a validation can be:

  • data within the given Entity
  • data appended to the Entity by references in the process of enrichment

This means you can create validations verifying the reference criteria established for an Entity. Such validation references are sets of rules that determine which data from which Entity is used to enrich the base Entity is validated within a validation. This will create more complex validation rules for your data.

As a result, you can validate whether the relations you created within your data structure meets the defined criteria.

The aim of validations is to pre-empt failures that could occur later within the system, e.g.:

  • catch the data validation errors or combination failures on the input source record
  • re-check against the current set of rules when feeding external systems

Types of validations

Simple

Simple validations are typically applied to verify inbound data. They allow you to verify if the attribute value entered in or imported to various modules of Fynapse is valid. Values are valid according to business requirements for Aptitude and downstream system processing.

Conditional

Conditional validations allow you to verify if the data in a given field is valid in combination with data in other fields. An example of this would be to check that a specific Cost Center/Entity combination is valid for a specific Business Event. These types of validations are used to verify combinations of values after Fynapse has changed a value, for example a GL Account was derived or a legal entity was changed in an intercompany process.

Validation Syntax

Validations are defined in the Configuration Data JSON file. The input definition has to be built in accordance with the structure provided below.

Sample Structure of an Entity with a Reference and a Validation

This is a sample structure of an Entity, Legal Entity, with a defined reference to an Organization Unit Entity and a defined mandatory type validation checking this reference:

1"entities": [
2 {
3 "namespace": "fynapse",
4 "entity": {
5 "name": "legalEntity",
6 "temporalityType": "Reference",
7 "description": "Legal Entity",
8 "type": "DefinedEntity",
9 "primaryKeyAttributeNames": [
10 "company"
11 ],
12 "attributes": [
13 {
14 "type": {
15 "typeName": "PrimitiveType",
16 "primitive": "TEXT"
17 },
18 "name": "company",
19 "label": "Company",
20 "mandatory": false
21 },
22 {
23 "type": {
24 "typeName": "PrimitiveType",
25 "primitive": "TEXT"
26 },
27 "name": "costCentre",
28 "label": "Cost Centre",
29 "mandatory": false
30 },
31 {
32 "type": {
33 "typeName": "PrimitiveType",
34 "primitive": "TEXT"
35 },
36 "name": "transactionCurrency",
37 "label": "Transaction Currency",
38 "mandatory": false
39 },
40 {
41 "type": {
42 "typeName": "PrimitiveType",
43 "primitive": "TEXT"
44 },
45 "name": "product",
46 "label": "Product",
47 "mandatory": false
48 },
49 {
50 "type": {
51 "typeName": "PrimitiveType",
52 "primitive": "TEXT"
53 },
54 "name": "partyIdentifier",
55 "label": "Party Identifier",
56 "mandatory": false
57 },
58 {
59 "type": {
60 "typeName": "PrimitiveType",
61 "primitive": "TEXT"
62 },
63 "name": "sourceSystem",
64 "label": "Source System",
65 "mandatory": false
66 }
67 ],
68 "databaseConfiguration": [
69 {
70 "databaseProfile": "fds"
71 }
72 ],
73 "references": [
74 {
75 "name": "vendor",
76 "label": "Vendor",
77 "entity": "organisationUnit",
78 "namespace": "fynapse",
79
80 "definition": [
81 {
82 "typeName": "Attribute",
83 "referencedAttribute": "organisationUnitIdentifier",
84 "attributeName": "company"
85 },
86 {
87 "typeName": "Const",
88 "referencedAttribute": "organisationUnitIdentifierType",
89 "value": "Cost Centre"
90 }
91 ]
92 }
93 ],
94 "validations": [
95 {
96 "name": "Mandatory Vendor",
97 "type": "MANDATORY",
98 "attributeName": "vendor.organisationUnitIdentifier"
99 }
100 ]
101 }
102 }
103]

Simple Validations

All types of simple validations have the following common properties:

1"validations": [
2 {
3 "name": "Unique name of the validation rule",
4 "type": "typeOfTheValidation",
5 "attributeName": "nameOfTheAttributeOrReferenceThatCannotBeEmpty"
6 }
7]

where:

  • name - the unique name of the validation
  • type - defines the type of the validation; there are three types:
    • MANDATORY - the attribute or reference for which this validation was defined cannot be empty
    • ENUM - the attribute or reference for which this validation was defined has to have a value from the list provided in the ‘values’ property
    • LOOKUP - a check is made if the referenced Entity exists
  • attributeName - name of the attribute or reference that is the subject of the validation
    • for attributes - nameOfTheAttribute
    • for references - referenceName.nameOfTheReference

Mandatory validations have simple structure:

1"validations": [
2 {
3 "name": "Unique name of the validation rule",
4 "type": "typeOfTheValidation",
5 "attributeName": "nameOfTheAttributeThatCannotBeEmpty"
6 }
7]

Mandatory validation for an attribute of a referenced Entity:

1"validations": [
2 {
3 "name": "Unique name of the validation rule",
4 "type": "typeOfTheValidation",
5 "attributeName": "referenceName.nameOfTheReferenceThatCannotBeEmpty"
6 }
7]

Enum validations have an additional ‘values’ property which lists the allowed values:

1"validations": [
2 {
3 "name": "Unique name of the validation rule",
4 "type": "typeOfTheValidation",
5 "attributeName": "nameOfTheAttributeThatCannotBeEmpty",
6 "values": ["userDefinedListOfAllowedValues"]
7 }
8]

where:

  • values - list of allowed values, which you have to define

Enum validation for checking the values of an attribute in a referenced Entity:

1"validations": [
2 {
3 "name": "Unique name of the validation rule",
4 "type": "typeOfTheValidation",
5 "attributeName": "referenceName.nameOfTheAttributeInReferencedEntity",
6 "values": ["userDefinedListOfAllowedValues"]
7 }
8]

where:

  • referenceName.nameOfTheAttributeInReferencedEntity
    • referenceName - name of the reference which is the subject of the validation
    • nameOfTheAttributeInReferencedEntity - name of the attribute in the referenced Entity

Lookup type validations have a slightly different syntax to other simple validations.

There are two types of lookup validations:

  1. Mapping an attribute from Business Event to an attribute from Organization Unit Entity:
1 "validations": [
2 {
3 "name": "Validation for Business Event",
4 "type": "LOOKUP",
5 "entity":"OrganizationUnit",
6 "namespace: "fynapse",
7 "reference":[{
8 "type":"Attribute",
9 "attributeName":"partyFromBusinessEvent",
10 "referencedAttribute": "partyFromCostCenter"
11 }
12 ]
13 }
14]

where:

  • name - the unique name of the validation
  • type - the type of validation, here: LOOKUP
  • entity - Entity we are referring to
  • namespace - Entities are grouped into logical sets called namespaces. This ensures easy identification, as Entities within each namespace have to have unique names.
    Currently, the value for this property should be defined as ‘fynapse’.
  • reference - definition of the conditions for reference
    • type
      • Attribute - an attribute from Business Event to an attribute from Entity Organization Unit
    • attributeName - name of the attribute from referring Business Event
    • referencedAttribute - name of the attribute from referred Entity Organization Unit

2. Mapping an attribute from Business Event to a value of an attribute from Organization Unit Entity:

1 "validations": [
2 {
3 "name": "Validation for Business Event",
4 "type": "LOOKUP",
5 "entity":"OrganizationUnit",
6 "namespace: "fynapse",
7 "reference":[{
8 "type":"Const",
9 "value":"Valid Combo",
10 "referencedAttribute": "validCommentFromCostCenter"
11 }
12 ]
13 }
14]

where:

  • name - the unique name of the validation
  • type - the type of validation, here: LOOKUP
  • entity - the Entity we are referring to
  • namespace - Entities are grouped into logical sets called namespaces. This ensures easy identification, as Entities within each namespace have to have unique names.
    Currently, the value for this property should be defined as ‘fynapse’.
  • reference - definition of the conditions for reference
    • type
      • Const - mapping from Entity A to a determined value of an attribute in FDS Entity Organization Unit
    • value - allowed value of the referenced attribute
    • referencedAttribute - referenced attribute from referred FDS Entity Organization Unit

Lookup validation for an Entity with a defined reference and with validation from this referred Entity to a different Entity

In this example, the basic Entity is a Business Event. This Business Event Entity has a defined reference to the Organization Unit Entity. You can create a validation from this referred Organization Unit Entity to another Entity, e.g. Account, which is not directly referred to in the Business Event.

1 "validations": [
2 {
3 "name": "Validation for Business Event",
4 "type": "LOOKUP",
5 "entity":"Account",
6 "namespace: "fynapse",
7 "reference":[{
8 "type":"Attribute",
9 "attributeName":"organizationUnit.organisationUnitIdentifier",
10 "referencedAttribute": "accountForOrganizationIdentifier"
11 }
12 ]
13 }
14]

Conditional Validations

Conditional validations are created by adding the ‘when’ clause to a simple validation. The initial parameters are the same as for simple validations.

If you do not add the ‘when’ clause, the system will trigger the validation as a simple validation.

1"validations": [
2 {
3 "name": "Unique name of the validation rule",
4 "type": "typeOfTheValidation",
5 "attributeName": "nameOfTheAttributeOrReferenceThatCannotBeEmpty",
6 "values": ["userDefinedValues"],
7
8 "when": {
9 "logicalOperator": "determinesTheTypeOfConditionalValidation",
10
11 "operands": [
12 {
13 "condition": "determinesTheTypeOfCondition",
14 "attributeName": "referenceName.nameOfTheAttributeThatIsBeingVerifiedByValidation",
15 "values": ["userDefinedListOfAllowedValues"]
16 }
17 ]
18 }
19 }
20]

where:

  • when - opens the section which defines the conditions for when the validation will be applicable
  • logicalOperator - determines whether this is an “and“ or “or” combination validation, the allowed values are:
    • AND - all conditions have to be met
    • OR - at least one of the conditions has to be met
  • operands - the properties which constitute the definition of the condition
    • condition - trigger for validation
      • inList - list of allowed values that trigger the condition
      • notNull - cannot be empty
    • attributeName - is the value of this attribute in the allowed values
    • values - allowed values

References

You can create more complex validations by defining references for your Entities.

1"references": [
2 {
3 "name": "legalEntity",
4 "label": "Legal Entity",
5 "entity": "organisationUnit",
6 "namespace": "fynapse",
7
8 "definition": [
9 {
10 "typeName": "Attribute",
11 "referencedAttribute": "organisationUnitIdentifier",
12 "attributeName": "company"
13 },
14 {
15 "typeName": "Const",
16 "referencedAttribute": "organisationUnitIdentifierType",
17 "value": "Cost Centre"
18 }
19 ]
20 }
21 ]

where:

  • name - name of the reference
  • label - label of the reference
  • entity - Entity being referenced
  • namespace - Entities are grouped into logical sets called namespaces. This ensures easy identification, as Entities within each namespace have to have unique names.
    Currently, the value for this property should be defined as ‘fynapse’.
  • definition - definition of the reference
    • typeName - type of the reference
      • Attribute - reference to an attribute from Legal Entity to an attribute from the Organization Unit Entity
      • Const - reference from Entity A to a determined value of an attribute in the Organization Unit Entity
    • referencedAttribute - the attribute from the referenced Entity
    • attributeName - the name of the attribute in the referring Entity for Attribute type references
    • value - the value of the attribute in the referenced Entity for Const type references
Primary Keys

When creating a reference you have to cover Primary Keys. A Primary Key is a unique attribute or set of attributes which identify an Entity in the system. What this means is, if you define a Primary Key consisting of one attribute then you have to create a reference to this attribute when referring to this Entity. You can create references to other attributes as well, but Primary Key attributes are mandatory for a reference. Let’s look at the example above. We are creating a reference to the Organization Unit Entity which has one Primary Key attribute - Organization Unit Identifier. Additionally, we are also creating a reference to the Organization Unit Identifier Type attribute, which is not part of the Primary Key, but we still want to reference it.

If you are defining a reference for the Business Event Entity, you can add an optional description:

1"references": [
2 {
3 "name": "legalEntity",
4 "label": "legal Entity",
5 "description": "Description of the reference"
6 "entity": "organisationUnit",
7 "namespace": "fynapse",
8
9 "definition": [
10 {
11 "typeName": "Attribute",
12 "referencedAttribute": "organisationUnitIdentifier",
13 "attributeName": "company"
14 },
15 {
16 "typeName": "Const",
17 "referencedAttribute": "organisationUnitIdentifierType",
18 "value": "Cost Centre"
19 }
20 ]
21 }
22 ]

Validation Errors

If a validation fails, one of the following errors will be thrown:

Validation TypeWhen OccursError MessageExample
configurationWhen a validation rule is incorrect.‘The “{name}” validation rule is incorrect.’‘The “Cost Centre & Product combination” validation rule is incorrect.’ ‘
mandatoryWhen a simple validation rule returns that the attribute is empty.‘The “{name}” validation rule failed. The “{path}” attribute or reference is empty.''The “Cost Centre not empty” validation rule failed. The “costCentre” attribute or reference is empty.‘
mandatoryWhen a conditional validation rule returns that the attribute is empty.‘The “{name}” validation rule failed. The “{path}” attribute or reference is empty.

The cause for conditional validation:

“{n}”’

where {n} - when clause
’The “Cost Centre not empty” validation rule failed. The “costCentre” attribute or reference is empty. 

Cause for conditional validation:

- The “Business Event Type” attribute has “Sales” value.
- And|or the “Important Value” attribute is null.‘
mandatory reference’The {name} validation rule failed. The reference {reference} was not found.''The “Mandatory intercompany reference” validation rule failed. The “Intercompany” reference was not found.‘
mandatory (attribute of a reference)When a reference is not resolved (e.g. defined for a referenced attribute and reference does not exist)‘The {name} validation rule failed. The “empty” value is not allowed for the {path} attribute. The reference {reference} could not be resolved.''The “Mandatory intercompany reference” validation rule failed. The “empty” value is not allowed for the “isExternal” attribute of the “Intercompany” reference.‘
mandatory (attribute of a reference) conditional validationWhen a reference is not resolved (e.g. defined for a referenced attribute and reference does not exist)‘The {name} validation rule failed. The “empty” value is not allowed for the {path} attribute. The reference {reference} could not be resolved.

Cause for conditional validation:

“{n}” ’ where {n} - when clause
’The “Mandatory intercompany reference” validation rule failed. The “empty” value is not allowed for the “isExternal” attribute of the “Intercompany” reference.

Cause for conditional validation:

- The “Business Event Type” attribute has “Sales” value.
- And|or the “Important Value” attribute is null.‘
enumWhen a provided value is not on the allowed list of values.‘The {name} validation rule failed. The “{path}” value is not allowed for the (path) attribute. The allowed values are: “{values}”.’The “Cost Centre allowed values” validation rule failed. The “200” value is not allowed for the “costCentre” attribute. The allowed values are: “210, 250, 300, 320, 500”.‘
enum (conditional validation)When a provided value is not on the allowed list of values.‘The {name} validation rule failed. The “{path}” value is not allowed for the {path}attribute. The allowed values are: “{values}”. Cause for conditional validation:

“{n}” ’ where {n} - when clause
’The “Business Event Type Cost Centre Entity matrix” validation rule failed. The “200” value is not allowed for the “costCentre” attribute. The allowed values are: “210, 250, 300, 320, 500”.

Cause for conditional validation:

- The “Business Event Type” attribute has “Sales” value.
- And|or the “Important Value” attribute is null.‘
enum for a referenceWhen a provided value is not on the allowed list of values.‘The {name} validation rule failed. The reference {reference} was not found. The allowed values are: “{values}”.''The “Mandatory legal Entity” validation rule failed. The reference “legalEntity” was not found. The allowed values are: “100”, “310”, “320”.‘
enum for a reference (conditional validation)When a provided value is not on the allowed list of values.‘The {name} validation rule failed. The reference {reference} was not found. The allowed values are: “{values}”. Cause for conditional validation:

“{n}” ’ where {n} - when clause
’The “Mandatory legal Entity” validation rule failed. The reference “legalEntity” was not found. The allowed values are: “100”, “310”, “320”. 

Cause for conditional validation:

…‘
lookupLookup cannot be resolved.‘The {name} validation rule failed. Lookup to the Entity {entityName} in the {namespace} namespace failed. The following data was not found:

- {attributeName} = {value}'
'The “Valid combination of Cost Centre and Account” rule failed. Lookup to Entity “ValidCombinations” in the “fynapse” namespace failed. The following data was not found:

- account = “41234111”
- costCentreCode = “210”
- combinationText = “Valid Combination“‘
lookup (conditional validation)Lookup cannot be resolved.‘The {name} validation rule failed. Lookup to the Entity {entityName} in the {namespace} namespace failed. The following data was not found:

-{attributeName} = {value}

Cause for conditional validation: “{n}” ’ where {n} - when clause
’The “Valid combination of Cost Centre and Account” rule failed. Lookup to Entity “ValidCombinations” in the “fynapse” namespace failed. The following data was not found:

- account = “41234111”
- costCentreCode = “210”
- combinationText = “Valid Combination”

Cause for conditional validation:

- The “Business Event Type” attribute has “Sales” value.
- And|or the “Important Value” attribute is null.‘

Examples

This section shows examples of simple and complex validations.

Examples of simple validations

In this example, we are going to define a validation that checks if the GL Account Attribute is provided.

The definition for such a validation would be:

1"validations": [
2 {
3 "name": "GL Account not empty",
4 "type": "MANDATORY",
5 "attributeName": "glAccount"
6 },
7 ]

With this validation, the system would behave as follows:

GIVEN the below validation was configured in Fynapse

Validation rule nameValidationValidation type
GL Account not emptyGL Account is mandatoryMandatory

AND a Business Event was ingested into Fynapse

WHEN Accounting Engine tries to assign ‘GL Account’ value to the imported Business Event

AND it was impossible to assign ‘GL Account’ value to this Business Event based on the rules set up in the Accounting Rules Navigator

AND no ‘GL Account’ value was assigned to the Business Event

THEN the Validation Service returns the following error:

The “GL Account not empty” validation rule failed. The “GL Account” attribute or reference is empty.’

AND the transaction isn’t posted

In this example, we are going to define a validation that checks if the provided values for GL Account are consistent with the user-defined list of allowed values.

The definition for such a validation would be:

1 "validations": [
2 {
3 "name": "GL Account allowed values",
4 "type": "ENUM",
5 "attributeName": "glAccount",
6 "values": [
7 "1000",
8 "2100",
9 "3200",
10 "4000",
11 "4800",
12 "5100"
13 ]
14 },
15 ]

With this validation, the system would behave as follows:

GIVEN the below validation was configured in Fynapse

Validation rule nameValidationValidation type
GL Account allowed valuesGL Account in (‘1000’, ‘2100’, ‘3200’, ‘4000’, ‘4800’)Enum

AND a Business Event was ingested into Fynapse

WHEN Accounting Engine assigns ‘GL Account’ value to the imported Business Event

AND a ‘GL Account’ value which was assigned to this Business Event based on the rules set up in Accounting Rules Navigator was ‘5000’

THEN Validation Service returns the following error:

‘The “GL Account allowed values” validation rule failed. The “5000” value is not allowed for the “GL Account” attribute. The allowed values are: “1000, 2100, 3200, 4000, 4800”.’

AND the transaction isn’t posted

In this example, we are going to define a validation that verifies the reference between the Currency Code attribute and Currency Identifier attribute.

The definition for such a validation would be:

1"validations": [
2 {
3 "name": "Currency code validation",
4 "type": "LOOKUP",
5 "entity":"currency",
6 "namespace": "fynapse",
7
8 "reference":[{
9 "type":"ATTRIBUTE",
10 "attributeName":"currencyCode",
11 "referenceAttributeName": "currencyIdentifier"
12 }]
13 },
14 ]

With this validation, the system would behave as follows:

GIVEN the below validation was configured in Fynapse

Validation rule nameValidation typeEntityNamespace
Currency code validationLookupCurrencyfynapse

with the following validation conditions

Referenced attribute

(primary key in ‘Currency code’ table)
Type

(Mapping Type)
Attribute name

(Business Event field name)
Currency IdentifierAttribute (Business Event field)currencyCode

AND a Business Event Definition looks like the following:

NoField LabelSystemic Field TypeField TypeField Name
1Event TypeEvent TypetexteventType
2Event SubtypetextsubEventType
3Event DatedateeventDate
4Cost CentreSubledger NodetextcostCentre
5Posting DatedatepostingDate
6Currency CodetextcurrencyCode
7Transaction AmountdecimaltransactionAmount
8Producttextproduct
9Party IdentifiertextpartyIdentifier

AND data which exists in the ‘Currency’ table is like below:

Currency IdentifierCurrency NameCurrent FlagDigits After PointInput byInput TimeMultiply or Divide FactorValid fromValid to
GBPPound SterlingY2SYSTEM01/03/2023M01/03/202331/12/2099
EUREuroY2SYSTEM01/03/2023M01/03/202331/12/2099
USDUS DollarY2SYSTEM01/03/2023M01/03/202331/12/2099
PLNPolish ZlotyY2SYSTEM01/03/2023M01/03/202331/12/2099
JPYJapanese YenY4SYSTEM01/03/2023M01/03/202331/12/2099

AND a Business Event was ingested into Fynapse

AND a currencyCode value in the imported Business Event was ‘CHF’

WHEN Validation Service validates this Business Event

THEN the following error is returned:

‘The “Currency code validation” rule failed. Lookup to Entity “Currency” in the “fynapse” namespace failed. The following data was not found:

  • currencyCode = “CHF”’

AND the transaction isn’t posted

In this example, we are going to define a validation that verifies if the mandatory Legal Entity attribute exists in the referenced Organization Unit.

The definition for such a validation would be:

1 "references": [
2 {
3 "name": "legalEntity",
4 "label": "legal Entity",
5 "entity": "organisationUnit",
6 "namespace": "fynapse",
7
8 "definition": [
9 {
10 "typeName": "Attribute",
11 "referencedAttribute": "organisationUnitIdentifier",
12 "attributeName": "company"
13 },
14 {
15 "typeName": "Const",
16 "referencedAttribute": "organisationUnitIdentifierType",
17 "value": "Cost Centre"
18 }
19 ]
20 }
21 ],
22 "validations": [
23 {
24 "name": "Mandatory Legal Entity",
25 "type": "MANDATORY",
26 "attributeName": "legalEntity.organisationUnitIdentifier"
27 }
28 ]

With this validation, the system would behave as follows:

GIVEN below Business Event reference was configured in Fynapse

Reference labelReference nameReference to
legal EntitylegalEntityOrganisation Unit

with below mandatory attributes (reference conditions)

Reference attributeMapping TypeBusiness Event field
Organisation Unit IdentifierBusiness Event fieldCost Centre
Reference attributeMapping TypeValue
Organisation Unit Identifier TypeFixedCost Centre

AND a Business Event Definition contains a ‘Cost Centre’ field

AND a Business Event Definition does NOT contain a ‘Legal Entity’ field

AND it looks like the following:

NoField LabelSystemic Field TypeField TypeField Name
1Event TypeEvent TypetexteventType
2Event SubtypetextsubEventType
3Event DatedateeventDate
4Cost CentreSubledger NodetextcostCentre
5Posting DatedatepostingDate
6Currency CodetextcurrencyCode
7Transaction AmountdecimaltransactionAmount
8Producttextproduct
9Party IdentifiertextpartyIdentifier

AND a following validation was configured in Fynapse

Validation rule nameValidationValidation type
Mandatory legal Entity referenceReference ‘legalEntity’ is mandatoryMandatory

AND the only rows in ‘Organisation Unit’ table are like the following:

Organisation Unit Identifier (PK)Organisation Unit Identifier Type (PK)Organisation Unit NameValid fromValid toInput byInput Time
100Cost CentreAS01/01/202131/12/2099Ewa Mackiewicz13/12/2020 11:52:49
200Profit CentreAS28/02/202231/12/2099Jeremy White13/02/2022 10:21:52
310Cost CentreAS12/03/202331/12/2099Kate Black01/03/2023 08:19:03
320Cost Centre5015/05/202031/12/2099Susanne Pink03/05/2020 15:16:18
570Profit Centre5017/08/201931/12/2099Jessica Butterfly30/07/2019 16:59:09

AND a Business Event was ingested into Fynapse

AND a Cost Centre value in the imported Business Event is ‘200’

WHEN Data Structure calls the Enrichment Service from Accounting Engine

AND a ‘legalEntity’ reference can’t be found (no row is found in the ‘Organisation Unit’ table for the imported Business Event with ‘200’ Cost Centre value)

THEN the Validation Service returns the following error:

‘The “Mandatory legal Entity” validation rule failed. The reference “legalEntity” was not found. The “empty” value is not allowed for the “Organisation Unit Identifier” attribute.’

AND the transaction isn’t posted

Examples of conditional validations

In this example, we are going to define a validation that checks if the Cost Centre Attribute is not empty for a GL Account Attribute with the value ‘4000’.

The definition for such a validation would be:

1"validations": [
2 {
3 "name": "Cost Centre not empty for GL Account 4000",
4 "type": "MANDATORY",
5 "attributeName": "costCentre",
6
7 "when": {
8 "logicalOperator": "AND",
9
10 "operands": [{
11 "condition": "inList",
12 "attributeName": "glAccount",
13 "values": [4000]
14 }]
15 }
16 },
17]

With this validation, the system would behave as follows:

GIVEN the below validation was configured in Fynapse

Validation rule nameValidationValidation type
Cost Centre not empty for GL Account 4000IF GL Account = ‘4000’ THEN Cost Centre is MandatoryMandatory

AND a Business Event was ingested into Fynapse

AND a ‘Cost Centre’ value is not provided in the imported Business Event

AND no Business Event references were defined in Fynapse

WHEN Accounting Engine processes this Business Event

AND a ‘GL Account’ value ‘4000’ was assigned to this Business Event

THEN Validation Service returns the following error:

‘The “Cost Centre not empty for GL Account 4000” validation rule failed. The “Cost Centre” attribute or reference is empty. 

Cause for conditional validation:

  • The “GL Account” attribute has a “4000” value.’

AND the transaction isn’t posted

In this example, we are going to define a validation that checks if the value in GL Account field is ‘5100’ and the value for Company field is ‘AS’.

IF GL Account = ‘5100’ THEN Company = ‘AS’

The definition for such a validation would be:

1 "validations": [
2 {
3 "name": "GL Account & Company matrix",
4 "type": "ENUM",
5 "attributeName": "company",
6 "values": ["AS"],
7
8 "when": {
9 "logicalOperator": "AND",
10
11 "operands": [
12 {
13 "condition": "inList",
14 "attributeName": "glAccount",
15 "values": [5100]
16 }
17 ]

With this validation, the system would behave as follows:

GIVEN below validation was configured in Fynapse

Validation rule nameValidationValidation type
GL Account & Company matrixIF GL Account = ‘5100’ THEN Company = ‘AS’Enum

AND a Business Event was ingested into Fynapse

AND a Company value provided in the imported Business Event is ‘50’

AND no Company override was configured on the Journal mapping screen

WHEN Accounting Engine processes this Business Event

AND a GL Account value ‘5100’ was assigned to this Business Event

THEN Validation Service returns the following error:

The “GL Account & Company matrix” validation rule failed. The “50” value is not allowed for the “Company” attribute. The allowed values are: “AS”.

Cause for conditional validation:

  • The “GL Account” attribute has “5100” value.

AND the transaction isn’t posted

In this example, we are going to define a validation that checks the company in the Organisation Unit Entity if the value in the Source System field = ‘BILLING1’.

The definition for such a validation would be:

1"validations": [
2 {
3 "name": "Company validation for BILLING1 sourceSystem",
4 "type": "LOOKUP",
5
6 "entity":"organisationUnit",
7 "namespace": "fynapse",
8
9 "reference":[
10 {
11 "type":"ATTRIBUTE",
12 "attributeName":"company",
13 "referenceAttributeName": "organisationUnitIdentifier"
14 },
15 {
16 "type":"CONST",
17 "value":"Legal Entity",
18 "referenceAttributeName": "organisationUnitIdentifierType"
19 }
20 ],
21
22 "when": {
23 "logicalOperator": "AND",
24
25 "operands": [
26 {
27 "condition": "inList",
28 "attributeName": "sourceSystem",
29 "values": ["BILLING1"]
30 }
31 ]
32 }
33 }
34 ]

With this validation, the system would behave as follows:

GIVEN the following validation was configured in Fynapse

Validation rule nameValidationValidation typeEntityNamespace
Company validation for BILLING1 sourceSystemIF Source System = ‘BILLING1’ THEN lookup company in an Organisation Unit EntityLookupOrganisation Unitfynapse

with the following validation conditions

Referenced attribute

(primary key in ‘Organisation Unit’ table)
Type

(Mapping Type)
Attribute name

(Business Event field name)
Organisation Unit IdentifierAttribute (Business Event field)company
Organisation Unit Identifier TypeFixedLegal Entity

AND a Business Event Definition contains ‘company’ and ‘sourceSystem’ fields

AND it looks like the following:

No.Field LabelSystemic Field TypeField TypeField Name
1Event TypeEvent TypetexteventType
2Event SubtypetextsubEventType
3Event DatedateeventDate
4CompanySubledger Nodetextcompany
5Cost CentreSubledger NodetextcostCentre
6Posting DatedatepostingDate
7Currency CodetextcurrencyCode
8Transaction AmountdecimaltransactionAmount
9Producttextproduct
10Party IdentifiertextpartyIdentifier
11Source SystemtextsourceSystem

AND data which exists in the ‘Organisation Unit’ table looks like below:

Organisation Unit Identifier (PK)Organisation Unit Identifier Type (PK)Organisation Unit NameValid fromValid toInput byInput Time
ASLegal EntityAS01/01/202131/12/2099Ewa Mackiewicz13/12/2020 11:52:49
50Legal Entity5028/02/202231/12/2099Jeremy White13/02/2022 10:21:52
24Legal Entity2412/03/202331/12/2099Kate Black01/03/2023 08:19:03
100Cost CentreAS15/05/202031/12/2099Susanne Pink03/05/2020 15:16:18
210Cost CentreAS17/08/201931/12/2099Jessica Butterfly30/07/2019 16:59:09

AND a Business Event was ingested into Fynapse

AND a ‘company’ value in the imported Business Event was ‘67’

AND a sourceSystem value was ‘BILLING1’

WHEN Validation Service validates this Business Event

THEN the following error is returned:

‘The “Company validation for BILLING1 sourceSystem” rule failed. Lookup to Entity “Organisation Unit” in the “fynapse” namespace failed. The following data was not found:

  • company = “67”

Cause for conditional validation:

  • The “sourceSystem” attribute has “BILLING1” value.’

AND the transaction is NOT posted