Wednesday, March 13, 2013

EG workaround on resetting prompts on egp files


Problem:

I have a stored process that multiple different users will need to run from within an enterprise guide project and am having some problems with settings on the prompts.

When one user has run the stored process it retains the values selected in the prompts so that when the next user runs the process the prompts are filled in with the last used values.
This is causing a problem as one of the prompts is for a password which not all the users will have and I would rather it not be filled in by default.

I know that from enterprise guide I can choose to reset the prompts on the stored process but is there a way to do this automatically when the project opens for example?

Workaround:


Because every enterprise guide project is basically a zip file i changed the extension of my project to .zip from .egp and had a poke around.
looking at some of the contents I discovered that the prompt values are (as i suspected) being stored within the project itself and not in the metadata object. This is backed up by the fact that if I add the stored process to a new project or run it through the web server the prompts are not pre-filled for me.
The other thing I spotted was that if I run the stored process and then close the project without saving, when I re-open the project the prompts are set back to the previous time I ran them.

Whilst this has not helped me to find a way to automatically reset the prompts it does mean that I have half a workaround as follows;
  • Reset the prompts myself and save the project
  • Make the project read only (properties on the file in windows)
  • Then release the project to the users
This has drawbacks because the users get the horrible 'this project is read only' message every time they open it and they have to remember to export the log files whenever they hit errors, however it does mean that the stored processes are always blank and they cannot accidentally delete any of the code I have written for them.

_____________________________________________________________________
Dan Strickland
Inland Fisheries Division
Texas Parks and Wildlife
3407-A S.Chadbourne Street
San Angelo, TX  76903

Phone:  512-666-4546



No comments:

Post a Comment