Using Java Flow Framework for SWF.
Any way to schedule an activity for a specific time in SWF?
Let’s say, send run the “sendNotification” at 22nd Oct 2017 9:00 AM.
The examples allow to create timer with a delay, but not for the specified time.
Even though I can calculate the delay, based on the current time stamp and the target time when the event is needed to be fired, but how can I get the current time during workflow execution, since if you try to get the current system time in workflow decider, it creates non-determinism in workflow and it fails.
Date currentDate = new Date(); long sysTimeInSeconds = (currentDate.getTime() / 1000); System.out.println("System Time : " + sysTimeInSeconds); Promise<Void> timer = clock.createTimer((timeStampInSeconds - sysTimeInSeconds));
[ The above code is not allowed since we are using current time from system]
The current time of workflow clock, returns the start time of the workflow, which is of no use to me.
So how I can schedule an activity for a particular time ?