Change Event

This feed can be used to retrieve all index and document set changes that have occurred in ECM. It provides a means to track any changes that may need to be replicated in an external repository.

Any modifications to an index entry will generate a new change event in this feed that contains the id of index entry folder object. Any changes to a document set (including documents) will result in an event being added that points to the document set folder object.

Only one change event will exist in the CMIS repository for each object. If an object is modified multiple times, the most recent change event will replace any that already exist.

Change history recording can be enabled by checking Save Change History in ECM Configuration under the Documents section. Change events can be generated for all historical records by clicking the Populate Change History button in ECM Configuration screen.

../_images/change-events-workbench.PNG

Get index entry changes

Request properties

Change log token:
 

A change log token will usually consist of two components, the change id and a unix timestamp: e.g. changeLogToken=17168070x1413439157

The change id is a unique value assigned to each change (17168070). The unix timestamp indicates the minimum date of changes that should be returned. Note that a custom timestamp can be passed in without an id value: e.g. changeLogToken=1413439157

Filter:

The filter parameter provides a means for the caller to restrict the result set to index entries. Optionally index number/s can be applied to set a more specific filter. Valid values:

&filter=indexentry[,index number]

Sample request

All indexes available to the repository.

GET https://test.com/testO.Web.Start/test/Api/CMIS/T1/changes/?changeLogToken=1475611121&filter=indexentry HTTP/1.1
Host: test.com

Filter for index 11 and 40 entries only.

GET https://test.com/testO.Web.Start/test/Api/CMIS/T1/changes/?changeLogToken=1475611121&filter=indexentry,11,40 HTTP/1.1
Host: test.com

Sample response

HTTP/1.1 200 OK
Cache-Control: private
Content-Type: application/atom+xml;type=feed
Server: Microsoft-IIS/7.5
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
X-UA-Compatible: IE=edge
Strict-Transport-Security: max-age=10886400
Date: Wed, 05 Oct 2016 06:23:44 GMT
Content-Length: 9642

<?xml version="1.0" encoding="utf-8"?>
<feed xml:base="https://test.com/testO.Web.Start/test/Api/CMIS/" xmlns="http://www.w3.org/2005/Atom" xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmism="http://docs.oasis-open.org/ns/cmis/messaging/200908/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app" xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/">
<atom:title type="text">Change Token 1475611121</atom:title>
<atom:id>c1a3a1d2-f699-4d46-8280-86a3a1e2f047</atom:id>
<atom:updated>2016-10-05T16:23:44+10:00</atom:updated>
<atom:link rel="self" type="application/atom+xml;type=feed" href="https://rdecm2.rd.local/testO.Web.Start/T1.CMIS.Web.CmisObjects.ConnectorLibrary.Services.Service/T1/changes/?changeLogToken=1475611121&amp;filter=indexentry&amp;environmentId=test"/>
<cmisra:hasMoreItems>false</cmisra:hasMoreItems>
<cmisra:numItems>6</cmisra:numItems>
<atom:entry xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <atom:id>8002e136eca148fd80713a4dfab9fc85</atom:id>
        <atom:title type="text">indexentry-10788-x-x-x-x-x-19 was changed.</atom:title>
        <atom:published>2016-10-05T16:23:44+10:00</atom:published>
        <atom:updated>2016-10-05T16:23:44+10:00</atom:updated>
        <app:edited>2016-10-05T16:23:44.3512315+10:00</app:edited>
        <cmisra:object>
                <cmis:properties>
                        <cmis:propertyString propertyDefinitionId="cmis:changeType" localName="ChangeType" displayName="Change Type" queryName="cmis:changeType">
                                <cmis:value>C</cmis:value>
                        </cmis:propertyString>
                        <cmis:propertyDateTime propertyDefinitionId="cmis:changeTime" localName="ChangeTime" displayName="ChangeTime" queryName="cmis:changeTime">
                                <cmis:value>2016-10-05T09:40:49.563+10:00</cmis:value>
                        </cmis:propertyDateTime>
                        <cmis:propertyId propertyDefinitionId="cmis:objectId" localName="ObjectId" displayName="Object Id" queryName="cmis:objectId">
                                <cmis:value>indexentry-10788-x-x-x-x-x-19</cmis:value>
                        </cmis:propertyId>
                        <cmis:propertyId propertyDefinitionId="cmis:changeToken" localName="Changetoken" displayName="Changetoken" queryName="cmis:changeToken">
                                <cmis:value>166042x1475624449</cmis:value>
                        </cmis:propertyId>
                </cmis:properties>
                <cmis:changeEventInfo>
                        <cmis:changeType>created</cmis:changeType>
                        <cmis:changeTime>2016-10-05T09:40:49.563+10:00</cmis:changeTime>
                        <cmis:objectId>indexentry-10788-x-x-x-x-x-19</cmis:objectId>
                </cmis:changeEventInfo>
        </cmisra:object>
</atom:entry>
</feed>

Get document set changes

Request properties

Change log token:
 

A change log token will usually consist of two components, the change id and a unix timestamp: e.g. changeLogToken=17168070x1413439157

The change id is a unique value assigned to each change (17168070). The unix timestamp indicates the minimum date of changes that should be returned. Note that a custom timestamp can be passed in without an id value: e.g. changeLogToken=1413439157

Filter:

The filter parameter provides a means for the caller to restrict the result set to document sets. Valid value:

&filter=folder[,index number]

Sample request

Filter to retrieve all document sets available to the repository that have changed.

GET https://test.com/testO.Web.Start/test/Api/CMIS/T1/changes/?changeLogToken=1475611121&filter=folder HTTP/1.1
Host: test.com

Filter to only retrieve document sets available to the repository that have changed if they are linked to index 11.

GET https://test.com/testO.Web.Start/test/Api/CMIS/T1/changes/?changeLogToken=1475611121&filter=folder,11 HTTP/1.1
Host: test.com

Sample response

HTTP/1.1 200 OK
Cache-Control: private
Content-Type: application/atom+xml;type=feed
Server: Microsoft-IIS/7.5
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
X-UA-Compatible: IE=edge
Strict-Transport-Security: max-age=10886400
Date: Wed, 05 Oct 2016 06:37:34 GMT
Content-Length: 141969

<?xml version="1.0" encoding="utf-8"?>
<feed xml:base="https://test.com/testO.Web.Start/test/Api/CMIS/" xmlns="http://www.w3.org/2005/Atom" xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmism="http://docs.oasis-open.org/ns/cmis/messaging/200908/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app" xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/">
        <atom:title type="text">Change Token 1474611121</atom:title>
        <atom:id>78af80d9-3842-4986-a8ac-47dea8a39696</atom:id>
        <atom:updated>2016-10-05T16:37:34+10:00</atom:updated>
        <atom:link rel="self" type="application/atom+xml;type=feed" href="https://test.rd.local/testO.Web.Start/T1.CMIS.Web.CmisObjects.ConnectorLibrary.Services.Service/T1/changes/?changeLogToken=1474611121&amp;filter=folder&amp;environmentId=test"/>
        <atom:link rel="first" type="application/atom+xml;type=feed" href="https://test.rd.local/testO.Web.Start/T1.CMIS.Web.CmisObjects.ConnectorLibrary.Services.Service/T1/changes/?changelogtoken=1474611121&amp;filter=folder&amp;environmentid=test&amp;maxItems=100&amp;skipCount=0"/>
        <atom:link rel="next" type="application/atom+xml;type=feed" href="https://test.rd.local/testO.Web.Start/T1.CMIS.Web.CmisObjects.ConnectorLibrary.Services.Service/T1/changes/?changelogtoken=1474611121&amp;filter=folder&amp;environmentid=test&amp;maxItems=100&amp;skipCount=100"/>
        <atom:link rel="last" type="application/atom+xml;type=feed" href="https://test.rd.local/testO.Web.Start/T1.CMIS.Web.CmisObjects.ConnectorLibrary.Services.Service/T1/changes/?changelogtoken=1474611121&amp;filter=folder&amp;environmentid=test&amp;maxItems=100&amp;skipCount=30453"/>
        <cmisra:hasMoreItems>true</cmisra:hasMoreItems>
        <cmisra:numItems>30553</cmisra:numItems>
        <atom:entry xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <atom:id>55b2aa149e074bbdad197526a283bd8b</atom:id>
                <atom:title type="text">folder-231048 was changed.</atom:title>
                <atom:published>2016-10-05T16:37:34+10:00</atom:published>
                <atom:updated>2016-10-05T16:37:34+10:00</atom:updated>
                <app:edited>2016-10-05T16:37:34.3962315+10:00</app:edited>
                <cmisra:object>
                        <cmis:properties>
                                <cmis:propertyString propertyDefinitionId="cmis:changeType" localName="ChangeType" displayName="Change Type" queryName="cmis:changeType">
                                        <cmis:value>C</cmis:value>
                                </cmis:propertyString>
                                <cmis:propertyDateTime propertyDefinitionId="cmis:changeTime" localName="ChangeTime" displayName="ChangeTime" queryName="cmis:changeTime">
                                        <cmis:value>2016-09-29T13:21:42.787+10:00</cmis:value>
                                </cmis:propertyDateTime>
                                <cmis:propertyId propertyDefinitionId="cmis:objectId" localName="ObjectId" displayName="Object Id" queryName="cmis:objectId">
                                        <cmis:value>folder-231048</cmis:value>
                                </cmis:propertyId>
                                <cmis:propertyId propertyDefinitionId="cmis:changeToken" localName="Changetoken" displayName="Changetoken" queryName="cmis:changeToken">
                                        <cmis:value>18526x1475119302</cmis:value>
                                </cmis:propertyId>
                        </cmis:properties>
                        <cmis:changeEventInfo>
                                <cmis:changeType>created</cmis:changeType>
                                <cmis:changeTime>2016-09-29T13:21:42.787+10:00</cmis:changeTime>
                                <cmis:objectId>folder-231048</cmis:objectId>
                        </cmis:changeEventInfo>
                </cmisra:object>
        </atom:entry>
</feed>

DotCMIS Sample

Request properties

Change log token:
 

A change log token will usually consist of two components, the change id and a unix timestamp: e.g. changeLogToken=17168070x1413439157

The change id is a unique value assigned to each change (17168070). The unix timestamp indicates the minimum date of changes that should be returned. Note that a custom timestamp can be passed in without an id value: e.g. changeLogToken=1413439157

Filter:

The filter parameter provides a means for the caller to restrict a result set to either index entries or document sets. Valid values are as follows:

&filter=folder

&filter=indexentry

public void Process(string changeToken = "")
{
        while(true)
        {
                do
                {
                        //Note: you would normally have a lookup table (or an alternative reference) to check whether the target objects have already been created
                        var changes = Source.GetChangeEvents(changeToken);
                        foreach (var changeEvent in changes.ChangeEventList)
                        {
                                changeToken = changeEvent.Properties.FirstOrDefault(x => x.Key.Equals("cmis:changeToken", StringComparison.OrdinalIgnoreCase)).Value.FirstOrDefault().ToString();

                                //Handle index entry changes
                                if (Helpers.GetObjectTypeFromId(changeEvent.ObjectId).Equals(Constants.ObjectIdPrefixes.IndexEntry))
                                {
                                        ProcessIndexEntry(changeEvent.ObjectId);
                                        continue;
                                }

                                //Handle docset (folder) changes
                                if (Helpers.GetObjectTypeFromId(changeEvent.ObjectId).Equals(Constants.ObjectIdPrefixes.Docset))
                                {
                                        ProcessDocumentSet(changeEvent.ObjectId, indexEntryId.Id);
                                        continue;
                                }

                                Logger.CreateMessage(new Message("Unexpected change id.", changeEvent.ObjectId, MessageTypes.Error));
                        }

                        //Check if there are any more changes
                        if (!changes.ChangeEventList.Any() || changes.HasMoreItems == null || !changes.HasMoreItems.Value) break;

                        WriteMessage(string.Format("Retrieving next set of changes: {0}", changeToken));

                } while (true);

                Logger.CreateMessage(new Message("No new changes...", MessageTypes.Information));
                Thread.Sleep(5000);
        }
}

Change Event Paging

Change event paging is based on getting the next set of records after a requested point in time. The changeLogToken parameter provided with the request sets the earliest time to retrieve change events returning results in ascending order. If more change events are available, the change token from the last change event returned is used as the change log token parameter for the next change event request.

For information on using paging for other CMIS objects see the Paging section.

Sample request

In this sample below we are requesting all document set changes made after 20/01/2023. This date converted to epoch time generates a change token of ‘1674136800’.

https://test.com/TEST/Api/CMIS/REPOSITORY/changes/?changeLogToken=1674136800&filter=folder&includeProperties=false

From the response returned, the last change event record has returned a change token of ‘115804229x1674732806’. This is the value that will be used to get the next set of changes.

https://test.com/TEST/Api/CMIS/REPOSITORY/changes/?changeLogToken=115804229x1674732806&filter=folder&includeProperties=false

Sample response

<?xml version="1.0" encoding="utf-8"?>
<feed xml:base="https://test.com/TEST/Api/CMIS/" xmlns="http://www.w3.org/2005/Atom" xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmism="http://docs.oasis-open.org/ns/cmis/messaging/200908/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app" xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/">
        <atom:title type="text">Change Token 1674181573</atom:title>
        <atom:id>8117e6f6-1649-4ed8-a80c-bfb24b2dbae2</atom:id>
        <atom:updated>2023-01-31T13:20:33Z</atom:updated>
        <atom:link rel="self" type="application/atom+xml;type=feed" href="https://ec2amaz-7s7hd0f.t1cloud.local/T1Default/CiAnywhere/Web/T1.CMIS.Web.CmisObjects.ConnectorLibrary.Services.Service/REPOSITORY/changes/?changeLogToken=1674181573&amp;filter=folder&amp;includeProperties=false&amp;environmentId=SAAS-REL-2022B"/>
        <atom:link rel="first" type="application/atom+xml;type=feed" href="https://ec2amaz-7s7hd0f.t1cloud.local/T1Default/CiAnywhere/Web/T1.CMIS.Web.CmisObjects.ConnectorLibrary.Services.Service/REPOSITORY/changes/?changelogtoken=1674181573&amp;filter=folder&amp;includeproperties=false&amp;environmentid=SAAS-REL-2022B&amp;maxItems=100&amp;skipCount=0"/>
        <atom:link rel="next" type="application/atom+xml;type=feed" href="https://ec2amaz-7s7hd0f.t1cloud.local/T1Default/CiAnywhere/Web/T1.CMIS.Web.CmisObjects.ConnectorLibrary.Services.Service/REPOSITORY/changes/?changelogtoken=1674181573&amp;filter=folder&amp;includeproperties=false&amp;environmentid=SAAS-REL-2022B&amp;maxItems=100&amp;skipCount=100"/>
        <atom:link rel="last" type="application/atom+xml;type=feed" href="https://ec2amaz-7s7hd0f.t1cloud.local/T1Default/CiAnywhere/Web/T1.CMIS.Web.CmisObjects.ConnectorLibrary.Services.Service/REPOSITORY/changes/?changelogtoken=1674181573&amp;filter=folder&amp;includeproperties=false&amp;environmentid=SAAS-REL-2022B&amp;maxItems=100&amp;skipCount=82"/>
        <cmisra:hasMoreItems>true</cmisra:hasMoreItems>
        <cmisra:numItems>182</cmisra:numItems>
        <atom:entry xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <atom:id>e2bd580a47514b5f9b8224f6ebce5aee</atom:id>
                <atom:title type="text">folder-720419 was changed.</atom:title>
                <atom:published>2023-01-31T13:20:33Z</atom:published>
                <atom:updated>2023-01-31T13:20:33Z</atom:updated>
                <app:edited>2023-01-31T13:20:33.1852035Z</app:edited>
                <cmisra:object>
                        <cmis:properties>
                                <cmis:propertyString propertyDefinitionId="cmis:changeType" localName="ChangeType" displayName="Change Type" queryName="cmis:changeType">
                                        <cmis:value>U</cmis:value>
                                </cmis:propertyString>
                                <cmis:propertyDateTime propertyDefinitionId="cmis:changeTime" localName="ChangeTime" displayName="ChangeTime" queryName="cmis:changeTime">
                                        <cmis:value>2023-01-20T14:18:41.583+10:00</cmis:value>
                                </cmis:propertyDateTime>
                                <cmis:propertyId propertyDefinitionId="cmis:objectId" localName="ObjectId" displayName="Object Id" queryName="cmis:objectId">
                                        <cmis:value>folder-720419</cmis:value>
                                </cmis:propertyId>
                                <cmis:propertyId propertyDefinitionId="cmis:changeToken" localName="Changetoken" displayName="Changetoken" queryName="cmis:changeToken">
                                        <cmis:value>115800945x1674188321</cmis:value>
                                </cmis:propertyId>
                        </cmis:properties>
                        <cmis:changeEventInfo>
                                <cmis:changeType>updated</cmis:changeType>
                                <cmis:changeTime>2023-01-20T14:18:41.583+10:00</cmis:changeTime>
                                <cmis:objectId>folder-720419</cmis:objectId>
                        </cmis:changeEventInfo>
                </cmisra:object>
        </atom:entry>
        ---
        ---
        ---
        <atom:entry xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <atom:id>0d669e23b8024f14aef2cc585244aae6</atom:id>
                <atom:title type="text">folder-207287 was changed.</atom:title>
                <atom:published>2023-01-31T13:20:33Z</atom:published>
                <atom:updated>2023-01-31T13:20:33Z</atom:updated>
                <app:edited>2023-01-31T13:20:33.1861684Z</app:edited>
                <cmisra:object>
                        <cmis:properties>
                                <cmis:propertyString propertyDefinitionId="cmis:changeType" localName="ChangeType" displayName="Change Type" queryName="cmis:changeType">
                                        <cmis:value>U</cmis:value>
                                </cmis:propertyString>
                                <cmis:propertyDateTime propertyDefinitionId="cmis:changeTime" localName="ChangeTime" displayName="ChangeTime" queryName="cmis:changeTime">
                                        <cmis:value>2023-01-26T21:33:26.783+10:00</cmis:value>
                                </cmis:propertyDateTime>
                                <cmis:propertyId propertyDefinitionId="cmis:objectId" localName="ObjectId" displayName="Object Id" queryName="cmis:objectId">
                                        <cmis:value>folder-207287</cmis:value>
                                </cmis:propertyId>
                                <cmis:propertyId propertyDefinitionId="cmis:changeToken" localName="Changetoken" displayName="Changetoken" queryName="cmis:changeToken">
                                        <cmis:value>115804229x1674732806</cmis:value>
                                </cmis:propertyId>
                        </cmis:properties>
                        <cmis:changeEventInfo>
                                <cmis:changeType>updated</cmis:changeType>
                                <cmis:changeTime>2023-01-26T21:33:26.783+10:00</cmis:changeTime>
                                <cmis:objectId>folder-207287</cmis:objectId>
                        </cmis:changeEventInfo>
                </cmisra:object>
        </atom:entry>
</feed>