Handling PropertyNotFoundException while evaluating script with ScriptEvaluationException

You could check if the property / variable exists in the execution scope before passing it to the service task using:

execution.hasVariable("xyz");

which returns true in case that the variable exists.

see also: