Hello All,
Looking for a way to ensure an automation does not run multiple times within a set timeframe. The script is triggered by a correlation rule.
Hi Kristopher,
As mentioned by Ben this is possible by making use of memory files.
Step 1: Create memory file
First you need to create a memory file as shown below. In my case I just added one entry, but feel free to add as much entries as you need for in case you have multiple scripts in which you want to add this functionality
Step 2: Add memory file to script
Now you need to add a memory file reference to your script. Make sure that it's Persistent.
In above image I've added sample code to get and set the value in the memory file at location 0. Make sure to adapt the location in case you want to add this logic in multiple scripts and use the same memory file from step 1.
Step 3: Script execution
When executing the script you need to select the memory file that we've created in step 1.
If you use my code sample you'll see that the first time the value that you've received is empty, while the other times it contains a DateTime.
The memory files section will also show you the latest value that was assigned to the memory file.
Hi - in a script you have memory available, which allows you to pass on data between different script runs. You could store a timestamp in memory when you run the script, and do a check at the start of your script to compare the current time and last-run time to decide whether or not you want to abort. You can choose a persistent memory (so that your data is not lost when DataMiner would be rebooted).
Hi Kristopher – apologies, I overlooked getting back on this one. Let me see if we can get you a bit more details to get you going.
Thank you for your answer that is exactly what I was looking for. Could you show me an example of how that would be setup?