workflow_list_by_family()

Returns all workflow models of a workflow family via wfm.GetWorkflowListByFamily.

A family groups the versions of one workflow model. Exactly one model per family is in use (ECMWorkflowFamilyModelState.IN_USE); new processes start from that one. The families themselves come from projects() as entries of type FAMILY.

1. Signature

  • Sync

  • Async

ecm.workflow.workflow_list_by_family(
    family: str | ECMWorkflowProject,
    organisation: str | ECMOrganisation | None = None,
) -> list[ECMWorkflowFamilyModel]
await ecm.workflow.workflow_list_by_family(
    family: str | ECMWorkflowProject,
    organisation: str | ECMOrganisation | None = None,
) -> list[ECMWorkflowFamilyModel]

2. Parameters

Parameter Type Description

family

str | ECMWorkflowProject

The family as a GUID or as the ECMWorkflowProject of type FAMILY from projects().

organisation

str | ECMOrganisation | None

The organisation as a GUID or as an ECMOrganisation. Defaults to the active organisation when omitted.

3. Return value

A list of ECMWorkflowFamilyModel instances in server order. Returns an empty list when the family holds no models.

Measured on enaio 12.0: an unknown or non-family GUID is not an error. The server answers <Workflows><Resources/></Workflows>, which reads as an empty list.

3.1. ECMWorkflowFamilyModel fields

Field Type Description

id

str

GUID of the workflow model (Id), the value wfm.GetWorkflow takes.

name

str

Technical model name (Name), e.g. Ad-hoc Version 3.0.5.

state

ECMWorkflowFamilyModelState

Model status (State), see below.

creator_id

str

GUID of the creator (Creator).

created_at

datetime | None

Creation time as a UTC datetime (CreationTime). None where the server reported 0.

version

int

Version number of the model within the family (Version).

lock_user_id

str

GUID of the user holding the edit lock (LockId), empty when unlocked.

lock_user_name

str

Name of the user holding the edit lock (LockName), empty when unlocked.

locked_at

datetime | None

Time of locking as a UTC datetime (LockTime). None when unlocked.

description

str

Description of the model (Description), empty when unset.

icon_id

int

Icon ID of the model (IconId), 0 when none is assigned.

localised_names

Mapping[str, str]

Display name per locale, e.g. {"de_DE": "Ad-hoc Workflow 3.0.5"}. Resolved from the <Resources> block of the response via ModelNameResId. Empty when the server ships no resource.

localised_descriptions

Mapping[str, str]

Description per locale, resolved via DescriptionResId. Empty when the server ships no resource.

3.2. ECMWorkflowFamilyModelState values

Member Value Meaning

IN_USE

1

The model is in use: new processes can be started from it. Exactly one per family.

LOCKED

2

The model is locked for editing.

IN_PROCESSING

3

The model is being edited but is not locked.

TEST_RELEASED

4

The model is released for testing.

DELETED

5

The model is deleted but still stored in the database.

RELEASED

6

The model is released but not in use: no new processes, running ones still complete.

The server manual documents only the attributes of <Workflow>. Measured on enaio 12.0 the response additionally carries ModelNameResId and DescriptionResId plus a trailing <Resources> block with the localised texts per locale. The client joins the two for you; the resource IDs are not exposed.

4. Examples

4.1. List the models of every family

  • Sync

  • Async

from ecmind_blue_client.ecm import ECMWorkflowProjectType

families = [p for p in ecm.workflow.projects() if p.type is ECMWorkflowProjectType.FAMILY]
for family in families:
    for model in ecm.workflow.workflow_list_by_family(family):
        print(f"{family.name}: {model.name} v{model.version} {model.state.name}")
from ecmind_blue_client.ecm import ECMWorkflowProjectType

projects = await ecm.workflow.projects()
for family in (p for p in projects if p.type is ECMWorkflowProjectType.FAMILY):
    for model in await ecm.workflow.workflow_list_by_family(family):
        print(f"{family.name}: {model.name} v{model.version} {model.state.name}")

4.2. Find the model in use

  • Sync

  • Async

from ecmind_blue_client.ecm import ECMWorkflowFamilyModelState

models = ecm.workflow.workflow_list_by_family(family_id)
in_use = next(m for m in models if m.state is ECMWorkflowFamilyModelState.IN_USE)
print(in_use.localised_names.get("de_DE", in_use.name))
from ecmind_blue_client.ecm import ECMWorkflowFamilyModelState

models = await ecm.workflow.workflow_list_by_family(family_id)
in_use = next(m for m in models if m.state is ECMWorkflowFamilyModelState.IN_USE)
print(in_use.localised_names.get("de_DE", in_use.name))

5. See also