Description
resources is an array of named inputs that the rest of a product definition refers to by token. Each resource has a name, a type, and a value; the type determines what the resource returns (a literal value, a workspace path, a layer, a map, a layout, a job property, etc.). Resources let the product definition stay declarative—operations reference [ rather than hard-coding paths or values that change per job.
How it is used
Wherever an operation parameter contains [—optionally followed by a member path (\\ or \\)—the Topographic Production Service substitutes the resolved value at run time. Some resources have their value supplied in the JSON (for example, a Value resource for Sheet), while predefined resources known to the server object extension (SOE)—such as Source, AOI, Layout, Job, and Package—are populated by the SOE from the current map service, job, and packaging context.
Typical patterns seen in the installed product definitions include:
[to reference an extracted feature class.Source Workspace]\\ B M\\ Contour L [to pass the current AOI extent as an operation parameter.AOI Layer]\\ Extent [to look up grid transformation metadata for the current map.Grid Locator]\\ Map\\ Transformation\\ Log [to reference a raster shipped with the product files.Product Files]\\ Elevation.gdb\\ DEM [to record the parent job ID on a child task.Job]\\ Id
Expected values
Each resource entry is as follows:
{
"name": "<string>",
"type": <number>,
"value": "<string>"
}`The following types are available:
1—Value resource; returns the value set in the JSON. Use it to declare named constants referenced by multiple operations.2—Layer resource; returns details about a layer.3—Workspace resource; returns the path to a dataset.4—GridLocator resource; returns the path to a grid.xmlfile for a specified map using the AOI when the map product is created.5—Map resource; returns details about a map.6—Layout resource; returns details about a layout.7—ProductFiles resource; returns the path to a file in the installed product files. The file name must be unique across installed product files.9—JobResource; returns details about a job that is currently running.10—PackageResource; returns details about how an output is packaged.
The detailed syntax for each type—including the member paths that can be appended to the resource name—is listed in Types of resources below.
Behavior and relationships
- To use a resource, place brackets around its name. For example, with the resource
Sheetdefined, theID Layeroperation can setProperties definitionto_query NR. At run time,N = '[ Sheet I D]' [is replaced with the sheet identifier of the map being generated.Sheet I D] - Predefined resources known to the SOE (such as
Source,Workspace AOI,Layer Layout,Job, andPackage) are left with an emptyvaluein the JSON because the SOE sets their value at run time from the map service, the job, and the packaging configuration. - Resources are referenced by
data,Extraction pre, andProcessing operations. Renaming a resource requires updating every reference; mismatches cause the substitution to fail and the operation to error. - You can review the map product definitions included with the Topographic Mapping product files for examples of how resources are used.
User considerations
- Use distinct names for
Valueresources you intend to reference from multiple operations (Sheet,ID Product,Name Product, and similar). Reusing the same name for different purposes makes downstream operations harder to read.Version - Member paths are case-sensitive and follow the table in Types of resources. For example,
[is valid;AOI Layer]\\ Extent [is not.AOI Layer]\\extent - For
Productresources, ensure the referenced file name is unique across installed product files; otherwise the resolver cannot pick a single file.Files
Example
The following example, drawn from a map product definition, defines a Value resource for the sheet identifier and references it from a Layer operation:
{
"resources": [
{
"name": "SheetID",
"type": 1,
"value": ""
}
],
"operations": [
{
"name": "LayerProperties",
"type": 12,
"description": "Update Layer in Map",
"parameters": [
{ "name": "in_layer", "value": "ASG_Layer" },
{ "name": "definition_query", "value": "NRN = '[SheetID]'" }
]
}
]
}Types of resources
The following table provides more details about the types of resources:
| Resource | Type | Syntax | Details |
|---|---|---|---|
Value | 1 |
| Returns the value defined in the resource. |
Layer | 2 |
| Returns the layer's name. Returns the Cartographic Information Model (CIM) path to the layer. Returns a string that represents the extent of the layer. |
Workspace | 3 |
| The path to a dataset that this resource returns can be a table, feature class, or feature dataset. |
GridLocator | 4 |
| Returns the path to the appropriate grid Changes the projection of the AOI to WGS 84 GCS to avoid errors that can occur when the AOI is adjacent to the edge of a Universal Transverse Mercator (UTM) zone and a projection other than WGS 84 GCS is used. Provides log information about each transformation available for the given AOI so that you can identify which transformation to use. |
Map | 5 |
| Returns the map's name. Returns the extent of the map. |
Layout | 6 |
| Returns the layout's name. Returns the CIM path to the layout. Returns the layer's name. Returns the CIM path to a map in the layout. Returns the reference scaled of a map in the layout. Returns the extent of a map in the layout. Returns the spatial reference of a map in the layout. Returns the CIM path to a layer in a map in the layout. Returns the extent of a layer in a map in the layout. |
ProductFiles | 7 |
| Returns the path to the file name in the product files. |
JobResource | 9 |
| Returns the path to the ArcGIS Pro project that the job created. Returns the job's ID. Returns the job's name. Returns the name of the person who submitted the job. Returns Returns Returns all of the job's messages. |
PackageResource | 10 |
| Returns the path to the .aprx file. Returns the path to database associated with the project file. Returns the path to the exported output file. Returns the path to the layout template that is used in the project. Returns the path to the raster file used in the project. Returns the path to the archive file. Returns the path to the staging folder where output files are staged before they are packaged. Returns the path to the output directory. Returns the name of the output package. Returns the path to the final output package that will be available through the public service URL. |