- URL:https://<schematicdiagramtemplate-url>/generateDiagram
- Version Introduced:10.1
Description
The generateDiagram operation is performed on a schematic diagram template resource. The result of this operation is a Schematic Diagram Information Object. It is used to generate a new diagram.
Note:
Schematics services published without the Editing operation enabled don't support the generateDiagram operation. Moreover, the generateDiagram operation is only supported on schematic diagram templates when canGenerate=True; that is, when the published map references the schematic diagram template layer.
You can provide arguments to the generateDiagram operation as query parameters defined in the parameters table below.
Request Parameters
Parameter | Details |
---|---|
f | Description: The response format. The default response format is html. Values: html | json |
name | Required Description: The diagram name. Syntax: name=<diagramName> Example: name=MyTestDiagram |
user | Required Description: The diagram creator. Syntax: user=<diagramCreator> Example: user=NCA3885 |
folderID | Description: The ID of the folder in which the generated diagram will be stored. This parameter is optional. If it is not specified, the generated diagram is stored at the schematic dataset root. Syntax: folderID=<diagramFolderID> Example: folderID=1 |
builderContext | Required Description: The context for the builder which updates the diagram. This parameter syntax depends on the diagram builder:
|
Example Usage
The map used to publish the S1_Schematics Schematics service referenced the MainNetwork schematic diagram template layer. This template is based on the Standard builder and works from input GIS features organized into a geometric network.
Since this sample service was published without the Editing operation enabled, the generateDiagram operation is not supported. But, with the Editing operation enabled, you could generate a TestDiagram schematic diagram based on this template (id=2) from a set of PrimaryLine geometric network edge features; for example, {"initialObjects": [{"objectClassName": "PrimaryLine", "objectIDs": [1,2,3,4,5,6,178,179,460,555,973,1537,1809,1810,1972,17973,2292,2293,2321,2322,2323,2324,2326,2627]}]}, by executing the operation as follows:
https://servicesbeta6.esri.com/arcgis/rest/services/S1_Schematics/MapServer/exts/SchematicsServer/templates/2/generateDiagram?name=DiagramTest&folderID=&builderContext=%7B%22initialObjects%22%3A+%5B%7B%22objectClassName%22%3A+%22PrimaryLine%22%2C+%22objectIDs%22%3A+%5B1%2C2%2C3%2C4%2C5%2C6%2C178%2C179%2C460%2C555%2C973%2C1537%2C1809%2C1810%2C1972%2C17973%2C2292%2C2293%2C2321%2C2322%2C2323%2C2324%2C2326%2C2627%5D%7D%5D%7D&user=Me&f=pjson
JSON Response Syntax
{
"name": "<diagramName>",
"id": "<diagramId>",
"templateIdentifier": "<templateIdentifier>",
"templateObjectID": <templateObjectID>,
"schematicLayerIdentifier": <schematicLayerIdentifier>,
"folderObjectID": <folderObjectID>,
"folderIdentifier": "<folderIdentifier>",
"objectID": <objectID>,
"createdBy": "<diagramCreator>",
"lastModificationBy": "<diagramLastEditor>",
"lastUpdateBy": "<diagramLastUpdator>",
"creationDate": "<diagramCreationDate>",
"lastModificationDate": "<diagramModificationDate>",
"lastUpdateDate": "<diagramLastUpdateDate>",
"lockedBy": "<diagramLastLocker>",
"version": "<version>",
"extent": <envelope>,
"rootNodes": [
"<rootNode1>",
...,
"<rootNodeN>"
],
"endNodes": [
"<endNode1>",
...,
"<endNodeK>"
]
}
JSON Response Example
{
"name": "DiagramFrom_pug_PUG_gas_plants_ID3",
"id": "0-5",
"templateIdentifier": "0",
"templateObjectID": 892,
"schematicLayerIdentifier": 0,
"folderObjectID": -2,
"folderIdentifier": "-2",
"objectID": 5,
"createdBy": "NCA3885",
"lastModificationBy": "NCA3885",
"lastUpdateBy": "",
"creationDate": "05/13/11 14:13:57",
"lastModificationDate": "05/13/11 14:13:57",
"lastUpdateDate": "",
"lockedBy": "",
"version": "sde.DEFAULT",
"extent": {
"xmin": -37.342619999999989,
"ymin": -11.398460000000886,
"xmax": -37.342179999999097,
"ymax": -11.398019999999997,
"spatialReference": {
"wkid": 4326,
"latestWkid": 4326
}
}
}