Script validators API
Sample validator code
function callService(context) {
let input1 = context.getFirstParameter("input1");
if (input1 === "api") {
return [{
'key': 'pl.error',
'parameters': [input1, "parameter {0} is incorrect"]
}
];
} else if (input1 != null && input1 !== "") {
return [{
'key': 'pl.error',
'parameters': [input1, "another hardcoded parameter"]
}];
} else {
return [];
}
}Input to the script validator
Validator output
Logging
Throwing business exceptions
Last updated
Was this helpful?
