This validator should be used to validate the 'status' attribute for an active record object before it is saved. It tests if the transition that is about to occur is valid.
Moreover, if $enableSwValidation is set to true, this validator applies all validators that may have been defined by the model for the scenario associated to the transition being done.
Scenario names associated with a transition, have the following format :
sw:[currentStatus]-[nextStatus]
For instance, if the model being validated is currently in status 'A' and it is sent in status 'B', the corresponding scenario name is 'sw:A-B'. Note that if the destination status doesn't belong to the same workflow as the current status, [nextStatus] must be in the form 'workflowId/statusId' (e.g 'sw:A-workflow/B'). Eventually, when the model enters in a workflow, the scenario name is '-[nextStatus]' where 'nextStatus' includes the workflow Id (e.g 'sw:-workflowIs/statusId').
If this validator is initialized with parameter match set to TRUE, then transitions scenario defined for validators are assumed to be regular expressions. If the current transition matches, then the associated validator is executed.
For instance, if validator 'required' for attribute A applies to scenarion 'sw:/S1_.?/' then each time the model leaves status S1, then the required validator will be applied.