Skip To Content ArcGIS for Developers Sign In Dashboard

Query Edit Log

Description

License:

The ArcGIS Pipeline Referencing for Server extension is required to use this resource.

This operation allows the LRS Edit Log to be queried without the table being published as part of the service. The LRS Edit Log is a versioned table that contains a history of LRS edit activities performed in a database version. This data is consumed by the Apply Event Behaviors tool to update event locations for route edits. The queried table will belong to the workspace of the first LRS in the service.

Request parameters

ParameterDetails
f

Description: Optional parameter to specify the response format. The default response format is html.

Values: html | json

gdbVersion

Description: Optional parameter to specify the geodatabase version to use. If this parameter is not specified, the published map's version is used.

Syntax: gdbVersion=<version>

Example: gdbVersion="user1.version1"

WHERE

Description: Optional parameter to specify a WHERE clause for the query filter. Any legal SQL WHERE clause that operates on LRS Edit Log table fields is allowed. If this parameter is not specified, the entire table is queried.

Syntax: WHERE="<clause>"

Example: WHERE="1=1"

count

Description: Optional parameter to specify the number of records to return. If specified, the most recent count number of results will be returned. The default value for this parameter is the row count of the table.

Syntax: count=<count>

Example: count=10

Example usage

URL for querying all unprocessed edit log records in a version.

https://sampleserver/server/rest/services/MyLRS/MapServer/exts/LRServer/queryEditLog?gdbVersion=portaladmin.test9&where=PROCESSED+IS+NULL+OR+PROCESSED+=+0

JSON Response syntax

The output is sorted in descending order of the transaction date of each edit log record.

{
    "editLogRecords": [
        {
            "objectId": <objectId>,
            "activityType": "<activityType",
            "lrsNetworkName": "<lrsNetworkName>",
            "routeId": "<routeId>",
            "toRouteId": "<toRouteId>",
            "fromDate": <epochTimeInMilliseconds>,
            "toDate": <epochTimeInMilliseconds>,
            "editData": "<editDataInXMLFormat>"
        },
    ...
}

JSON Response example

{
    "editLogRecords": [
        {
            "objectId": 5202,
            "activityType": "CreateRoute",
            "lrsNetworkName": "LineNetwork",
            "routeId": "{E7806741-69F6-4354-82AA-94EE672DB789}",
            "toRouteId": "{E7806741-69F6-4354-82AA-94EE672DB789}",
            "fromDate": 1555027200000,
            "toDate": -2209161600000,
            "editData": "<?xml version=\"1.0\"?>\r\n<RouteEditModel xmlns:xsi=\"https://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"https://www.w3.org/2001/XMLSchema\" SchemaVersion=\"3\"><RouteEditActivity xsi:type=\"CreateRouteInfo\" RouteId=\"{E7806741-69F6-4354-82AA-94EE672DB789}\" ToRouteId=\"{E7806741-69F6-4354-82AA-94EE672DB789}\" OperationTime=\"2019-04-12T00:00:00\" DoNotApplyEventBehaviors=\"false\"><RouteStates><RouteState RouteId=\"{E7806741-69F6-4354-82AA-94EE672DB789}\" FirstM=\"NaN\" LastM=\"NaN\" LineOrder=\"0\" IsReversed=\"false\"/></RouteStates></RouteEditActivity></RouteEditModel>\r\n"
        }
    ]
}