process_list_by_user()

Returns all processes that currently have a work item in the user’s inbox via wfm.AdminGetProcessListByUser.

1. Signature

  • Sync

  • Async

ecm.workflow.process_list_by_user(
    organisation: str | ECMOrganisation,
    user: ECMOrganisationObjectIdLike,
) -> list[ECMProcess]
await ecm.workflow.process_list_by_user(
    organisation: str | ECMOrganisation,
    user: ECMOrganisationObjectIdLike,
) -> list[ECMProcess]

2. Parameters

Parameter Type Default Description

organisation

str | ECMOrganisation

 — 

ID of the workflow organisation, or an ECMOrganisation instance as returned by ecm.workflow.organisations().

user

str | ECMOrganisationObject | ECMOrganisationObjectRef

 — 

The workflow-organisation user — not the security user GUID from ecm.security. Look it up via ecm.workflow.organisation_objects() filtered by the user class ID.

3. Return value

A list of ECMProcess objects. Returns an empty list when the user has no inbox entries.

3.1. Data model

ECMProcess
  • id (str) — GUID of the process instance

  • name (str) — Display name

  • subject (str) — Subject (empty if unset)

  • state (int) — Process state: 1=INIT, 2=RUNNING, 4=SUSPENDED, 8=ACTIVE, 16=TERMINATED, 32=COMPLETED, 64=SYSSUSPENDED

  • creation (ECMProcessCreation) — Creation metadata

  • activities (tuple[ECMProcessActivity, …​]) — Activities of the process visible to the user

ECMProcessCreation
  • user_id (str) — Creator’s GUID

  • user_name (str) — Creator’s display name

  • time (datetime \| None) — Creation timestamp (UTC)

ECMProcessActivity
  • id (str) — GUID of the activity instance

  • name (str) — Display name

  • state (int) — Activity state bitmask; see note below

  • is_personalised (bool) — Convenience flag equivalent to bool(state & 128)

  • creation_time (datetime \| None) — Activity creation timestamp (UTC)

  • wi_creation_time (datetime \| None) — Work-item creation timestamp (UTC)

  • owner_time (datetime \| None) — Last personalisation timestamp; None if the activity is not currently personalised (server returns 0)

  • reminder_time (datetime \| None) — Reminder timestamp; None if unset

  • owner (str) — Current owner display name; empty when the server omits the attribute

  • owner_id (str) — Current owner GUID; empty when the server omits the attribute

Activity-state bitmask (empirically observed, distinct from Process.State):

  • 128 — Activity is personalised

  • 64 — Activity is not personalised (initial state or after withdrawal)

Use the is_personalised flag for the reliable check; owner_time correlates with personalisation but is less explicit.

4. Examples

4.1. Process list for the active organisation and Root

  • Sync

  • Async

from ecmind_blue_client.ecm import (
    ECMOrganisationObjectRequestData,
    ECMOrganisationObjectRequestType,
)

USER_CLASS_ID = "9AB24246BB9040A29FCD6015CF4F4BD9"

active_org = ecm.workflow.active_organisation()
users = ecm.workflow.organisation_objects(
    active_org,
    request_type=ECMOrganisationObjectRequestType.BY_CLASS_IDS,
    class_ids=USER_CLASS_ID,
    request_data=ECMOrganisationObjectRequestData.INDEX_ONLY,
)
root = next(u for u in users if u.name.lower() == "root")

for process in ecm.workflow.process_list_by_user(active_org, root):
    print(f"{process.name}  state={process.state}")
    for a in process.activities:
        flag = "personalised" if a.is_personalised else "open"
        print(f"  {a.name}  [{flag}]")
from ecmind_blue_client.ecm import (
    ECMOrganisationObjectRequestData,
    ECMOrganisationObjectRequestType,
)

USER_CLASS_ID = "9AB24246BB9040A29FCD6015CF4F4BD9"

active_org = await ecm.workflow.active_organisation()
users = await ecm.workflow.organisation_objects(
    active_org,
    request_type=ECMOrganisationObjectRequestType.BY_CLASS_IDS,
    class_ids=USER_CLASS_ID,
    request_data=ECMOrganisationObjectRequestData.INDEX_ONLY,
)
root = next(u for u in users if u.name.lower() == "root")

for process in await ecm.workflow.process_list_by_user(active_org, root):
    print(f"{process.name}  state={process.state}")
    for a in process.activities:
        flag = "personalised" if a.is_personalised else "open"
        print(f"  {a.name}  [{flag}]")

4.2. Filter to non-personalised activities only

processes = ecm.workflow.process_list_by_user(active_org, root)
open_items = [
    (p, a)
    for p in processes
    for a in p.activities
    if not a.is_personalised
]
print(f"{len(open_items)} open (non-personalised) activities")

5. Notes on the server response

Observations against the enaio® test server that deviate from the formal schema documentation:

  • The <Activity> attributes Owner and OwnerId are not always included, even for personalised activities. The parser treats them as empty strings; the personalisation check uses Activity.State & 128.

  • OwnerTime="0" is interpreted as "not currently personalised" and mapped to None.

  • Activity.State uses a different bitmask than Process.State. The documented Process.State enumeration (1=INIT64=SYSSUSPENDED) does not apply to activities.

6. See also