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 [<ResourceName>] rather than hard-coding paths or values that change per job.

How it is used

Wherever an operation parameter contains [<ResourceName>]—optionally followed by a member path (\\Extent or \\<DatasetName>)—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 SheetID), while predefined resources known to the server object extension (SOE)—such as SourceWorkspace, AOILayer, 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:

  • [SourceWorkspace]\\BM\\ContourL to reference an extracted feature class.
  • [AOILayer]\\Extent to pass the current AOI extent as an operation parameter.
  • [GridLocator]\\Map\\Transformation\\Log to look up grid transformation metadata for the current map.
  • [ProductFiles]\\Elevation.gdb\\DEM to reference a raster shipped with the product files.
  • [Job]\\Id to record the parent job ID on a child task.

Expected values

Each resource entry is as follows:

Use dark colors for code blocksCopy
1
2
3
4
5
{
	"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 .xml file 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 SheetID defined, the LayerProperties operation can set definition_query to NRN = '[SheetID]'. At run time, [SheetID] is replaced with the sheet identifier of the map being generated.
  • Predefined resources known to the SOE (such as SourceWorkspace, AOILayer, Layout, Job, and Package) are left with an empty value in 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 dataExtraction, preProcessing, and 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 Value resources you intend to reference from multiple operations (SheetID, ProductName, ProductVersion, and similar). Reusing the same name for different purposes makes downstream operations harder to read.
  • Member paths are case-sensitive and follow the table in Types of resources. For example, [AOILayer]\\Extent is valid; [AOILayer]\\extent is not.
  • For ProductFiles resources, ensure the referenced file name is unique across installed product files; otherwise the resolver cannot pick a single file.

Example

The following example, drawn from a map product definition, defines a Value resource for the sheet identifier and references it from a LayerProperties operation:

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{
  "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:

ResourceTypeSyntaxDetails

Value

1

[<ResourceName>]

Returns the value defined in the resource.

Layer

2

[<ResourceName>]\\Name


[<ResourceName>]\\Uri


[<ResourceName>]\\Extent

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

[<ResourceName>]\\<DatasetName>

The path to a dataset that this resource returns can be a table, feature class, or feature dataset.

GridLocator

4

[<ResourceName>]\\<MapName>


[<ResourceName>]\\<MapName>\\Transformation\\<name of transformation>


[<ResourceName>]\\<MapName>\\Transformation\\Log

Returns the path to the appropriate grid .xml file in the product data files given the map name and AOI of the map product to create.

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

[<ResourceName>]\\<Name>


[<ResourceName>]\\<MapName>\\Extent

Returns the map's name.


Returns the extent of the map.

Layout

6

[<ResourceName>]\\Name


[<ResourceName>]\\Uri


[<ResourceName>]\\Name


[<ResourceName>]\\<MapName>\\Uri


[<ResourceName>]\\<MapName>\\ReferenceScale


[<ResourceName>]\\<MapName>\\Extent


[<ResourceName>]\\<MapName>\\SpatialReference


[<ResourceName>]\\<MapName>\\<LayerName>\\Uri


[<ResourceName>]\\<MapName>\\<LayerName>\\Extent

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

[ProductFiles]\\<FileName>

Returns the path to the file name in the product files.

JobResource

9

[Job]\\Project


[Job]\\Id


[Job]\\Name


[Job]\\User


[Job]\\HasErrors


[Job]\\HasWarnings


[Job]\\Messages

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 true if the job has errors.


Returns true if the job has warnings.


Returns all of the job's messages.

PackageResource

10

[Package]\\Project


[Package]\\Database


[Package]\\Output


[Package]\\InputTemplate


[Package]\\Raster


[Package]\\Archive


[Package]\\StagingDirectory


[Package]\\OutputDirectory


[Package]\\PackageName


[Package]\\OutputPackage

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.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.