You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
712 B
32 lines
712 B
14 years ago
|
<?php
|
||
|
|
||
|
// $Id$
|
||
|
|
||
|
module_load_include('inc', 'islandora_workflow_client', 'workflow');
|
||
|
|
||
|
abstract class Process {
|
||
|
|
||
|
private $workflow;
|
||
|
private $process;
|
||
|
private $message = NULL;
|
||
|
|
||
|
function __construct(&$wf, $processId) {
|
||
|
$this->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);
|
||
|
}
|