SugarCRM SupportDocumentationSugar DeveloperSugar Developer Guide 8.0ArchitectureLogic HooksJob Queue Hooksjob_failure

job_failure

Overview

The job_failure hook executes when a job's final failure occurs.

Definition

function job_failure($bean, $event, $arguments){}

Arguments

Name Type Description
bean Object The SchedulersJob object
event String The current event
arguments Array Additional information related to the event (typically empty)

Change Log

Version Note
6.5.0RC1 Added job_failure hook

Example

./custom/modules/SchedulersJobs/logic_hooks.php

<?php

    $hook_version = 1;
    $hook_array = Array();

    $hook_array['job_failure'] = Array();
    $hook_array['job_failure'][] = Array(
        //Processing index. For sorting the array.
        1, 

        //Label. A string value to identify the hook.
        'job_failure example', 

        //The PHP file where your class is located.
        'custom/modules/SchedulersJobs/logic_hooks_class.php', 

        //The class the method is in.
        'logic_hooks_class', 

        //The method to call.
        'job_failure_method' 
    );

?>

./custom/modules/SchedulersJobs/logic_hooks_class.php

<?php

    if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');

    class logic_hooks_class
    {
        function job_failure_method($bean, $event, $arguments)
        {
            //logic
        }
    }

?>

Last modified: 2018-04-26 03:57:24