IBM Cloudability

 View Only

 Question about Business Mapping Expression Language

Jump to  Best Answer
  • Cloudability
Pierre Toulouse's profile image
Pierre Toulouse posted 09/02/21 10:16 AM
I am trying to create a Business Dimension for tag compliance from the API. Do I have to validate the existence of the tag first and then its compliance, or the various operators will return false if the tag does not exist?

Basically, should I do this:

{
    "defaultValue": "Compliant",
    "statement": [
        {
            "matchExpression": "!(TAG['Tag1'] IN ('value1', 'value2'))",
            "valueExpression": "Non-compliant"
        },
        {
            "matchExpression": "!(TAG['Tag2'] FIND /^c[a-z][0-9]{6}$/)",
            "valueExpression": "Non-compliant"
        }
    ]
}

Or that:

{
    "defaultValue": "Compliant",
    "statement": [
        {
            "matchExpression": "!EXIST TAG['Tag1']",
            "valueExpression": "Non-compliant"
        },
        {
            "matchExpression": "!(TAG['Tag1'] IN ('value1', 'value2'))",
            "valueExpression": "Non-compliant"
        },
        {
            "matchExpression": "!EXIST TAG['Tag2']",
            "valueExpression": "Non-compliant"
        },
        {
            "matchExpression": "!(TAG['Tag2'] FIND /^c[a-z][0-9]{6}$/)",
            "valueExpression": "Non-compliant"
        }
    ]
}
#Cloudability
Renee Daignault's profile image
Renee Daignault  Best Answer
Hello Pierre  - I have received some guidance on your question. Please see below. 

Because your default value is compliant, if the tag does not exist, then it will default to compliant. I would check the if the tag exists OR change your BM logic around. Pretty much changing default value to non-compliant then having rules to make sure a tag is compliant or not.

Hope this helps!
#Cloudability
Renee Daignault's profile image
Renee Daignault
Hello Pierre - I am looking into this and I will let you know when I have an answer.
#Cloudability