Just like 3.4 Functions, OSWorkflow allows for validators in three different forms: Java-based, BeanShell, and BSF. Java-based validators must implement the com.opensymphony.workflow.Validator interface (or in the case of remote-ejb's, the com.opensymphony.workflow.ValidatorRemote interface). With Java-based validators, throwing an InvalidInputException is all that is needed to mark an input as invalid and stop the workflow action from occuring. But in BeanShell and BSF, things are a little different, since exceptions thrown in the scripts can't propogate out to the Java runtime environment. To get around this, any value returned in a BeanShell or BSF script will be used as the error message(s). The logic is as follows:
|