VMware Cloud Community
improvingdaily
Enthusiast
Enthusiast
Jump to solution

How do you prevent workflow reruns or force inputs to update.

I am trying to figure out how I can either prevent someone from rerunning a workflow or force a date object to update even if the workflow is rerun.  I am using a data binding in my presentation to bind my date to the #__datetime.  This works fine unless someone reruns the workflow.  Thanks

0 Kudos
1 Solution

Accepted Solutions
iiliev
VMware Employee
VMware Employee
Jump to solution

No pain at all Smiley Happy

var dt = new Date();

System.log("Current date and time: " + dt);

https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Date

View solution in original post

0 Kudos
4 Replies
iiliev
VMware Employee
VMware Employee
Jump to solution

Well, the whole idea of re-running a workflow execution is to be able to restore the same input parameters' values.

If you want your date to always be equal to the current date (even during re-run), is it an option to not expose it as an input parameter at all, but instead obtain the current date where it is used in your scripting code (eg. by calling new Date())?

0 Kudos
improvingdaily
Enthusiast
Enthusiast
Jump to solution

Yes that is something I considered but getting the current date and time in javascript looks like it will be a pain.  Is there a way to get the #__datetime from javascript or is there another way to get the current date and time?

0 Kudos
iiliev
VMware Employee
VMware Employee
Jump to solution

No pain at all Smiley Happy

var dt = new Date();

System.log("Current date and time: " + dt);

https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Date

0 Kudos
improvingdaily
Enthusiast
Enthusiast
Jump to solution

That is cool.  I did not realize new Date() created a date object that is set to the current date.  That is much better than what I was thinking I had to do.  Thanks

0 Kudos