Hello,
I am trying to build a macro that pause flow-through of its DataStream for a user-defined amount of time, after the the module's Run function is pressed.
Basically it will be a modified Block Until Done tool. Where it blocks the stream until a defined amount of time passes from when the user hits the Run button.
Is there a way to track/record when the run button is hit, allowing a start point for code to build a countdown? I am assuming I have to build an R or Python script to do this. I am at the exploration stage, so I am not sure how I will build this, but for now I am just trying to find out if there is a way to identify when the module's run is engaged.
Thanks.
Solved! Go to Solution.
Hey @ScubaGeek,
You can use the run time events to identify when run is pressed.
It is also possible to stop the workflow for a given time using the Python tool and the time library:
import time
time.sleep(3)
An Alteryx app could allow a user to pass a given amount of time to the python tool.
you can download CReW macros from Chaos Reigns Within
There is a tool in that package called "wait a second" -- this tool allows a user to specify a wait time between records passing through the tool.
If this helped to solve you're issue, please make sure to mark it as a solution to help out other members of the community.
Thanks :)
This is exactly what i was looking for! Thank you!
solution which I could think of using R tool, on Alteryx wait issue please find below
Basically 2 tools are being used to arrive at the solution –
Block until Done and R language Tool
Under Block until done tool
1st Stage add R Language tool and run below script – (”30” in script means 30 seconds , which can be changed accordingly)
2nd Stage add the relevant tool needed as per your requirement
R Script below
testit <- function(x)
{
p1 <- proc.time()
Sys.sleep(x)
proc.time() - p1 # The cpu usage should be negligible
}
testit(30)
This macro package has been a life saver!! Thank you for posting this.
@PhilipMannering Your PAUSE macro is simple yet amazing. This should be publicized to the Alteryx community. Helped me resolve the error "process cannot access the file because it is being used by another process". Also works with the AMP engine enabled. Here is a screenshot of how I used it with Control Containers.