how to get todays Date

1
0
-1

Hi, I want to get the aktuell Date and check if a Date definied in an variable is reached. how to realise that with groovy in bonita?

Comments

Submitted by ttoine on Tue, 02/25/2014 - 15:56

Hello, is this really related to Bonita ? Or is it a more general programation question ?

Submitted by heinzschuh on Tue, 02/25/2014 - 16:07

its bonita. i have to realise a deadline for one activity. whant to realise it with an boundary event (Timer) This deadline ist 30 days to a spezial Date

2 answers

1
0
-1
This one is the BEST answer!

Its that easy. Found it by myselfe.

Fix date and script: mydate.minus(30)

1
0
-1

Hello, please have a look at the screenshot below:

If the date is always 30 days, you can do this way, following the steps. If you need to create a script with a number of days coming from a variable, just be sure that your script return a valid time condition ;-)

Comments

Submitted by heinzschuh on Wed, 02/26/2014 - 08:57

thanks for that. But it must be 30 Days bevor a spezial date. the way you show ist 30 Days after taking the Task. The spezial date is definied in a Variable a user set in another task... So one user set a deadline an the other user get an email 30 days befor the deadline is reached....

Submitted by ttoine on Wed, 02/26/2014 - 15:55

So choose "fixed date" instead of duration, and calculate the fixed date with a script that will use variables, etc. The variable must set be at the process level.

"Return" must be a java.lang.Long for a duration in ms or a java.util.Date that is the expiration date for the timer.

Notifications