checkin()

Checks in a document via DMS.CheckInDocument. Releases the checkout lock and replaces the document’s files with the provided files. The document must have been checked out previously via checkout().

1. Signature

  • Sync

  • Async

ecm.dms.checkin(
    model: ECMDocumentModel | int,
    files: list[JobRequestFile],
    object_type_id: int | None = None,
    *,
    allow_other_station: bool = False,
) -> None
await ecm.dms.checkin(
    model: ECMDocumentModel | int,
    files: list[JobRequestFile],
    object_type_id: int | None = None,
    *,
    allow_other_station: bool = False,
) -> None

2. Parameters

Parameter Type Default Description

model

ECMDocumentModel | int

 — 

Either an ECMDocumentModel instance (its id is used) or a plain integer document object ID.

files

list[JobRequestFile]

 — 

List of files to check in. At least one file is required.

object_type_id

int | None

None

The numeric object type ID. If None, the type is extracted from the model instance when available, or resolved via get_object_type_by_id() for plain integer IDs.

allow_other_station

bool

False

When True, the document may be checked in from a different station than the one that checked it out.

3. Exceptions

Exception Condition

ValueError

model is an ECMDocumentModel instance with id set to None.

ECMNotFoundException

object_type_id is None and no object with the given ID exists on the server.

ECMWrongStateException

The document is not checked out, or is checked out by another user (when allow_other_station=False).

4. Examples

4.1. Checkout, modify, and checkin

  • Sync

  • Async

from ecmind_blue_client.rpc import JobRequestFileFromBytes

# Checkout the document
ecm.dms.checkout(doc_id, doc_type_id)

# ... modify the file content ...

# Checkin with the updated file
ecm.dms.checkin(doc_id, [JobRequestFileFromBytes(b"Updated content", "txt")], doc_type_id)
from ecmind_blue_client.rpc import JobRequestFileFromBytes

await ecm.dms.checkout(doc_id, doc_type_id)

# ... modify the file content ...

await ecm.dms.checkin(doc_id, [JobRequestFileFromBytes(b"Updated content", "txt")], doc_type_id)

4.2. Checkin from a different station

  • Sync

  • Async

ecm.dms.checkin(doc_id, [JobRequestFileFromBytes(b"Content", "txt")], allow_other_station=True)
await ecm.dms.checkin(doc_id, [JobRequestFileFromBytes(b"Content", "txt")], allow_other_station=True)

5. See also

  • checkout() — Lock a document for editing

  • undo_checkout() — Release a lock without checking in

  • files() — Download the files of a document

  • history() — View the modification history including version entries