PEL: Add CalloutsWhenNoADMatch msg reg support

There is a new use case where we need to do one callout in the message
registry based on the value of an AdditionalData field value, and
another callout in all other cases.

To support this, this commit is adding a new 'CalloutsWhenNoADMatch'
field in the PEL message registry that allows one to add callouts when
there is no match on the 'ADValue' field.  This behaves like an 'else'
leg to the 'if AdValue == X' structure in the message registry.

Example:
{
    "ADName": "PROC_NUM",
    "CalloutsWithTheirADValues":
    [
        {
            "ADValue": "0",
            "Callouts":
            [
                // callouts when PROC_NUM == 0
            ]
        },
        {
            "ADValue": "1",
            "Callouts":
            [
                // callouts when PROC_NUM == 1
            ]
        }
    ],
    "CalloutsWhenNoADMatch": [
        {
            // callouts when PROC_NUM != 0 or 1
        }
    ]
}

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: Ib8e208ff950a643302e856c7dd2b7474fec61b26
diff --git a/extensions/openpower-pels/registry.cpp b/extensions/openpower-pels/registry.cpp
index a37bb6e..578a67e 100644
--- a/extensions/openpower-pels/registry.cpp
+++ b/extensions/openpower-pels/registry.cpp
@@ -562,7 +562,14 @@
     if (it == callouts.end())
     {
         // This can happen if not all possible values were in the
-        // message registry and that's fine.
+        // message registry and that's fine.  There may be a
+        // "CalloutsWhenNoADMatch" section that contains callouts
+        // to use in this case.
+        if (json.contains("CalloutsWhenNoADMatch"))
+        {
+            return getCalloutsWithoutAD(json["CalloutsWhenNoADMatch"],
+                                        systemNames);
+        }
         return std::vector<RegistryCallout>{};
     }
 
diff --git a/extensions/openpower-pels/registry/README.md b/extensions/openpower-pels/registry/README.md
index 3e55b43..6a4be33 100644
--- a/extensions/openpower-pels/registry/README.md
+++ b/extensions/openpower-pels/registry/README.md
@@ -365,6 +365,47 @@
 used as in the previous example, so these callouts can also depend on the
 system type.
 
+If it's desired to use a different set of callouts when there isn't a match
+on the AdditionalData field, one can use CalloutsWhenNoADMatch.  In the
+following example, the 'air_mover' callout will be added if 'PROC_NUM' isn't
+0.  'CalloutsWhenNoADMatch' has the same schema as the 'Callouts' section.
+
+```
+"CalloutsUsingAD":
+{
+    "ADName": "PROC_NUM",
+    "CalloutsWithTheirADValues":
+    [
+        {
+            "ADValue": "0",
+            "Callouts":
+            [
+                {
+                    "CalloutList":
+                    [
+                        {
+                            "Priority": "high",
+                            "LocCode": "P1-C5"
+                        }
+                    ]
+                }
+            ]
+        },
+    ],
+    "CalloutsWhenNoADMatch": [
+        {
+            "CalloutList": [
+                {
+                    "Priority": "high",
+                    "SymbolicFRU": "air_mover"
+                }
+            ]
+        }
+    ]
+}
+
+```
+
 #### CalloutType
 This field can be used to modify the failing component type field in the
 callout when the default doesn\'t fit:
diff --git a/extensions/openpower-pels/registry/schema/schema.json b/extensions/openpower-pels/registry/schema/schema.json
index 1c405bf..a866ed3 100644
--- a/extensions/openpower-pels/registry/schema/schema.json
+++ b/extensions/openpower-pels/registry/schema/schema.json
@@ -658,14 +658,16 @@
 
         "calloutsUsingAD":
         {
-            "description": "This contains the callouts that can be specified based on a value in the AdditionalData property..",
+            "description": "This contains the callouts that can be specified based on a value in the AdditionalData property.",
             "type": "object",
 
             "properties":
             {
                 "ADName": {"$ref": "#/definitions/adName" },
                 "CalloutsWithTheirADValues":
-                    {"$ref": "#/definitions/calloutsWithTheirADValues" }
+                    {"$ref": "#/definitions/calloutsWithTheirADValues" },
+                "CalloutsWhenNoADMatch":
+                    {"$ref": "#/definitions/calloutsWhenNoADMatch" }
             },
             "additionalProperties": false,
             "required": ["ADName", "CalloutsWithTheirADValues"],
@@ -697,6 +699,12 @@
                     ]
                 }
             ]
+        },
+
+        "calloutsWhenNoADMatch":
+        {
+            "description": "This contains the callouts to use when a match in the 'CalloutsWithTheirADValues array isn't found.",
+            "$ref": "#/definitions/callouts"
         }
     }
 }