history()
Returns the modification history of an object via DMS.GetObjectHistory.
The server returns a UTF-16 encoded DMSHistory XML document which is parsed
into an ECMHistory instance containing a list of ECMHistoryEntry objects,
ordered newest first.
1. Signature
-
Sync
-
Async
ecm.dms.history(
model: _ECMModelBase | int,
object_type_id: int | None = None,
) -> ECMHistory
await ecm.dms.history(
model: _ECMModelBase | int,
object_type_id: int | None = None,
) -> ECMHistory
2. Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
|
|
— |
Either an ECM model instance (its |
|
|
|
The numeric object type ID. If |
3. Return value
An ECMHistory instance.
3.1. ECMHistory fields
| Field | Type | Description |
|---|---|---|
|
|
Version string of the executing server. |
|
|
Server-side timestamp of the query. |
|
|
List of history entries, ordered newest first. |
3.2. ECMHistoryEntry fields
| Field | Type | Description |
|---|---|---|
|
|
Unique GUID of the history entry (hex string, no dashes). |
|
|
Timestamp of the modification. |
|
|
The history action type, or |
|
|
Raw numeric action ID from the server. |
|
|
Localised short name of the action. |
|
|
Localised long description of the action. |
|
|
Internal user name (e.g. |
|
|
Full display name of the user (e.g. |
|
|
Hostname of the workstation. |
|
|
GUID of the workstation. |
|
|
Additional information about the action. |
3.3. ECMHistoryAction enum
ECMHistoryAction is an IntEnum with 56 values (1—56). The most commonly used members include:
| Member | ID | Description |
|---|---|---|
|
2 |
The object was created. |
|
3 |
The object’s index data was modified. |
|
4 |
The document content was edited. |
|
6 |
The document was deleted. |
|
17 |
A version was created for the document. |
|
21 |
The document location was changed. |
|
31 |
Log entry from the business model (created by |
|
56 |
The document was edited via an external application. |
4. Exceptions
| Exception | Condition |
|---|---|
|
|
|
|
5. Examples
5.1. Read history of a document
-
Sync
-
Async
doc = ecm.dms.get(InvoiceDocument, 12345)
history = ecm.dms.history(doc)
for entry in history.entries:
print(f"{entry.time} {entry.action_name} by {entry.display_name}")
doc = await ecm.dms.get(InvoiceDocument, 12345)
history = await ecm.dms.history(doc)
for entry in history.entries:
print(f"{entry.time} {entry.action_name} by {entry.display_name}")
5.2. Filter for version entries
-
Sync
-
Async
from ecmind_blue_client.ecm import ECMHistoryAction
history = ecm.dms.history(12345)
versions = [e for e in history.entries if e.action == ECMHistoryAction.VERSION_CREATED]
for v in versions:
print(f"Version GUID: {v.guid}, created at {v.time}")
from ecmind_blue_client.ecm import ECMHistoryAction
history = await ecm.dms.history(12345)
versions = [e for e in history.entries if e.action == ECMHistoryAction.VERSION_CREATED]
for v in versions:
print(f"Version GUID: {v.guid}, created at {v.time}")
5.3. Use with a plain object ID
-
Sync
-
Async
# Provide object_type_id to avoid an extra server round trip
history = ecm.dms.history(12345, object_type_id=327685)
print(f"Server version: {history.server_version}")
print(f"Total entries: {len(history.entries)}")
history = await ecm.dms.history(12345, object_type_id=327685)
print(f"Server version: {history.server_version}")
print(f"Total entries: {len(history.entries)}")
6. See also
-
set_history() — Add a custom history entry
-
files() — Download files of a specific version via
version_guid