AnsweredAssumed Answered

Geoprocessing Package "Bugs" or "Features?"

Question asked by kalley on May 1, 2013
Latest reply on May 22, 2013 by khibma-esristaff
Does anyone have any ideas whether the following Geoprocessing Package issues are ???bugs??? that should be reported, or simply ???operator naivety????  Any suggestions would be greatly appreciated!! 

1) References to the ???current??? mxd are *usually* not recognized when a geoprocess is analyzed for packaging.  I have successfully packaged only one script tool that refers to a ???current??? mxd in its source script, and in that case the mxd and the source script were in the same directory.  I have not been able to package any tools with source scripts that refer to a ???current??? mxd that is in a different directory.  Tool validation scripts (stored in the default location) that refer to a ???current??? mxd also generate errors when analyzed.

2) I think this is a bug:  Comparing the original source script and the unpacked packaged source script, I discovered that path strings were not always converted to ESRI package variables, but if I substitute those strings with the existing ESRI package variables it runs smoothly.  I realize this issue would probably go away if I simply used variables to make path strings ???more visible??? in my scripts, but still think it would be worth addressing.

For example, this is a piece of the original script:
    arcpy.TableSelect_analysis(hwyLyr, r"C:\Temp\sel.dbf", "CERTCODE = '" + certCode +"' and AOTCLASS in (1, 11, 12, 13, 14)")     selectedCount = int(arcpy.GetCount_management(r"C:\Temp\sel.dbf").getOutput(0))     if selectedCount > 0:       mileageSummaryReports(dict, r"C:\Temp\sel.dbf", "Class1", "Class1Col1", "Class1Col2", "Class1Total", "Class1TotalSum", "Town")


This is the same bit after packaging and unpacking:
    arcpy.TableSelect_analysis(hwyLyr, g_ESRI_variable_14, "CERTCODE = '" + certCode +"' and AOTCLASS in (1, 11, 12, 13, 14)")     selectedCount = int(arcpy.GetCount_management(g_ESRI_variable_14).getOutput(0))     if selectedCount > 0:       mileageSummaryReports(dict, r"C:\Temp\sel.dbf", "Class1", "Class1Col1", "Class1Col2", "Class1Total", "Class1TotalSum", "Town")


And this is what it should have been:
    arcpy.TableSelect_analysis(hwyLyr, g_ESRI_variable_14, "CERTCODE = '" + certCode +"' and AOTCLASS in (1, 11, 12, 13, 14)")     selectedCount = int(arcpy.GetCount_management(g_ESRI_variable_14).getOutput(0))     if selectedCount > 0:       mileageSummaryReports(dict, g_ESRI_variable_14, "Class1", "Class1Col1", "Class1Col2", "Class1Total", "Class1TotalSum", "Town")

Outcomes