tracker issue : CF-4198313

select a category, or use search below
(searches all categories and all time range)
Title:

Application scope is not available to scheduled tasks (CFIDE.scheduler.ITaskEventHandler) at instantiation

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/AsDesigned

Reporter/Name(from Bugbase): Oliver Jones / Oliver Jones ()

Created: 02/03/2017

Components: Scheduler

Versions: 2016

Failure Type: Incorrectly functioning

Found In Build/Fixed In Build: 2016.0.02.299200 /

Priority/Frequency: Normal / Some users will encounter

Locale/System: / Windows 7 SP1 64-bit

Vote Count: 0

Problem Description: Application scope is not available to scheduled tasks (CFIDE.scheduler.ITaskEventHandler) at instantiation. 

Steps to Reproduce:
Add and run following scheduled task using cfschedule:
component implements="CFIDE.scheduler.ITaskEventHandler" {
    constructor();
    
    public void function constructor() {
        VARIABLES.someLocalVar = application.someAppVar;
    }
...
}

Actual Result:
Element SOMEAPPVAR is undefined in a Java object of type class [Ljava.lang.String;.

Expected Result:
Ability to access application scope. This is not the usual way of initialising a component however init method doesn't seem to be called either (CF-4198308).

Any Workarounds:

Attachments:

Comments:

Eventhandler should be treated as a CFC file whose methods will be invoked at different lifecycles of task execution. It should not be considered as an application which will have some application scope 
Comment by Uday O.
30726 | May 10, 2019 07:47:53 AM GMT