5 Replies Latest reply on Nov 23, 2012 10:55 AM by Maciej Swiderski

    Can we set timezone for jbpm humantask

    tom sebastian Newbie

      Hi all,

           We are using jbpm implementation of WSHumantask specification for our Humantask (jbpm-humantask 5.2). In our application each user can set their own timezone.

      So for all data (time related), we convert it to GMT time zone before saving to databse.

      Intention is to display these data in loggined user's timezone.

      But incase of jbpm humantask, the data is saved in local timezone.

      Can we specify the data should be  saved in a specific timezone(without changing system/database timezone). Is there any such configuration?

       

      Thanks & regards

      Tom

        • 1. Re: Can we set timezone for jbpm humantask
          Maciej Swiderski Master

          Are we talking about user provided data? If so maybe using another variable to store time zone would be enough. So whenever you need to display it you can either display it directly (if timezone of user and stored in process variable matches) or convert it to user's timezone as you have all the information available.

           

          HTH

          • 2. Re: Can we set timezone for jbpm humantask
            tom sebastian Newbie

            You are correct. but is there any field to store timezone,in current implementation? For eg: the task created time,activation time etc. in implementation saved without timezone(means database local timezone).

            When the assigned user (with a different timezone) see the task form, this should be showed in his timezone(converted). So we need the timezone(at the time , data is persisted) to convert it from(We can't take this timezone as database timezone,b'coz it can be changed). So as u said we need a timezone field(or other configuration).

             

            Is this provided now?

            or what can i do to solve it.Please suggest...

            • 3. Re: Can we set timezone for jbpm humantask
              Maciej Swiderski Master

              so you can store it either as process variable if time zone will be global for entire process instance or as task variable if time zone can be different for every task. And that will cover data entered by users and not generated by the engine/ht service. As those are based on local settings of jvm and will be used when saving dates. With that said your default time zone is the one used by jvm on which task server is running on.

               

              HTH

              1 of 1 people found this helpful
              • 4. Re: Can we set timezone for jbpm humantask
                tom sebastian Newbie

                Thanks for your reply..

                But our scenario needs more.We need to filter tasks on time basis like today,last week with respect to user's timezone. As u said, if we set the original timezone(jvm of taskservice), as a task parameter,then we need to query the task content first ,then get the timezone. After that only we can convert to user's timezone. If 'timezone' is a database field then things will be easy(i mean querying). If u can add this provision in your implementation it will be very helpful...

                • 5. Re: Can we set timezone for jbpm humantask
                  Maciej Swiderski Master

                  I think that the issue is with hibernate which always converts the date object into local (set on jvm) time zone before persisting it. For now you could make use of event listeners that are triggered on various situations (task added, claimed, completed, etc) So you could use this mechanism to extend default behavior and add required data. Next use event tables for queries - as I would call it some sort of reports.

                   

                  HTH