Do Not Overwrite Parameter Edits When a GP Tool Completes

903
5
06-14-2021 05:45 PM
Status: Open
Labels (1)
NathanHeickLACSD
Occasional Contributor III

I like how ArcGIS Pro doesn't close the parameters for a GP tool after you start it.  I like being able to reuse most of the parameters, change one or two of them, and run it again.  That's very efficient.  It's like doing a batch job, but you don't have to run everything at the same time.  You can do a single run, make sure everything is working correctly, and then just run it again several more times.

The issue I've noticed is that if you change the parameters while the tool is running, there's some sort of code that gets triggered when the tool finishes.  This code updates the parameters back to what they were for the previous run.  Initially, I didn't notice this and I ran a tool on two occasions with the wrong parameters, specifically some from the previous run and some of the new parameters.  This caused me to overwrite some outputs and lose data.  It's also annoying because it forces you to start over again or it will refresh a parameter while you are typing in a text field.

My idea is that Esri should investigate this behavior and remove it.  It can lead to bad consequences, some of which you aren't aware of if you don't see the screen flash.  It's also inefficient.

5 Comments
JonathanNeal
Status changed to: Needs Clarification

@NathanHeickLACSD Each tool does validation logic a bit differently, but in general, user defined parameters should not change, even when they become invalid.  

Can you let us know which tool you are using and a screenshot?

NathanHeickLACSD

I have had issues with different tools, but today I was using Create Feature Class.  After further testing, here is the exact use case that causes the problem.

First, I run Create Feature Class with one set of parameters.

RanToolWithTheseParameters.png

Second, I start entering another set of parameters, specifically the feature class name and alias while the tool is still running.

UpdatedParametersWhileToolWasRunning.png

Third, when the tool finishes running, if the cursor is in either the feature class name or alias parameter fields, it kicks off an event handler which reverts the parameter field back to its last value and moves the cursor to the beginning of the field.  If you finish typing the parameter and click outside the text field, it will not revert it.

ParametersRevertedBackAtEndOfRun.png

This creates a bad experience in a few ways.  First, if you don't notice it, you might have changed half of the parameters and run it with half old parameters and half new parameters.  Second, it is very annoying when it reverts back to the old value and moves the cursor while you are still typing.  You finish what you were typing at the start of the old parameter value and you have to clean up the mess you made or you accidentally run the tool with a junk value.

I can see how this could be parameter validation, but I am not clear why it is necessary or why it can't validate the value I just typed in.  Why does it have to revert or move the cursor?

JonathanNeal
Status changed to: Open

@NathanHeickLACSD This is now clear.

Possible workflow:
1. Run Tool 1 from the Geoprocessing Pane

2. While it is running, Edit a parameter.

Note: The enhancement would be to not alter changes the user has done during the tool execution.

JonathanNeal

@NathanHeickLACSD Also, another thing to consider, that follows a similar workflow, is to run the tool in batch.

Steps:
1. Geoprocessing Pane>>right click the tool from search>>click Batch

2. Chose the parameter that you wish to alter, and click ok

3. Run the tool 

Note: You can now run multiples and just change the name.

JonathanNeal_0-1623724245740.png

 

NathanHeickLACSD

If I wanted to use batch jobs, I would.  Are you limited to one field now?  Sometimes, I just want to run a tool once and make sure the parameters are good, then I run it a few more times.  I just like typing the parameters over and over into the original tool quickly.

Yes, the idea is to stop changing parameter values and moving the cursor when a tool completes.  Just let the user start typing in new values for the next run.