Mohmmad.Farooq

Geoprocessing Tool

Discussion created by Mohmmad.Farooq on May 27, 2013
I have created a geoprocessing tool in python. It has few parameters and one of the parameter is dependent on other parameter. (parameter one is the path and second parameter is the list of documents found on the path). When I run the tool from Arcmap it works fine.

But when the tool results are published to the server the tool parameters are not updated as per the changes made in the folder documents.

my code sample is below:

    def updateParameters(self, parameters):               
                _TEMPLATE_PATH = arcpy.GetSystemEnvironment("AGSSERVER") + "\\Templates\\ExportWebMapTemplates"
                template_param = parameters[self._LAYOUT_TEMPLATE_INDEX]
                dsList=[]
                dsList.append("MAP_ONLY")
                for f in os.listdir(_TEMPLATE_PATH):
                    name, ext = os.path.splitext(f)
                    if ext == ".mxd":
                        dsList.append(name)
                        self._AllPrintMessages.append(name)
                template_param.filter.list = dsList              
            return



Thanks in advance.

Outcomes