lib/ezutils/classes/ezmoduleoperationinfo.php
function executeTrigger( &$bodyReturnValue, $body,
                             $operationParameterDefinitions, $operationParameters,
                             &$bodyCallCount, $currentLoopData,
                             $triggerRestored, $operationName, &$operationKeys )
    {
        $triggerName = $body['name'];
        $triggerKeys = $body['keys'];

        $status = eZTrigger::runTrigger( $triggerName, $this->ModuleName, $operationName, $operationParameters, $triggerKeys );


        if ( $status['Status'] == eZTrigger::WORKFLOW_DONE ||
             $status['Status'] == eZTrigger::NO_CONNECTED_WORKFLOWS )
        {
            ++$bodyCallCount['loop_run'][$triggerName];
            return eZModuleOperationInfo::STATUS_CONTINUE;
        }
        else if ( $status['Status'] == eZTrigger::STATUS_CRON_JOB ||
                  $status['Status'] == eZTrigger::FETCH_TEMPLATE ||
                  $status['Status'] == eZTrigger::FETCH_TEMPLATE_REPEAT ||
                  $status['Status'] == eZTrigger::REDIRECT )
        {
            $bodyMemento = $this->storeBodyMemento( $triggerName, $triggerKeys,
                                                    $operationKeys, $operationParameterDefinitions, $operationParameters,
                                                    $bodyCallCount, $currentLoopData, $operationName );
            $workflowProcess = $status['WorkflowProcess'];
            if ( $workflowProcess !== null )
            {
                $workflowProcess->setAttribute( 'memento_key', $bodyMemento->attribute( 'memento_key' ) );
                $workflowProcess->store();
            }

            $bodyReturnValue['result'] = $status['Result'];
            if ( $status['Status'] == eZTrigger::REDIRECT )
            {
                $bodyReturnValue['redirect_url'] = $status['Result'];
            }
            if ( $status['Status'] == eZTrigger::FETCH_TEMPLATE_REPEAT )
            {
                // Hack for project issue #14371 (fetch template repeat)
                // The object version's status is set to REPEAT so that it can
                // be submitted again
                if ( $operationName == 'publish' && $this->ModuleName == 'content' )
                {
                    eZContentOperationCollection::setVersionStatus( $operationParameters['object_id'],
                        $operationParameters['version'], eZContentObjectVersion::STATUS_REPEAT );
                }
                return eZModuleOperationInfo::STATUS_REPEAT;
            }
            else
            {
                return eZModuleOperationInfo::STATUS_HALTED;
            }
        }
        else if ( $status['Status'] == eZTrigger::WORKFLOW_CANCELLED or
                  $status['Status'] == eZTrigger::WORKFLOW_RESET )
        {
             return eZModuleOperationInfo::STATUS_CANCELLED;
             $bodyReturnValue['result'] = $status['Result'];
        }
    }
function executeTrigger( &$bodyReturnValue, $body,
                             $operationParameterDefinitions, $operationParameters,
                             &$bodyCallCount, $currentLoopData,
                             $triggerRestored, $operationName, &$operationKeys )
    {
        $triggerName = $body['name'];
        $triggerKeys = $body['keys'];

        $status = eZTrigger::runTrigger( $triggerName, $this->ModuleName, $operationName, $operationParameters, $triggerKeys );


        if ( $status['Status'] == eZTrigger::WORKFLOW_DONE ||
             $status['Status'] == eZTrigger::NO_CONNECTED_WORKFLOWS )
        {
            ++$bodyCallCount['loop_run'][$triggerName];
            return eZModuleOperationInfo::STATUS_CONTINUE;
        }
        else if ( $status['Status'] == eZTrigger::STATUS_CRON_JOB ||
                  $status['Status'] == eZTrigger::FETCH_TEMPLATE ||
                  $status['Status'] == eZTrigger::FETCH_TEMPLATE_REPEAT ||
                  $status['Status'] == eZTrigger::REDIRECT )
        {
            $bodyMemento = $this->storeBodyMemento( $triggerName, $triggerKeys,
                                                    $operationKeys, $operationParameterDefinitions, $operationParameters,
                                                    $bodyCallCount, $currentLoopData, $operationName );
            $workflowProcess = $status['WorkflowProcess'];
            if ( $workflowProcess !== null )
            {
                $workflowProcess->setAttribute( 'memento_key', $bodyMemento->attribute( 'memento_key' ) );
                $workflowProcess->store();
            }

            $bodyReturnValue['result'] = $status['Result'];
            if ( $status['Status'] == eZTrigger::REDIRECT )
            {
                $bodyReturnValue['redirect_url'] = $status['Result'];
            }
            if ( $status['Status'] == eZTrigger::FETCH_TEMPLATE_REPEAT )
            {
                // Hack for project issue #14371 (fetch template repeat)
                // The object version's status is set to REPEAT so that it can
                // be submitted again
                if ( $operationName == 'publish' && $this->ModuleName == 'content' )
                {
                    eZContentOperationCollection::setVersionStatus( $operationParameters['object_id'],
                        $operationParameters['version'], eZContentObjectVersion::STATUS_REPEAT );
                }
                return eZModuleOperationInfo::STATUS_REPEAT;
            }
            else
            {
                return eZModuleOperationInfo::STATUS_HALTED;
            }
        }
        else if ( $status['Status'] == eZTrigger::WORKFLOW_CANCELLED or
                  $status['Status'] == eZTrigger::WORKFLOW_RESET )
        {
             return eZModuleOperationInfo::STATUS_CANCELLED;
             $bodyReturnValue['result'] = $status['Result'];
        }
    }
function executeTrigger ( & $ bodyReturnValue , $ body , $ operationParameterDefinitions , $ operationParameters , & $ bodyCallCount , $ currentLoopData , $ triggerRestored , $ operationName , & $ operationKeys ) { $ triggerName = $ body [ 'name' ] ; $ triggerKeys = $ body [ 'keys' ] ; $ status = eZTrigger :: runTrigger ( $ triggerName , $ this -> ModuleName , $ operationName , $ operationParameters , $ triggerKeys ) ; if ( $ status [ 'Status' ] == eZTrigger :: WORKFLOW_DONE || $ status [ 'Status' ] == eZTrigger :: NO_CONNECTED_WORKFLOWS ) { ++ $ bodyCallCount [ 'loop_run' ] [ $ triggerName ] ; return eZModuleOperationInfo :: STATUS_CONTINUE ; } else if ( $ status [ 'Status' ] == eZTrigger :: STATUS_CRON_JOB || $ status [ 'Status' ] == eZTrigger :: FETCH_TEMPLATE || $ status [ 'Status' ] == eZTrigger :: FETCH_TEMPLATE_REPEAT || $ status [ 'Status' ] == eZTrigger :: REDIRECT ) { $ bodyMemento = $ this -> storeBodyMemento ( $ triggerName , $ triggerKeys , $ operationKeys , $ operationParameterDefinitions , $ operationParameters , $ bodyCallCount , $ currentLoopData , $ operationName ) ; $ workflowProcess = $ status [ 'WorkflowProcess' ] ; if ( $ workflowProcess !== null ) { $ workflowProcess -> setAttribute ( 'memento_key' , $ bodyMemento -> attribute ( 'memento_key' ) ) ; $ workflowProcess -> store ( ) ; } $ bodyReturnValue [ 'result' ] = $ status [ 'Result' ] ; if ( $ status [ 'Status' ] == eZTrigger :: REDIRECT ) { $ bodyReturnValue [ 'redirect_url' ] = $ status [ 'Result' ] ; } if ( $ status [ 'Status' ] == eZTrigger :: FETCH_TEMPLATE_REPEAT ) { // Hack for project issue #14371 (fetch template repeat) // The object version's status is set to REPEAT so that it can // be submitted again if ( $ operationName == 'publish' && $ this -> ModuleName == 'content' ) { eZContentOperationCollection :: setVersionStatus ( $ operationParameters [ 'object_id' ] , $ operationParameters [ 'version' ] , eZContentObjectVersion :: STATUS_REPEAT ) ; } return eZModuleOperationInfo :: STATUS_REPEAT ; } else { return eZModuleOperationInfo :: STATUS_HALTED ; } } else if ( $ status [ 'Status' ] == eZTrigger :: WORKFLOW_CANCELLED or $ status [ 'Status' ] == eZTrigger :: WORKFLOW_RESET ) { return eZModuleOperationInfo :: STATUS_CANCELLED ; $ bodyReturnValue [ 'result' ] = $ status [ 'Result' ] ; } }
Executes an operation trigger

@param array $bodyReturnValue The current return value
@param array $body Body data for the trigger being executed
@param array $operationParameterDefinitions Operation parameters definition
@param array $operationParameters Operation parameters values
@param int $bodyCallCount Number of times the body was called
@param array $currentLoopData Memento data for the operation
@param bool $triggerRestored Boolean that indicates if operation data (memento) was restored
@param string $operationName The operation name
@param array $operationKeys Additional parameters. Only used by looping so far.
@return
Executes an operation trigger