Updates the state of the job item.
string $state: The new state of the job item. Has to be one of the job state constants.
string $message: (Optional) The log message to be saved along with the state change.
array $variables: (Optional) An array of variables to replace in the message on display.
string $type: (optional) Statically set to status.
int The updated state of the job item if it could be set.
Job::addMessage()
public function setState($state, $message = NULL, $variables = array(), $type = 'debug');