本文整理汇总了PHP中eZWorkflowProcess::fetchForStatus方法的典型用法代码示例。如果您正苦于以下问题:PHP eZWorkflowProcess::fetchForStatus方法的具体用法?PHP eZWorkflowProcess::fetchForStatus怎么用?PHP eZWorkflowProcess::fetchForStatus使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZWorkflowProcess
的用法示例。
在下文中一共展示了eZWorkflowProcess::fetchForStatus方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
/**
* File containing the workflow.php cronjob
*
* @copyright Copyright (C) 1999-2011 eZ Systems AS. All rights reserved.
* @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
* @version //autogentag//
* @package kernel
*/
$runInBrowser = true;
if ( isset( $webOutput ) )
$runInBrowser = $webOutput;
$db = eZDB::instance();
$workflowProcessList = eZWorkflowProcess::fetchForStatus( eZWorkflow::STATUS_DEFERRED_TO_CRON );
$cli->output( "Checking for workflow processes" );
$removedProcessCount = 0;
$processCount = 0;
$statusMap = array();
foreach( $workflowProcessList as $process )
{
$db->begin();
$workflow = eZWorkflow::fetch( $process->attribute( "workflow_id" ) );
if ( $process->attribute( "event_id" ) != 0 )
$workflowEvent = eZWorkflowEvent::fetch( $process->attribute( "event_id" ) );
$process->run( $workflow, $workflowEvent, $eventLog );
// Store changes to process
示例2: runWorkflow
function runWorkflow()
{
$workflowProcessList = eZWorkflowProcess::fetchForStatus(eZWorkflow::STATUS_DEFERRED_TO_CRON);
foreach ($workflowProcessList as $process) {
$workflow = eZWorkflow::fetch($process->attribute("workflow_id"));
if ($process->attribute("event_id") != 0) {
$workflowEvent = eZWorkflowEvent::fetch($process->attribute("event_id"));
}
$process->run($workflow, $workflowEvent, $eventLog);
// Store changes to process
if ($process->attribute('status') != eZWorkflow::STATUS_DONE) {
if ($process->attribute('status') == eZWorkflow::STATUS_RESET || $process->attribute('status') == eZWorkflow::STATUS_FAILED || $process->attribute('status') == eZWorkflow::STATUS_NONE || $process->attribute('status') == eZWorkflow::STATUS_CANCELLED || $process->attribute('status') == eZWorkflow::STATUS_BUSY) {
$bodyMemento = eZOperationMemento::fetchMain($process->attribute('memento_key'));
$mementoList = eZOperationMemento::fetchList($process->attribute('memento_key'));
$bodyMemento->remove();
foreach ($mementoList as $memento) {
$memento->remove();
}
}
if ($process->attribute('status') == eZWorkflow::STATUS_CANCELLED) {
$process->removeThis();
} else {
$process->store();
}
} else {
//restore memento and run it
$bodyMemento = eZOperationMemento::fetchChild($process->attribute('memento_key'));
if (is_null($bodyMemento)) {
eZDebug::writeError($bodyMemento, "Empty body memento in workflow.php");
continue;
}
$bodyMementoData = $bodyMemento->data();
$mainMemento = $bodyMemento->attribute('main_memento');
if (!$mainMemento) {
continue;
}
$mementoData = $bodyMemento->data();
$mainMementoData = $mainMemento->data();
$mementoData['main_memento'] = $mainMemento;
$mementoData['skip_trigger'] = true;
$mementoData['memento_key'] = $process->attribute('memento_key');
$bodyMemento->remove();
$operationParameters = array();
if (isset($mementoData['parameters'])) {
$operationParameters = $mementoData['parameters'];
}
$operationResult = eZOperationHandler::execute($mementoData['module_name'], $mementoData['operation_name'], $operationParameters, $mementoData);
$process->removeThis();
}
}
}