Running services on a scheduler

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

Running services on a scheduler

ian tabangay
Hi. I have some services that I wish to run on scheduled times but some of
them produces an error since the service requires authentication or the user
to be logged in. Is there a way to work around this problem? Thanks.


~ ian
Reply | Threaded
Open this post in threaded view
|

Re: Running services on a scheduler

Adrian Crum
Use the runAsUser field in JobSandbox.

-Adrian

ian tabangay wrote:
> Hi. I have some services that I wish to run on scheduled times but some of
> them produces an error since the service requires authentication or the user
> to be logged in. Is there a way to work around this problem? Thanks.
>
>
> ~ ian
>
Reply | Threaded
Open this post in threaded view
|

Re: Running services on a scheduler

jjmbconquista
In reply to this post by ian tabangay
already try put userLogin into context before call service?

GenericValue userLogin =delegator.findByPrimaryKey("UserLogin", UtilMisc.toMap("userLoginId","admin"));

        Map input = UtilMisc.toMap("userLogin", userLogin);
        Map serviceResults = dispatcher.runSync("serviceName", input);

ian tabangay-2 wrote
Hi. I have some services that I wish to run on scheduled times but some of
them produces an error since the service requires authentication or the user
to be logged in. Is there a way to work around this problem? Thanks.


~ ian