organisation_objects()

Returns objects from the organisation tree of a workflow organisation via wfm.GetOrganisationObjects. Supports various search modes and configurable response data (index, attributes, parent/child relations).

1. Signature

  • Sync

  • Async

ecm.workflow.organisation_objects(
    organisation: str | ECMOrganisation,
    *,
    request_type: ECMOrganisationObjectRequestType = ECMOrganisationObjectRequestType.ALL,
    request_data: ECMOrganisationObjectRequestData = ECMOrganisationObjectRequestData.ALL,
    object_ids: str = "",
    object_name: str = "",
    class_ids: str = "",
    class_name: str = "",
) -> list[ECMOrganisationObject]
await ecm.workflow.organisation_objects(
    organisation: str | ECMOrganisation,
    *,
    request_type: ECMOrganisationObjectRequestType = ECMOrganisationObjectRequestType.ALL,
    request_data: ECMOrganisationObjectRequestData = ECMOrganisationObjectRequestData.ALL,
    object_ids: str = "",
    object_name: str = "",
    class_ids: str = "",
    class_name: str = "",
) -> list[ECMOrganisationObject]

2. Parameters

Parameter Type Default Description

organisation

str | ECMOrganisation

 — 

Organisation ID as a string or an ECMOrganisation instance.

request_type

ECMOrganisationObjectRequestType

ALL

Search mode (see ECMOrganisationObjectRequestType).

request_data

ECMOrganisationObjectRequestData

ALL

Which data to include in the response (see ECMOrganisationObjectRequestData).

object_ids

str

""

Comma-separated object IDs (for BY_OBJECT_IDS).

object_name

str

""

Object name (for BY_OBJECT_NAME, PREDECESSORS_BY_OBJECT_NAME, SUCCESSORS_BY_OBJECT_NAME).

class_ids

str

""

Comma-separated class IDs (for BY_CLASS_IDS).

class_name

str

""

Class name (for BY_CLASS_NAME, PREDECESSORS_BY_CLASS_NAME, SUCCESSORS_BY_CLASS_NAME).

2.1. ECMOrganisationObjectRequestType

Value Description

ALL (0)

All objects in the organisation.

BY_OBJECT_IDS (1)

Search by object IDs in object_ids.

BY_OBJECT_NAME (2)

Search by object name in object_name.

BY_CLASS_IDS (3)

Search by class IDs in class_ids.

BY_CLASS_NAME (4)

Search by class name in class_name.

PREDECESSORS_BY_OBJECT_NAME (5)

Predecessor objects for the object name.

SUCCESSORS_BY_OBJECT_NAME (6)

Successor objects for the object name.

PREDECESSORS_BY_CLASS_NAME (7)

Predecessor objects for the class name.

SUCCESSORS_BY_CLASS_NAME (8)

Successor objects for the class name.

2.2. ECMOrganisationObjectRequestData

Values act as a bitmask:

Value Description

INDEX_ONLY (1)

Index data only (ID, name, class ID).

INDEX_AND_ATTRIBUTES (3)

Index data and object attributes.

INDEX_AND_RELATIONS (5)

Index data and parent/child object references.

ALL (7)

Index data, attributes, and parent/child object references.

3. Return value

A list of ECMOrganisationObject instances.

3.1. ECMOrganisationObject fields

Field Type Description

id

str

Unique identifier (GUID) of the object.

name

str

Display name of the object.

class_id

str

Class identifier (GUID) of the object.

attributes

list[ECMOrganisationObjectAttribute]

Object attributes (empty when request_data does not include attributes).

parent_objects

list[ECMOrganisationObjectRef]

Direct parents in the organisation tree.

child_objects

list[ECMOrganisationObjectRef]

Direct children in the organisation tree.

3.2. ECMOrganisationObjectAttribute fields

Field Type Description

id

str

Attribute ID (GUID).

name

str

Attribute name.

attribute_class_id

str

Class ID of the attribute type.

flags

int

Server-defined attribute flags.

value

str

Attribute value as a string, or empty string if unset.

3.3. ECMOrganisationObjectRef fields

Field Type Description

id

str

ID (GUID) of the referenced object.

name

str

Name of the referenced object.

class_id

str

Class ID of the referenced object.

4. Examples

4.1. All objects with full data

  • Sync

  • Async

org = ecm.workflow.active_organisation()
for obj in ecm.workflow.organisation_objects(org):
    print(f"{obj.name} (class={obj.class_id})")
    for attr in obj.attributes:
        print(f"  {attr.name} = {attr.value}")
org = await ecm.workflow.active_organisation()
for obj in await ecm.workflow.organisation_objects(org):
    print(f"{obj.name} (class={obj.class_id})")
    for attr in obj.attributes:
        print(f"  {attr.name} = {attr.value}")

4.2. Index data only (more performant)

  • Sync

  • Async

from ecmind_blue_client.ecm import ECMOrganisationObjectRequestData

org = ecm.workflow.active_organisation()
objects = ecm.workflow.organisation_objects(
    org, request_data=ECMOrganisationObjectRequestData.INDEX_ONLY
)
for obj in objects:
    print(f"{obj.id}: {obj.name}")
from ecmind_blue_client.ecm import ECMOrganisationObjectRequestData

org = await ecm.workflow.active_organisation()
objects = await ecm.workflow.organisation_objects(
    org, request_data=ECMOrganisationObjectRequestData.INDEX_ONLY
)
for obj in objects:
    print(f"{obj.id}: {obj.name}")

4.3. Search by object name

  • Sync

  • Async

from ecmind_blue_client.ecm import ECMOrganisationObjectRequestType

org = ecm.workflow.active_organisation()
results = ecm.workflow.organisation_objects(
    org,
    request_type=ECMOrganisationObjectRequestType.BY_OBJECT_NAME,
    object_name="Wurzel",
)
from ecmind_blue_client.ecm import ECMOrganisationObjectRequestType

org = await ecm.workflow.active_organisation()
results = await ecm.workflow.organisation_objects(
    org,
    request_type=ECMOrganisationObjectRequestType.BY_OBJECT_NAME,
    object_name="Wurzel",
)

5. See also