Reporting Tasks and onEnabled

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Reporting Tasks and onEnabled

Steve Youtsey
It appears that Reporting Tasks are not able to obtain a reference to a
Controller Service from within a method annotated with onEnabled. Is this
as designed?

Also, can a Controller Service obtain a reference to another Controller
Service from an onEnabled annotated method?

Thanks
Steve
Reply | Threaded
Open this post in threaded view
|

Re: Reporting Tasks and onEnabled

Matt Gilman
Steve,

Not sure which version your referring to.

In 0.0.2-incubating, the JavaDocs state that onEnabled can be used on a
method with 0 or 1 argument. Using the single argument approach, the method
will be invoked with a ConfigurationContext that should be able to obtain a
reference to a ControllerService through the PropertyValue. I'm pretty sure
the annotations were refactored in this version in preparation for
0.1.0-incubating where the ControllerServices and ReportingTasks are
configurable in the UI so make sure your not referencing a deprecated
annotation.

In 0.1.0-incubating-SNAPSHOT, the JavaDocs state that the onEnabled
annotation is only applicable for ControllerServices. Processors and
ReportingTasks should use the onScheduled annotation. Both of these
annotations (onEnabled for ControllerServices and onScheduled for
Processors/ReportingTasks) can be used on a method with 0 or 1 argument.
Using the single argument approach, the method will be invoked with a
ConfigurationContext argument. From it, the component should be able to
obtain a reference to a ControllerService through the PropertyValue.

Matt

On Wed, Apr 8, 2015 at 4:58 PM, Steve Youtsey <[hidden email]
> wrote:

> It appears that Reporting Tasks are not able to obtain a reference to a
> Controller Service from within a method annotated with onEnabled. Is this
> as designed?
>
> Also, can a Controller Service obtain a reference to another Controller
> Service from an onEnabled annotated method?
>
> Thanks
> Steve
>
Reply | Threaded
Open this post in threaded view
|

Re: Reporting Tasks and onEnabled

Steven Youtsey
I am using 0.0.2-incubating, and passing in the ConfigurationContext. It's not that I have an issue with the API (and good to know it's changing in 0.1.0), it's that the provided reference to the service is null. From your comments, this is probably because it is a Reporting Task and I was using OnEnabled. I'll switch to OnScheduled.

Thanks much!Steve
 


     On Thursday, April 9, 2015 3:23 PM, Matt Gilman <[hidden email]> wrote:
   

 Steve,

Not sure which version your referring to.

In 0.0.2-incubating, the JavaDocs state that onEnabled can be used on a
method with 0 or 1 argument. Using the single argument approach, the method
will be invoked with a ConfigurationContext that should be able to obtain a
reference to a ControllerService through the PropertyValue. I'm pretty sure
the annotations were refactored in this version in preparation for
0.1.0-incubating where the ControllerServices and ReportingTasks are
configurable in the UI so make sure your not referencing a deprecated
annotation.

In 0.1.0-incubating-SNAPSHOT, the JavaDocs state that the onEnabled
annotation is only applicable for ControllerServices. Processors and
ReportingTasks should use the onScheduled annotation. Both of these
annotations (onEnabled for ControllerServices and onScheduled for
Processors/ReportingTasks) can be used on a method with 0 or 1 argument.
Using the single argument approach, the method will be invoked with a
ConfigurationContext argument. From it, the component should be able to
obtain a reference to a ControllerService through the PropertyValue.

Matt

On Wed, Apr 8, 2015 at 4:58 PM, Steve Youtsey <[hidden email]
> wrote:

> It appears that Reporting Tasks are not able to obtain a reference to a
> Controller Service from within a method annotated with onEnabled. Is this
> as designed?
>
> Also, can a Controller Service obtain a reference to another Controller
> Service from an onEnabled annotated method?
>
> Thanks
> Steve
>