I'm trying so set up a model which pulls data from an SDE daily. The data is then exported to my .gdb by the model and added to the map. The model works after I run it, however if I try to run it again I get the message 'All processes have already been run.' This creates an issue, because I want the model to be able to run over and over again, giving me the most current data from my SDE every day. And I want the process to be automatic using schedule with the model. However unless I manually click 'Validate' prior to running the model it will not actually run. I cannot find a way to get this to work? There does not appear to be a way to set the model to run without first running 'Validate' or set 'Validate' to run automatically.
Have you ever thought about exporting the model to a python script and running the python script as a Windows Scheduled Task?
I did export the model as a python script to try that, however when I run the python script no data is pulled from the SDE or added to the map, so I'm not certain that the .py script is working even though the model it's exported from works as intended. And I don't know enough about python to tackle that.
Can you share the script?
Also put some print statements in to make sure variables are getting populated as expected and path for sde connection is correct?
I appreciate the reply, the schedule tool works fine and that is not an issue. The only problem is that when the schedule runs the model automatically it doesn't actually go through its process. This is because the 'Validate' option in the 'ModelBuilder' ribbon under the 'Run' section cannot be activated automatically prior to the schedule tool running. So I have to open the project and select the 'Validate' option manually each time I want to run the model for it to go through the process.
Running the model from a set automatic schedule becomes moot, because of the requirement to 'Validate' the model manually before each run.
I guess my question is why does validate need to be a requirement before the model will be allowed to run it's process each time? Specifically if I just want the model to run each time regardless of of whether it's already been run or not?
I'm documenting my solution in case someone comes across this thread.
You can export the model as a python script, but you will need to add the script to a toolbox inside of your project. If you try to run the script outside of the project it may not run or work properly unless you make manual adjustments to your .py script.
Add the exported .py script to your project tool box, and then you can set the script to run on an automatic schedule and it should run without the need for any adjustments to the script.
It's important to keep in mind that when you export a model from ModelBuilder to a .py script that some functions of the model may not work, in my case the 'add to display' option in ModelBuilder will not transfer as part of the script. So I needed to add code manually that performs that function. So be sure to test everything as the .py script may perform differently once exported.
Ideally being able to run a model without the need to manually validate each time would be preferable, if anyone comes across this and knows a good workaround or solution to that let me know, thanks!