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 |
|---|---|---|---|
|
|
— |
ID of the workflow organisation, or an |
|
|
— |
The workflow-organisation user — not the security user GUID from |
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 tobool(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;Noneif the activity is not currently personalised (server returns0) -
reminder_time(datetime \| None) — Reminder timestamp;Noneif 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
Use the |
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}]")
5. Notes on the server response
Observations against the enaio® test server that deviate from the formal schema documentation:
-
The
<Activity>attributesOwnerandOwnerIdare not always included, even for personalised activities. The parser treats them as empty strings; the personalisation check usesActivity.State & 128. -
OwnerTime="0"is interpreted as "not currently personalised" and mapped toNone. -
Activity.Stateuses a different bitmask thanProcess.State. The documentedProcess.Stateenumeration (1=INIT…64=SYSSUSPENDED) does not apply to activities.
6. See also
-
organisations() — provides the
organisation -
organisation_objects() — workflow-organisation user lookup