Wait timer in interface or Expression rule

I am just trying to explore is there any way to wait(hault the execution of code for specific duration), like we have in process model or similar like Java sleep function

Thanks

Pratiksha

  Discussion posts and replies are publicly visible

Parents Reply
  • So...I think the answer is 'Yes' but it's a little convoluted...or, at least, harder than perhaps it should be...

    1. you'll need to implement a refresh variable set to auto-refresh after 1 (that is, one minute)
    2. the value of that variable should be ultimately sourced from a value in a database table, but sourced via a Stored Procedure - use the a!executeStoredProcedureForQuery() - note that the documentation says you shouldn't use this for update but in this case the use case is warranted and safe 
    3. the value is initialized in the database before the User Interface is first loaded - that is, write as part of the upstream process. If you set this to zero and have the Stored Procedure increment it by 1 each time then you can use the returned value to control  the visibility of the link component
    4. your link component will have a showWhen attribute that you can set using 'local!refreshVal > 1' which will initially evaluate to false but will evaluate to true after the autoRefresh has run

    As I said, harder than it should be but should work.

Children