Control typology rule does not have access to the application object
Hi,
I'm trying to use a control typology rule to dynamically set some SMTP headers of the delivery. One of the things I need to do is check the name of an enumeration based on the value configured in the delivery.
In a test workflow, I was able to get the name using the application get schema method and find the desired enumeration: application.getSchema("nms:recipient")
However, when I try to apply the same code in my typology rule it just doesnt find the schema, I suspect that the application object is not available. According to the documentation it should be:

The complete code is:
function findBounceAddress(vendor){
var schema = application.getSchema("nms:recipient");
var enum = schema.enumerations.filter(findEnum("nms:recipient:vendor"));
return findNameFromValue(enum[0].values, vendor);
}
function findEnum(name){
return function(enumerations){
return enumerations.name.trim() == name;
}
}
function findNameFromValue(values, searchValue){
var result = "";
Object.keys(values).forEach(function(key,index) {
if(values[key].value == searchValue){
result = key;
}
});
return result;
}