00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 include_once( 'lib/ezdb/classes/ezdb.php' );
00038 include_once( 'kernel/classes/ezpersistentobject.php' );
00039 include_once( 'kernel/classes/ezworkflowevent.php' );
00040
00041 class eZWorkflowProcess extends eZPersistentObject
00042 {
00043 function eZWorkflowProcess( $row )
00044 {
00045 $this->eZPersistentObject( $row );
00046 }
00047
00048 function definition()
00049 {
00050 return array( 'fields' => array( 'id' => array( 'name' => 'ID',
00051 'datatype' => 'integer',
00052 'default' => 0,
00053 'required' => true ),
00054 'process_key' => array( 'name' => 'ProcessKey',
00055 'datatype' => 'string',
00056 'default' => '',
00057 'required' => true ),
00058 'workflow_id' => array( 'name' => 'WorkflowID',
00059 'datatype' => 'integer',
00060 'default' => 0,
00061 'required' => true,
00062 'foreign_class' => 'eZWorkflow',
00063 'foreign_attribute' => 'id',
00064 'multiplicity' => '1..*' ),
00065 'user_id' => array( 'name' => 'UserID',
00066 'datatype' => 'integer',
00067 'default' => 0,
00068 'required' => true,
00069 'foreign_class' => 'eZUser',
00070 'foreign_attribute' => 'contentobject_id',
00071 'multiplicity' => '1..*' ),
00072 'content_id' => array( 'name' => 'ContentID',
00073 'datatype' => 'integer',
00074 'default' => 0,
00075 'required' => true ),
00076 'content_version' => array( 'name' => 'ContentVersion',
00077 'datatype' => 'integer',
00078 'default' => 0,
00079 'required' => true ),
00080 'session_key' => array( 'name' => 'SessionKey',
00081 'datatype' => 'string',
00082 'default' => '0',
00083 'required' => true ),
00084 'node_id' => array( 'name' => 'NodeID',
00085 'datatype' => 'integer',
00086 'default' => 0,
00087 'required' => true ),
00088 'event_id' => array( 'name' => 'EventID',
00089 'datatype' => 'integer',
00090 'default' => 0,
00091 'required' => true ),
00092 'event_position' => array( 'name' => 'EventPosition',
00093 'datatype' => 'integer',
00094 'default' => 0,
00095 'required' => true ),
00096 'event_state' => array( 'name' => 'EventState',
00097 'datatype' => 'integer',
00098 'default' => 0,
00099 'required' => true ),
00100 'last_event_id' => array( 'name' => 'LastEventID',
00101 'datatype' => 'integer',
00102 'default' => 0,
00103 'required' => true ),
00104 'last_event_position' => array( 'name' => 'LastEventPosition',
00105 'datatype' => 'integer',
00106 'default' => 0,
00107 'required' => true ),
00108 'last_event_status' => array( 'name' => 'LastEventStatus',
00109 'datatype' => 'integer',
00110 'default' => 0,
00111 'required' => true ),
00112 'event_status' => array( 'name' => 'EventStatus',
00113 'datatype' => 'integer',
00114 'default' => 0,
00115 'required' => true ),
00116 'created' => array( 'name' => 'Created',
00117 'datatype' => 'integer',
00118 'default' => 0,
00119 'required' => true ),
00120 'modified' => array( 'name' => 'Modified',
00121 'datatype' => 'integer',
00122 'default' => 0,
00123 'required' => true ),
00124 'activation_date' => array( 'name' => 'ActivationDate',
00125 'datatype' => 'integer',
00126 'default' => 0,
00127 'required' => true ),
00128 'status' => array( 'name' => 'Status',
00129 'datatype' => 'integer',
00130 'default' => 0,
00131 'required' => true ),
00132 'parameters' => array( 'name' => 'Parameters',
00133 'datatype' => 'text',
00134 'default' => '',
00135 'required' => true ),
00136 'memento_key' => array( 'name' => 'MementoKey',
00137 'datatype' => 'string',
00138 'default' => '',
00139 'required' => true ) ),
00140 'keys' => array( 'id' ),
00141 'function_attributes' => array( 'user' => 'user',
00142 'content' => 'content',
00143 'node' => 'node',
00144 'workflow' => 'workflow',
00145 'workflow_event' => 'workflowEvent',
00146 'last_workflow_event' => 'lastWorkflowEvent',
00147 'parameter_list' => 'parameterList' ),
00148 "increment_key" => "id",
00149 'class_name' => 'eZWorkflowProcess',
00150 'sort' => array( 'user_id' => 'asc' ),
00151 'name' => 'ezworkflow_process' );
00152 }
00153
00154 function &create( $processKey, $parameters )
00155
00156
00157 {
00158 $dateTime = time();
00159 if ( !isset( $parameters['user_id'] ) )
00160 $parameters['user_id'] = 0;
00161 $row = array( 'process_key' => $processKey,
00162 'workflow_id' => $parameters['workflow_id'],
00163 'user_id' => $parameters['user_id'],
00164 'content_id' => 0,
00165 'content_version' => 0,
00166 'node_id' => 0,
00167 'session_key' => 0,
00168 'event_id' => 0,
00169 'event_position' => 0,
00170 'last_event_id' => 0,
00171 'last_event_position' => 0,
00172 'last_event_status' => 0,
00173 'event_status' => 0,
00174 'created' => $dateTime,
00175 'modified' => $dateTime,
00176 'parameters' => serialize( $parameters ) );
00177 $newWorkflowProccess = new eZWorkflowProcess( $row );
00178 return $newWorkflowProccess;
00179 }
00180
00181 function reset()
00182 {
00183 $this->EventID = 0;
00184 $this->EventPosition = 0;
00185 $this->LastEventID = 0;
00186 $this->LastEventPosition = 0;
00187 $this->LastEventStatus = 0;
00188 $this->ActivationDate = 0;
00189 $this->EventStatus = 0;
00190 $this->EventState = 0;
00191 }
00192
00193 function advance( $next_event_id = 0, $next_event_pos = 0, $status = 0 )
00194 {
00195 $this->LastEventID = $this->EventID;
00196 $this->LastEventPosition = $this->EventPosition;
00197 $this->LastEventStatus = $status;
00198 $this->EventID = $next_event_id;
00199 $this->EventPosition = $next_event_pos;
00200 $this->ActivationDate = 0;
00201 }
00202
00203
00204 function run( &$workflow, &$workflowEvent, &$eventLog )
00205 {
00206 $eventLog = array();
00207 eZDebugSetting::writeDebug( 'workflow-process', $workflowEvent, "workflowEvent in process->run beginning" );
00208
00209 $runCurrentEvent = true;
00210 $done = false;
00211 $workflowStatus = $this->attribute( 'status' );
00212 eZDebugSetting::writeDebug( 'workflow-process', $workflowStatus , 'workflowStatus' );
00213 $currentEventStatus = $this->attribute( 'event_status' );
00214
00215
00216 if ( $workflowEvent == null )
00217 {
00218 $workflowEvent = eZWorkflowEvent::fetch( $this->attribute( 'event_id' ) );
00219 }
00220
00221 switch( $currentEventStatus )
00222 {
00223 case EZ_WORKFLOW_TYPE_STATUS_DEFERRED_TO_CRON:
00224 case EZ_WORKFLOW_TYPE_STATUS_DEFERRED_TO_CRON_REPEAT:
00225 case EZ_WORKFLOW_TYPE_STATUS_FETCH_TEMPLATE:
00226 case EZ_WORKFLOW_TYPE_STATUS_FETCH_TEMPLATE_REPEAT:
00227 case EZ_WORKFLOW_TYPE_STATUS_REDIRECT:
00228 case EZ_WORKFLOW_TYPE_STATUS_REDIRECT_REPEAT:
00229 case EZ_WORKFLOW_TYPE_STATUS_WORKFLOW_RESET:
00230 {
00231 if ( $workflowEvent !== null )
00232 {
00233 $activationDate = 0;
00234 if ( $this->hasAttribute( 'activation_date' ) )
00235 {
00236 $activationDate = $this->attribute( "activation_date" );
00237 }
00238 eZDebugSetting::writeDebug( 'workflow-process', "Checking activation date" );
00239 if ( $activationDate == 0 )
00240 {
00241 $eventType =& $workflowEvent->eventType();
00242 $eventLog[] = array( "status" => $currentEventStatus,
00243 "status_text" => eZWorkflowType::statusName( $currentEventStatus ),
00244 "information" => $eventType->attribute( "information" ),
00245 "description" => $workflowEvent->attribute( "description" ),
00246 "type_name" => $eventType->attribute( "name" ),
00247 "type_group" => $eventType->attribute( "group_name" ) );
00248 if ( $currentEventStatus == EZ_WORKFLOW_TYPE_STATUS_DEFERRED_TO_CRON ||
00249 $currentEventStatus == EZ_WORKFLOW_TYPE_STATUS_FETCH_TEMPLATE ||
00250 $currentEventStatus == EZ_WORKFLOW_TYPE_STATUS_REDIRECT )
00251 {
00252 $runCurrentEvent = false;
00253 }
00254 }
00255 else if ( time() < $activationDate )
00256 {
00257 eZDebugSetting::writeDebug( 'workflow-process', "Date failed, not running events" );
00258 $eventType =& $workflowEvent->eventType();
00259 $eventLog[] = array( "status" => $currentEventStatus,
00260 "status_text" => eZWorkflowType::statusName( $currentEventStatus ),
00261 "information" => $eventType->attribute( "information" ),
00262 "description" => $workflowEvent->attribute( "description" ),
00263 "type_name" => $eventType->attribute( "name" ),
00264 "type_group" => $eventType->attribute( "group_name" ) );
00265 $done = true;
00266 }
00267 else
00268 {
00269 eZDebugSetting::writeDebug( 'workflow-process', "Date ok, running events" );
00270 eZDebugSetting::writeDebug( 'workflow-process', $currentEventStatus, 'WORKFLOW_TYPE_STATUS' );
00271 if ( $currentEventStatus == EZ_WORKFLOW_TYPE_STATUS_DEFERRED_TO_CRON ||
00272 $currentEventStatus == EZ_WORKFLOW_TYPE_STATUS_FETCH_TEMPLATE ||
00273 $currentEventStatus == EZ_WORKFLOW_TYPE_STATUS_REDIRECT )
00274 {
00275 $runCurrentEvent = false;
00276 }
00277 }
00278 }
00279 } break;
00280 default:
00281 break;
00282 }
00283
00284 while ( !$done )
00285 {
00286 if ( $runCurrentEvent )
00287 {
00288 eZDebugSetting::writeDebug( 'workflow-process', "runCurrentEvent is true" );
00289 }
00290 else
00291 {
00292 eZDebugSetting::writeDebug( 'workflow-process', "runCurrentEvent is false" );
00293 }
00294 if ( $workflowEvent != null )
00295 {
00296
00297 }
00298 else
00299 {
00300
00301 }
00302 if ( get_class( $workflowEvent ) == "ezworkflowevent")
00303 {
00304 eZDebugSetting::writeDebug( 'workflow-process', get_class( $workflowEvent ) ,"workflowEvent class is ezworkflowevent " );
00305 }
00306 else
00307 {
00308 eZDebugSetting::writeDebug( 'workflow-process', get_class( $workflowEvent ) ,"workflowEvent class is not ezworkflowevent " );
00309 }
00310 eZDebugSetting::writeDebug( 'workflow-process', $done , "in while" );
00311 if ( $runCurrentEvent and
00312 $workflowEvent !== null and
00313 get_class( $workflowEvent ) == "ezworkflowevent" )
00314 {
00315 $eventType =& $workflowEvent->eventType();
00316
00317 if ( is_subclass_of( $eventType, "ezworkflowtype" ) )
00318 {
00319 $currentEventStatus = $eventType->execute( $this, $workflowEvent );
00320 $this->setAttribute( "event_status", $currentEventStatus );
00321
00322 $workflowParameters =& $this->attribute( 'parameter_list' );
00323
00324 if ( isset( $workflowParameters['cleanup_list'] ) )
00325 {
00326 $cleanupList =& $workflowParameters['cleanup_list'];
00327 }
00328 else
00329 {
00330 unset( $cleanupList );
00331 $cleanupList = array();
00332 }
00333
00334 if ( $eventType->needCleanup() )
00335 {
00336 $cleanupList[] = $workflowEvent->attribute( 'id' );
00337 $workflowParameters['cleanup_list'] = $cleanupList;
00338 $this->setAttribute( 'parameters', serialize( $workflowParameters ) );
00339 }
00340
00341 eZDebugSetting::writeDebug( 'workflow-process', $currentEventStatus, "currentEventStatus" );
00342 switch( $currentEventStatus )
00343 {
00344 case EZ_WORKFLOW_TYPE_STATUS_ACCEPTED:
00345 {
00346 $done = false;
00347 $workflowStatus = EZ_WORKFLOW_STATUS_DONE;
00348 }break;
00349 case EZ_WORKFLOW_TYPE_STATUS_WORKFLOW_DONE:
00350 {
00351 $done = true;
00352 $workflowStatus = EZ_WORKFLOW_STATUS_DONE;
00353 } break;
00354 case EZ_WORKFLOW_TYPE_STATUS_REJECTED:
00355 {
00356 $done = true;
00357 $workflowStatus = EZ_WORKFLOW_STATUS_FAILED;
00358 } break;
00359 case EZ_WORKFLOW_TYPE_STATUS_DEFERRED_TO_CRON:
00360 case EZ_WORKFLOW_TYPE_STATUS_DEFERRED_TO_CRON_REPEAT:
00361 {
00362 if ( $eventType->hasAttribute( "activation_date" ) )
00363 {
00364 $date = $eventType->attribute( "activation_date" );
00365 $this->setAttribute( "activation_date", $date );
00366 }
00367 $workflowStatus = EZ_WORKFLOW_STATUS_DEFERRED_TO_CRON;
00368 $done = true;
00369 } break;
00370 case EZ_WORKFLOW_TYPE_STATUS_FETCH_TEMPLATE:
00371 case EZ_WORKFLOW_TYPE_STATUS_FETCH_TEMPLATE_REPEAT:
00372 {
00373 $workflowStatus = EZ_WORKFLOW_STATUS_FETCH_TEMPLATE;
00374 $done = true;
00375 } break;
00376 case EZ_WORKFLOW_TYPE_STATUS_REDIRECT:
00377 case EZ_WORKFLOW_TYPE_STATUS_REDIRECT_REPEAT:
00378 {
00379 $workflowStatus = EZ_WORKFLOW_STATUS_REDIRECT;
00380 $done = true;
00381 } break;
00382 case EZ_WORKFLOW_TYPE_STATUS_RUN_SUB_EVENT:
00383 {
00384 eZDebug::writeWarning( "Run sub event not supported yet", "eZWorkflowProcess::run" );
00385 } break;
00386 case EZ_WORKFLOW_TYPE_STATUS_WORKFLOW_CANCELLED:
00387 {
00388 $done = true;
00389 $this->advance();
00390 $workflowStatus = EZ_WORKFLOW_STATUS_CANCELLED;
00391 } break;
00392 case EZ_WORKFLOW_TYPE_STATUS_WORKFLOW_RESET:
00393 {
00394 $done = true;
00395 $this->reset();
00396 $workflowStatus = EZ_WORKFLOW_STATUS_RESET;
00397 } break;
00398 case EZ_WORKFLOW_TYPE_STATUS_NONE:
00399 {
00400 eZDebug::writeWarning( "Workflow executing status is EZ_WORKFLOW_TYPE_STATUS_NONE", "eZWorkflowProcess::run" );
00401 } break;
00402 default:
00403 {
00404 eZDebug::writeWarning( "Unknown status '$currentEventStatus'", "eZWorkflowProcess::run" );
00405 } break;
00406 }
00407 $eventLog[] = array( "status" => $currentEventStatus,
00408 "status_text" => eZWorkflowType::statusName( $currentEventStatus ),
00409 "information" => $eventType->attribute( "information" ),
00410 "description" => $workflowEvent->attribute( "description" ),
00411 "type_name" => $eventType->attribute( "name" ),
00412 "type_group" => $eventType->attribute( "group_name" ) );
00413 }
00414 else
00415 eZDebug::writeError( "Expected an eZWorkFlowType object", "eZWorkflowProcess::run" );
00416 }
00417 else
00418 {
00419 eZDebugSetting::writeDebug( 'workflow-process', "Not running current event. Trying next" );
00420 }
00421 $runCurrentEvent = true;
00422
00423 if ( !$done )
00424 {
00425
00426 $event_pos = $this->attribute( "event_position" );
00427
00428 $next_event_pos = $event_pos + 1;
00429 $next_event_id = $workflow->fetchEventIndexed( $next_event_pos );
00430 if ( $next_event_id !== null )
00431 {
00432 eZDebugSetting::writeDebug( 'workflow-process', $event_pos , "workflow not done");
00433 $this->advance( $next_event_id, $next_event_pos, $currentEventStatus );
00434 $workflowEvent = eZWorkflowEvent::fetch( $next_event_id );
00435 }
00436 else
00437 {
00438 $done = true;
00439 unset( $workflowEvent );
00440 eZDebugSetting::writeDebug( 'workflow-process', $event_pos , "workflow done");
00441 $workflowStatus = EZ_WORKFLOW_STATUS_DONE;
00442 $this->advance();
00443 }
00444 }
00445
00446 }
00447
00448 $this->setAttribute( "status", $workflowStatus );
00449 $this->setAttribute( "modified", time() );
00450 return $workflowStatus;
00451 }
00452
00453
00454
00455
00456
00457
00458 function store()
00459 {
00460 eZPersistentObject::store();
00461 }
00462
00463 function fetch( $id, $asObject = true )
00464 {
00465 return eZPersistentObject::fetchObject( eZWorkflowProcess::definition(),
00466 null,
00467 array( 'id' => $id ),
00468 $asObject );
00469 }
00470
00471 function fetchList( $conds = null, $asObject = true, $offset = false, $limit = false )
00472 {
00473 $limitation = array( 'offset' => $offset,
00474 'length' => $limit );
00475 return eZPersistentObject::fetchObjectList( eZWorkflowProcess::definition(),
00476 null, $conds, null, $limitation,
00477 $asObject );
00478 }
00479
00480
00481
00482
00483
00484 function fetchListCount( $conditions = null )
00485 {
00486 $rows = eZPersistentObject::fetchObjectList( eZWorkflowProcess::definition(),
00487 array(),
00488 $conditions,
00489 false,
00490 null,
00491 false, false,
00492 array( array( 'operation' => 'count( * )',
00493 'name' => 'count' ) ) );
00494 return $rows[0]['count'];
00495 }
00496
00497 function createKey( $parameters, $keys = null )
00498 {
00499
00500 $string = '';
00501 if ( $keys != null )
00502 {
00503 foreach ( $keys as $key )
00504 {
00505 $value = $parameters[$key];
00506 $string .= $key . $value;
00507 }
00508 }else
00509 {
00510 foreach ( array_keys( $parameters ) as $key )
00511 {
00512 $value =& $parameters[$key];
00513 $string .= $key . $value;
00514 }
00515 }
00516 return md5( $string );
00517 }
00518
00519
00520
00521 function fetchListByKey( $searchKey, $asObject = true )
00522 {
00523 return eZPersistentObject::fetchObjectList( eZWorkflowProcess::definition(),
00524 null,
00525 array( 'process_key' => $searchKey ), null, null,
00526 $asObject );
00527 }
00528
00529 function fetchUserList( $userID, $asObject = true )
00530 {
00531 $conds = array( 'user_id' => $userID );
00532 return eZPersistentObject::fetchObjectList( eZWorkflowProcess::definition(),
00533 null, $conds, null, null,
00534 $asObject );
00535 }
00536
00537 function fetchForContent( $workflowID, $userID,
00538 $contentID, $content_version, $nodeID,
00539 $asObject = true )
00540 {
00541 $conds = array( 'workflow_id' => $workflowID,
00542 'user_id' => $userID,
00543 'content_id' => $contentID,
00544 'content_version' => $contentVersion,
00545 'node_id' => $nodeID );
00546 return eZPersistentObject::fetchObjectList( eZWorkflowProcess::definition(),
00547 null, $conds, null, null,
00548 $asObject );
00549 }
00550 function fetchForStatus( $status = EZ_WORKFLOW_STATUS_DEFERRED_TO_CRON, $asObject = true )
00551 {
00552 $conds = array( 'status' => $status );
00553
00554 $db = eZDB::instance();
00555 if ( $db->databaseName() == 'oracle' )
00556 $conds['LENGTH(memento_key)'] = array( '!=', 0 );
00557 else
00558 $conds['memento_key'] = array( '!=', '' );
00559
00560 return eZPersistentObject::fetchObjectList( eZWorkflowProcess::definition(),
00561 null, $conds, null, null,
00562 $asObject );
00563 }
00564
00565 function fetchForSession( $sessionKey, $workflowID, $asObject = true )
00566 {
00567 $conds = array( 'workflow_id' => $workflowID,
00568 'session_key' => $sessionKey );
00569 return eZPersistentObject::fetchObjectList( eZWorkflowProcess::definition(),
00570 null, $conds, null, null,
00571 $asObject );
00572 }
00573
00574 function currentEvent()
00575 {
00576 }
00577
00578 function advanceToNext()
00579 {
00580 }
00581
00582 function &setParameters( $parameterList = null )
00583 {
00584 if ( !is_null( $parameterList ) )
00585 {
00586 $this->Parameters = $parameterList;
00587 unset( $this->ParameterList );
00588 }
00589 $this->setAttribute( 'parameters', serialize( $this->Parameters ) );
00590 $parameterList = $this->attribute( 'parameter_list' );
00591 return $parameterList;
00592 }
00593
00594 function &user()
00595 {
00596 if ( isset( $this->UserID ) and $this->UserID )
00597 {
00598 include_once( 'kernel/classes/datatypes/ezuser/ezuser.php' );
00599 $user =& eZUser::instance( $this->UserID );
00600 }
00601 else
00602 $user = null;
00603 return $user;
00604 }
00605
00606 function &content()
00607 {
00608 if ( isset( $this->ContentID ) and $this->ContentID )
00609 {
00610 include_once( 'kernel/classes/ezcontentobject.php' );
00611 $content =& eZContentObject::fetch( $this->ContentID );
00612 }
00613 else
00614 $content = null;
00615 return $content;
00616 }
00617
00618 function &node()
00619 {
00620 if ( isset( $this->NodeID ) and $this->NodeID )
00621 {
00622 include_once( 'kernel/classes/ezcontentobjecttreenode.php' );
00623 $node = eZContentObjectTreeNode::fetch( $this->NodeID );
00624 }
00625 else
00626 $node = null;
00627 return $node;
00628 }
00629
00630 function &workflow()
00631 {
00632 if ( isset( $this->WorkflowID ) and $this->WorkflowID )
00633 {
00634 include_once( 'kernel/classes/ezworkflow.php' );
00635 $workflow = eZWorkflow::fetch( $this->WorkflowID );
00636 }
00637 else
00638 $workflow = null;
00639 return $workflow;
00640 }
00641
00642 function &workflowEvent()
00643 {
00644 if ( isset( $this->EventID ) and $this->EventID )
00645 {
00646 include_once( 'kernel/classes/ezworkflowevent.php' );
00647 $event = eZWorkflowEvent::fetch( $this->EventID );
00648 }
00649 else
00650 $event = null;
00651 return $event;
00652 }
00653
00654 function &lastWorkflowEvent()
00655 {
00656 if ( isset( $this->LastEventID ) and $this->LastEventID )
00657 {
00658 include_once( 'kernel/classes/ezworkflowevent.php' );
00659 $lastEvent = eZWorkflowEvent::fetch( $this->LastEventID );
00660 }
00661 else
00662 $lastEvent = null;
00663 return $lastEvent;
00664 }
00665
00666 function ¶meterList()
00667 {
00668 if ( !isset( $this->ParameterList ) )
00669 {
00670 $this->ParameterList = unserialize( $this->attribute( 'parameters' ) );
00671 }
00672 return $this->ParameterList;
00673 }
00674
00675
00676
00677
00678
00679 function remove()
00680 {
00681 $workflowParameters = $this->attribute( 'parameter_list' );
00682 $cleanupList = array();
00683
00684 $db =& eZDB::instance();
00685 $db->begin();
00686 if ( isset( $workflowParameters['cleanup_list'] ) && is_array( $workflowParameters['cleanup_list'] ) )
00687 {
00688 $cleanupList = $workflowParameters['cleanup_list'];
00689 foreach ( array_keys( $cleanupList ) as $key )
00690 {
00691 $workflowEventID = $cleanupList[$key];
00692 $workflowEvent = eZWorkflowEvent::fetch( $workflowEventID );
00693 $workflowType =& $workflowEvent->eventType();
00694 $workflowType->cleanup( $this, $workflowEvent );
00695 }
00696 }
00697 eZPersistentObject::removeObject( eZWorkflowProcess::definition(), array( 'id' => $this->attribute( 'id' ) ) );
00698 $db->commit();
00699 }
00700
00701
00702
00703
00704
00705
00706
00707 function cleanup()
00708 {
00709 $db =& eZDB::instance();
00710 $db->query( "DELETE FROM ezworkflow_process" );
00711 }
00712
00713
00714 var $ID;
00715 var $WorkflowID;
00716 var $UserID;
00717 var $ContentID;
00718 var $NodeID;
00719 var $EventID;
00720 var $EventPosition;
00721 var $LastEventID;
00722 var $LastEventPosition;
00723 var $LastEventStatus;
00724 var $EventStatus;
00725 var $Created;
00726 var $Modified;
00727 var $ActivationDate;
00728 }
00729
00730 ?>