Steps and allowed operators
  • 22 Mar 2024
  • 2 Minutes to read
  • Contributors
  • Dark
    Light
  • PDF

Steps and allowed operators

  • Dark
    Light
  • PDF

Article summary

On the attestation rules there are different operations available.

Screenshot 2024-03-22 at 14.21.13.png

Figure 1 - attestation rule

You can compare strings, numbers, variable and booleans.

Operations with same type

The only attention point is to compare the same types, the enclave cannot compare numbers with strings.

Here are some operations that can be completed:

OperatorsAllowed operandsNote
==, !={N:N} {T:T} {A:A} {B:B}Same datatype only
Contains, does not contain{A:N} {A:T} {A:B}Array and element
is in, is not in{N:A} {T:A} {B:A}Element and array
<, >, <=, >={N:N}Numerical operator

Compare Arrays

To compare arrays it is possible to use the following 4 Rule's operators:

  • Contains
  • Not contains
  • In
  • Not in

With the first two, the array is the source

Screenshot 2024-03-22 at 15.33.12.png

with the second two the array is the Target:

Screenshot 2024-03-22 at 15.35.39.png

Logical Operators

In Silent Data [Oracle] the logical operators can be used on the UI to complete the following examples.
With the buttons AND and OR you can use the different logical operators. with the GROUP button, you can create nested logical operations. To remove a nested operation use the DELETE button.

Example number 1: A>0 && B>0 && (C>0 || D>0)

Screenshot 2024-03-22 at 15.09.56.png

By saving your Job you can see the JSON format of your Job Configuration

//ATTESTATION with logical operators - A>0 && B>0 && (C>0 || D>0)
{
            "type": "ATTESTATION",
            "rules": {
                "type": "AND",
                "conditions": [
                    {
                        "source": "${STEPS[1].data.variableA}",
                        "operator": ">",
                        "target": 0
                    },
                    {
                        "source": "${STEPS[1].data.variableB}",
                        "operator": ">",
                        "target": 0
                    },
                    {
                        "type": "OR",
                        "conditions": [
                            {
                                "source": "${STEPS[1].data.variableC}",
                                "operator": ">",
                                "target": 0
                            },
                            {
                                "source": "${STEPS[1].data.variableD}",
                                "operator": ">",
                                "target": 0
                            }
                        ]
                    }
                ]
            }
        }

Example number 2: (A>0 || B>0) && (C>0 || D>0)

Screenshot 2024-03-22 at 15.17.47.png

By saving your Job you can see the JSON format of your Job Configuration

//ATTESTATION with logical operators - (A>0 || B>0) && (C>0 || D>0)
 {
            "type": "ATTESTATION",
            "rules": {
                "type": "AND",
                "conditions": [
                    {
                        "type": "OR",
                        "conditions": [
                            {
                                "source": "${STEPS[1].data.variableA}",
                                "operator": ">",
                                "target": 0
                            },
                            {
                                "source": "${STEPS[1].data.variableB}",
                                "operator": ">",
                                "target": 0
                            }
                        ]
                    },
                    {
                        "type": "OR",
                        "conditions": [
                            {
                                "source": "${STEPS[1].data.variableC}",
                                "operator": ">",
                                "target": 0
                            },
                            {
                                "source": "${STEPS[1].data.variableD}",
                                "operator": ">",
                                "target": 0
                            }
                        ]
                    }
                ]
            }
        }

Example number 3: (A>0 || B>0) && (C>0 && (D>0||E>0))

Screenshot 2024-03-22 at 15.22.23.png

As you can see here, this is the last level of nesting allowed for your job configuration, at the level of variables D and E it is not possible to group further.

By saving your Job you can see the JSON format of your Job Configuration

//ATTESTATION with logical operators - (A>0 || B>0) && (C>0 && (D>0||E>0))
{
            "type": "ATTESTATION",
            "rules": {
                "type": "AND",
                "conditions": [
                    {
                        "type": "OR",
                        "conditions": [
                            {
                                "source": "${STEPS[1].data.variableA}",
                                "operator": ">",
                                "target": 0
                            },
                            {
                                "source": "${STEPS[1].data.variableB}",
                                "operator": ">",
                                "target": 0
                            }
                        ]
                    },
                    {
                        "type": "AND",
                        "conditions": [
                            {
                                "source": "${STEPS[1].data.variableC}",
                                "operator": ">",
                                "target": 0
                            },
                            {
                                "type": "OR",
                                "conditions": [
                                    {
                                        "source": "${STEPS[1].data.variableD}",
                                        "operator": ">",
                                        "target": 0
                                    },
                                    {
                                        "source": "${STEPS[1].data.variableE}",
                                        "operator": ">",
                                        "target": 0
                                    }
                                ]
                            }
                        ]
                    }
                ]
            }
        }


Was this article helpful?