EntityValidateRelations
Alias:EntityValidateRelations
, ValidateRelations
Output:Array<T>
For each entity in the stream, check that the value of the ParentIdProperty
is the value of the IdProperty
for at least one entity in the stream.
Parameter | Type | Required | Position | Default Value | Summary |
---|---|---|---|---|---|
EntityStream | array<entity> | ✔ | 1 | The stream of entities to validate | |
IdProperty ExistsIn | string | ✔ | 2 | The entity property which will be used to create a lookup table. | |
ParentIdProperty LookupThat | string | ✔ | 3 | The step will check that the value of this entity property exists in the lookup table. | |
ErrorBehavior | ErrorBehavior | 4 | Error | How to behave if an error occurs. | |
IgnoreEmpty | bool | 5 | true | If true, empty values will be ignored |
Examples​
Example 1​
SCL​
EntityValidateRelations [('id': 1), ('id': 2 'parentid': 1), ('parentid': 1), ('id': 3 'parentid': 100), ('id': 4 'parentid': "")] 'id' 'parentid' 'Error'
Expected Logs​
The id '100' does not exist.
Expected Output​
[('id': 1), ('id': 2 'parentid': 1), ('parentid': 1), ('id': 4 'parentid': "")]
Example 2​
SCL​
EntityValidateRelations [('id': 1), ('id': 2 'parentid': 1), ('parentid': 1), ('id': 3 'parentid': 100), ('id': 4 'parentid': "")] 'id' 'parentid' 'Warning'
Expected Logs​
The id '100' does not exist.
Expected Output​
[('id': 1), ('id': 2 'parentid': 1), ('parentid': 1), ('id': 3 'parentid': 100), ('id': 4 'parentid': "")]
Example 3​
SCL​
EntityValidateRelations [('id': 1), ('id': 2 'parentid': 1), ('parentid': 1), ('id': 3 'parentid': 100), ('id': 4 'parentid': "")] 'id' 'parentid' 'Skip'
Expected Output​
[('id': 1), ('id': 2 'parentid': 1), ('parentid': 1), ('id': 4 'parentid': "")]
Example 4​
SCL​
EntityValidateRelations [('id': 1), ('id': 2 'parentid': 1), ('parentid': 1), ('id': 3 'parentid': 100), ('id': 4 'parentid': "")] 'id' 'parentid' 'Ignore'
Expected Output​
[('id': 1), ('id': 2 'parentid': 1), ('parentid': 1), ('id': 3 'parentid': 100), ('id': 4 'parentid': "")]