Unable to create gpk for Runtime

5725
4
11-16-2011 12:59 PM
Labels (1)
ShawnKendrot
New Contributor
After following the documentation here and here, we are unable to create a gpk for use within the Runtime.

We encountered the following issues when trying to use the python tools:

  • The documentation states that you can specify the save location for the gpk as just the file name, but we found that you must provide the full path to the file location. The same is true for the location of the GP result file.

  • using IDLE python IDE the provided sample from the docs crashes

  • After much trial and error trying to get the PackageResult parameters correct, it stated that any tool (we tried the existing Reverse Geocode and our custom GP tool) was not licensed for packaging


We were able to create a gpk from ArcMap using the Share As tool, but this does not allow for Runtime access. There needs to be a way to create a package for Runtime within ArcMap not using Python.
0 Kudos
4 Replies
BKuiper
Occasional Contributor III
Regarding licensing, in ArcMap go to "ArcMap options" under the Customize menu and then to tab "Sharing". Enable the ArcGIS Runtime support. This will let you deploy it as a package for runtime.
0 Kudos
MichaelBranscomb
Esri Frequent Contributor
Hi Shawn (and thanks kuiperfoliage),

As you've suggested the main route for packaging Geoprocessing tools is indeed via the ArcMap UI (Python is entirely optional). The first thing to say is that the process for creating Geoprocessing tools for the ArcGIS Runtime is very similar to that of creating GP tools for ArcGIS Server. Here are some pointers that should help get it right:

#0. Check that your input and outputs match the supported GP input/output datatypes, if necessary using additional GP tools to massage the data format or select a subset of content.

#1. Use the %ScratchWorkspace% environment variable for any intermediate/output data (this means ArcGIS Desktop, ArcGIS Runtime and any other ArcGIS applications know where to write the intermediate/output data, for example instead of using C:\data). This is really just a good practice tip - ArcGIS will actually fix this up for you during the packaging process.

#2. Ensure you have set the input(s) AND output as Model Parameters (right click and choose "Model Parameter"). NOTE: Be careful about the order in which you do this as it determines the order in which the parameters are expected when the tool is run. You can open the model properties dialog to confirm (and adjust) the order of the parameters. The output/derived parameter should really always be last.

#3. Run the Geoprocessing tool once within ArcMap to get a successful execution and results.

#4. Share the Geoprocessing result from the Results Window as a Geoprocessing Package. NOTE: Ensure you check the option to support the ArcGIS Runtime - this is enabled by switching on the support ArcGIS Runtime option in the ArcMap Customize > ArcMap Options > Sharing menu.

#5. When programmatically running the GP tool, the order in which you provide the input parameters MUST be exactly the same as the order in which they were defined in the model. The parameter names must also match. you do not need to specify the output parameter.

#6. When using the GPK in code, insert a breakpoint after the local geoprocessing service is started. Once the breakpoint is hit - check the Error property to confirm there was no problem encountered starting the service. Then get the UrlGeoprocessingService property and paste it into a browser (while the app is still in debug mode and the local server is still running). This will display the HTML view of the server which will tell you what tool(s) are in your GP package and what parameters each tool expects.

I've checked the desktop documentation you referred to - and you're correct the example Python syntax is incorrect - you do definitely need to specify the full path for where you want to save the GPK file.

Cheers

Mike
0 Kudos
ShawnKendrot
New Contributor
Thank you for the reply.

At step 4, this option should always be enabled. I shouldn't have to enable the option to be enabled. But this did work, I can now see the option. However, when I try to share, it states that my gp tool is not licensed. Clicking on the help does not help

An analyzer message of error 00089 happens when a tool which is not supported in the ArcGIS Runtime is attempted to be packaged. You cannot package this tool. You will need to modify your workflow to include different tool(s).

An informative analyzer message of 00089 indicates which license level of the ArcGIS Runtime is required. Ensure the consumers of your package will have the proper license level when extracting and using your geoprocessing package.


My tool is very simple, and really only a stub of a GP Tool. The code for the tool is returning true for is licensed.

Thanks!
0 Kudos
KevinHibma
Esri Regular Contributor
Thanks for pointing out the page with the python sample. I see what you're referring to. In the sample, a 'workspace' is set. Because of this, you can make everything within the script relative (what you're seeing inside the tool syntax). So when the tool is run, it puts the two pieces together.

env.workspace = "C:/ResultFiles" 
arcpy.PackageResult_management(rlts, 'all_layers.gpk', "PRESERVE", "CONVERT_ARCSDE", "#", "ALL", "ALL", "DESKTOP", r"C:\docs\readme.txt", "Summary text", "Tag1; tag2; tag3"


I understand your concerns about the option to enable Runtime. This decision was made as the great majority of people *would not* be creating geoprocessing packages for the Runtime. The Runtime supports a subset of the core tools in ArcGIS. I'm sure you can imagine the confusion for someone who doesn't know the Runtime wanting to "support more" with their package, only to be told the tools they're using wont work. Thats why we "hide" it, unless you understand what it does and why you'd want to use it. I'll try to get a couple lines into the geoprocessing package help which explain how to get the checkbox enabled in the package creator.

The cut/paste you have below. I've since updated the text and will be available in the release after Beta2 (I missed the boat for beta2).
0 Kudos