You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by "Lalit Dashora (Jira)" <ji...@apache.org> on 2020/10/26 10:42:00 UTC

[jira] [Commented] (OFBIZ-11035) Add timezone support to recurring job temporal expressions

    [ https://issues.apache.org/jira/browse/OFBIZ-11035?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17220614#comment-17220614 ] 

Lalit Dashora commented on OFBIZ-11035:
---------------------------------------

Hello [~pawan]

I tried to use this feature of recurrence TimeZone but it didn't work for me.

Here are the steps I tried: 
1. Updated the default timeZone from start.properties file.
2. Created a job which will execute on daily basis. Also added recurrenceTimeZone attribute.
3. The server picked and executed the job successfully and further created new job (next day) with the same time. For example runTime data for the imported job was 26 Oct 2020 07:00 AM and after successful execution, the next job was created with time 27 Oct 2020 07:00 AM. Found that there was no change in time of recurring job.


Here in this case the system is properly adding the timeZone both default and recurrenceTimeZone. Verified the same by getting the timeZone and printing the log statements. Found that in createRecurrence method the system is trying to set the runTime by java.sql.Timestamp(next) and I think this is not working properly.

Let's assume that the server is kept in UTC/GMT timeZone and I want the jobs to execute as per the Eastern time (EST). I want to create a job which will run daily at 07:00 EST so for this I will create the data with runTime of 07:00 AM and will set recurrenceTimeZone as EST. Here, in this case, the server for the first time will pick the job at 07:00 AM (UTC) then from the next job onwards the server will convert and set the time as per 07:00 AM EST. This thing won't help much in production systems since for the first day the jobs will not be executed on correct timing and from next day onwards the time of jobs will change. Instead of adding the timeZone support for the recurring job (child jobs) it should be done as soon as the job is imported (parent/super job). Doing this way won't need to calculate and set time for recurring jobs. Continuing with the above example, on importing the job data for 07:00 AM with recurring timeZone as EST the system should first convert the DateTime as per the timeZone and then execute the job. So from the next job, the system will automatically set proper time without any code change.

I think we can reopen this ticket.

Thanks!

> Add timezone support to recurring job temporal expressions
> ----------------------------------------------------------
>
>                 Key: OFBIZ-11035
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-11035
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework/webtools
>    Affects Versions: Trunk
>            Reporter: Pawan Verma
>            Assignee: Pawan Verma
>            Priority: Major
>             Fix For: Upcoming Branch
>
>         Attachments: OFBIZ-11035.patch, OFBIZ-11035.patch
>
>
> Link of the discussion: [https://markmail.org/message/jsjqmjypaihbbldn]
> *As per Scott:*
> Trying to decide on the best way to define a *temporal* *expression* for a recurring job where the *temporal* *expression* should be evaluated using a *timezone* other than whatever the default *timezone* is for the system.
> The use case is having a system that runs on UTC time but needs to send a report at 5 pm Pacific Time every day regardless of whether or not daylight savings is in effect.
> Two options:
>  # Add a field to *JobSandbox* such as recurrenceTimeZone (or better name!)
>  # Use whatever *timezone* is available in the RunTime data service context
> Based on the discussion on Dev Mailing list #1 will be used to implement this feature.
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)