With "/execute if function" being recently added, I think it would be nice to have a new predicate type that checks a function in the same way. Given the versatility of predicates being JSON objects, these predicates could have use cases even beyond a simple "/execute if function" call. Some examples:
{ //This is the same as "execute if function".
"condition": "function_return",
"function": "example:run_test"
}
{ //Test for other returned values besides zero and 1
"condition": "function_return",
"function": "example:run_test",
"success_value": 5
}
Success Value could also be a range of values (between "min" and "max"), or even a list of acceptable values, like the following:
"success_value": [1,4,9,16]
Please sign in to leave a comment.
0 Comments