cancel
Showing results for 
Search instead for 
Did you mean: 

Newbie. Activiti Clock Configuration

sankalpn
Champ in-the-making
Champ in-the-making
Hi all,

     While using activiti-explorer 5.16.3 with tomcat7 on postgres-9.1 as DB and Ubuntu 12.04 machine, I noticed something weird. The moment I deploy a process definition, the message on activiti-explorer UI says "Deployed one day ago". Logs in catalina.out have correct system time which is current. But, activiti-explorer seems to be running a day behind. This also messes up IntermediateCatchTimerEvents (they do not fire as they were due "one day ago"). Apparently activiti-explorer clock is not configured properly. Also, if I leave activiti running, activiti-explorer keeps falling a day behind each day, never advancing it's day.

I tried looking at forums and activiti user guide, I did not find any configuration for clock at all. Can anyone point me to ways to debug this issue? Is there any way I can configure activiti-explorer to use system time instead of this one day before deployment time? Any pointers would be helpful. Thank you.

Best Regards,
Sankalp
11 REPLIES 11

jbarrez
Star Contributor
Star Contributor
> Apparently activiti-explorer clock i

The activiti explorer 'clock' simply uses new Date()….

What happens if you simply create a simple Java class that prints out what new Date() does?

sankalpn
Champ in-the-making
Champ in-the-making
The date is still behind system date, by one day first, and then keeps falling back a day every day.

I tried :

<DelegateExecution>.getEngineServices().getProcessEngineConfiguration().getClock().setCurrentCalendar(Calendar.getInstance());

This sets clock to current system clock, but I have to do this every day, otherwise activiti clock falls back a day.

Again, it still doesn't solve the problem of having to manually execute async service task or TimerIntermediateCatchEvent (from Manage -> Jobs in activiti-explorer).

Thanks and Regards,
Sankalp

sankalpn
Champ in-the-making
Champ in-the-making
> What happens if you simply create a simple Java class that prints out what new Date() does?

This prints the current system date and time, which is correct.

sankalpn
Champ in-the-making
Champ in-the-making
I performed a bunch of steps which fixed this problem:
1) I replaced DefaultClockImpl.class in activiti-explorer 5.16.3 war with class file from latest master build
2) In datasource bean, set defaultAutoCommit to false
3) Restarted postgres
Later, as and if time permits, I'll try to figure out which step(s) exactly fixed this. But, I suspect this might be solve the problem in this thread as well:
http://forums.activiti.org/content/boundary-event-subprocess-not-firing

jbarrez
Star Contributor
Star Contributor
> This sets clock to current system clock, but I have to do this every day, otherwise activiti clock falls back a day.

This method is ment for testing purposes, not for real processes!

We don't do anything than to delegate to the JDK or the database …

sankalpn
Champ in-the-making
Champ in-the-making
> We don't do anything than to delegate to the JDK or the database …

Thanks for this clarification. I have removed setCurrentCalendar from my service task. Plus, I am using original activiti-explorer 5.16.3. I still don't know how the timer discord sets in, but activiti clock syncs with system clock after activiti-explorer and postgres restart. I will investigate further.

car82
Champ in-the-making
Champ in-the-making
Hi have the same issue that i haven't resolved with the advices found here. Any new suggestions?

p.s.: i use the H2 database.

vasile_dirla
Star Contributor
Star Contributor
car82, what Activiti version are you using ?
this issue could be reproduced only in activiti-explorer or also the engine is affected in your case?

car82
Champ in-the-making
Champ in-the-making
Hi i am using Activiti 5.16.3 and the issue affect only actviti explorer.