Skip To Content

Update Diagram

Description

The updateDiagram operation is performed on a schematic diagram template resource. The result of this operation is a Schematic Diagram Information Object. It is used to update an existing diagram.

Note:

Schematics services published without the Editing operation enabled don't support the updateDiagram operation.

You can provide arguments to the updateDiagram operation as query parameters defined in the parameters table below.

Request Parameters

ParameterDetails
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 login of the user who updates the diagram.

Syntax: user=<diagramLastUpdateBy>

Example: user=NCA3885

builderProperties

Description: The builder property which specifies how the diagram has to be updated. This parameter is required only for diagrams based on the Standard builder.

Syntax: //For a diagram based on the Standard builder, the operation expects the update action that will be used:

builderProperties={"action" : "synchronize" | "refresh" | "appendWithFullSynchronization" | "appendWithPartialSynchronization" | "overwrite"}

Example: builderProperties={"action" : "synchronize"}

builderContext

Required

Description: The context for the builder that updates the diagram. This parameter syntax depends on the diagram builder:

  • Diagrams based on the Standard builder that are generated from a set of GIS features/objects, and you want to update using the "appendWithFullSynchronization", "appendWithPartialSynchronization" or "overwrite" action.

    In that case, the operation expects the lists of the input feature/object IDs per feature class/object table to append to the diagram/to use to overwrite the diagram, and those features/objects version.

    Syntax:

    builderContext={
      //The lists of the input GIS feature/object IDs per feature class/object table to append to the diagram, or to use to overwrite the diagram
      "initialObjects": [
        {
          "objectClassName" : "<objectClass1Name>",
          "objectIDs" : [ID11, ..., IDN] 
        },
        ...,
        {
          "objectClassName" : "<objectClassNName>",
          "objectIDs" : [ID11, ..., IDM] 
        }
      ],
      //The SDE database reference version for those input GIS features/objects
      "version": "<version>"
    }

    Example: builderContext={"initialObjects": [{"objectClassName": "PipelinesDatabase.SDE.pug_PUG_gas_plants", "objectIDs": [3]}], "version":"sde.DEFAULT"}

    Note:

    The version parameter is optional. We recommend to specify the version when you work with GIS features/objects stored in geodatabases. For this case, when specifying no version, the version used is the one configured on the Associated Object Class section of the Properties tab that displays for the associated schematic feature class when you edit the schematic dataset within Schematic Dataset Editor.

  • Diagrams based on the Standard builder that are entirely built from custom queries or generated from a set of GIS features/objects that you want to update using the "synchronize", or "refresh" action. In that case, the operation expects an empty list of initial objects.

    Syntax: builderContext={"initialObjects": []}

    Example: builderContext={"initialObjects": []}

  • Diagrams based on the XML builder. In that case, the operation expects the input XML data directly as a string.

    Syntax: builderContext=<XMLdata>

    Example:

    builderContext=<Diagrams>
    <Diagram DiagramTemplateName="SimpleXML">
    <Features>
    <NodeFeature>
    <FeatureClassName>StationsFeeder1</FeatureClassName>
    <ExternalUniqueID>NS1</ExternalUniqueID>
    <InitialX>120067.5</InitialX>
    <InitialY>4070755.8</InitialY>
    </NodeFeature>
    <NodeFeature>
    <FeatureClassName>StationsFeeder1</FeatureClassName>
    <ExternalUniqueID>NS2</ExternalUniqueID>
    <InitialX>120090.5</InitialX>
    <InitialY>4070788.8</InitialY>
    </NodeFeature>
    <LinkFeature>
    <FeatureClassName>LV_Lines</FeatureClassName>
    <ExternalUniqueID>LV1</ExternalUniqueID>
    <FromNode>NS1</FromNode>
    <ToNode>NS2</ToNode>
    </LinkFeature>
    </Features>
    </Diagram>
    </Diagrams>

persistOption

Required

Description: The persistence option to specify whether the removed/reduced schematic features are restored after update and the schematic feature links whose connections have been modified are reconnected to be in exact coherence with their associated real features after update.

Value: True | False

Example Usage

Example 1: updateDiagram operation by synchronizing a Standard builder diagram content

Under the S1_Schematics Schematics service, the MainNetwork 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 updateDiagram operation is not supported. But, with the Editing operation enabled, you could synchronize the MPS_Goldmine schematic diagram based on this template (id=2) by executing the updateDiagram operation with the following parameters:

  • MPS_Goldmine for the name parameter
  • {"action" : "synchronize"} for the builderProperties parameter
  • {"initialObjects": []} for the builderContext parameter
  • user3882 for the builderContext parameter
  • True for the persistOption parameter

Then, the updateDiagram operation would be sent to the server as follows: https://servicesbeta6.esri.com/arcgis/rest/services/S1_Schematics/MapServer/exts/SchematicsServer/templates/2/updateDiagram?name=MPS_Goldmine&builderProperties=%7B%22action%22+%3A+%22synchronize%22%7D&builderContext=%7B%22initialObjects%22%3A+%5B%5D%7D&user=user3882&persistOption=True&f=pjson

Example 2: updateDiagram operation by appending some new GIS features to a Standard builder diagram without synchronizing all the diagram content

Another kind of updateDiagram operation could be executed to append new GIS features to this schematic diagram without synchronizing all the diagram content. For example, in that case, you could use the following parameters:

  • MPS_Goldmine for the name parameter
  • {"action" : "appendWithPartialSynchronization"} for the builderProperties parameter
  • {"initialObjects": [{"objectClassName": "PrimaryLine", "objectIDs": [1]}]} for the builderContext parameter to append the PrimaryLine with OBJECTID=1 to the diagram
  • user5001 for the builderContext parameter
  • True for the persistOption parameter

Then, the updateDiagram operation would be sent to the server as follows: https://servicesbeta6.esri.com/arcgis/rest/services/S1_Schematics/MapServer/exts/SchematicsServer/templates/2/updateDiagram?name=MPS_Goldmine&builderProperties=%7B%22action%22+%3A+%22appendWithPartialSynchronization%22%7D&builderContext=%7B%22initialObjects%22%3A+%5B%7B%22objectClassName%22%3A+%22PrimayLine%22%2C+%22objectIDs%22%3A+%5B1%5D%7D%5D%7D&user=user5001&persistOption=True&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": "NCA3885",
   "creationDate": "05/13/11 14:13:57",
   "lastModificationDate": "05/15/11 09:13:57",
   "lastUpdateDate": "05/15/11 09:13:57",
   "lockedBy": "",
   "version": "sde.DEFAULT",
   "extent": {
     "xmin": -37.342619999999989,
     "ymin": -11.398460000000886,
     "xmax": -37.342179999999097,
     "ymax": -11.398019999999997,
     "spatialReference": {
      "wkid": 4326,
      "latestWkid": 4326
     }
   }
}