workflow = &$wf; $this->process=$wf->getProcess($processId); } public function run() { $ret = $this->process($this->workflow->pid, $this->process['params']); $state = ($ret === FALSE) ? 'error' : 'completed'; $this->workflow->recordAttempt($this->process['id'], $state, $this->message); return $ret; } protected function setMessage($msg) { $this->message = $msg; } abstract protected function process($pid, $parameters); }