set_substitutes()

Setzt die Stellvertreter für beliebig viele Benutzer oder Rollen einer Workflow-Organisation über wfm.SetSubstitutes. Jeder Eintrag im substitutes-Mapping ersetzt die bestehende Stellvertreterliste des jeweiligen Benutzers/der Rolle vollständig; eine leere Liste löscht alle Stellvertreter für diesen Eintrag.

1. Signatur

  • Sync

  • Async

ecm.workflow.set_substitutes(
    organisation: str | ECMOrganisation,
    substitutes: Mapping[ECMOrganisationObjectIdLike, Iterable[ECMOrganisationObjectIdLike]],
) -> None
await ecm.workflow.set_substitutes(
    organisation: str | ECMOrganisation,
    substitutes: Mapping[ECMOrganisationObjectIdLike, Iterable[ECMOrganisationObjectIdLike]],
) -> None

Der Typ-Alias ECMOrganisationObjectIdLike steht für str | ECMOrganisationObject | ECMOrganisationObjectRef — d. h. überall, wo eine GUID erwartet wird, kann auch direkt eine Objekt-Instanz oder Referenz übergeben werden.

2. Parameter

Parameter Typ Standard Beschreibung

organisation

str | ECMOrganisation

Organisations-ID als String oder eine ECMOrganisation-Instanz.

substitutes

Mapping[ECMOrganisationObjectIdLike, Iterable[ECMOrganisationObjectIdLike]]

Mapping Benutzer-/Rollen-ID → [Stellvertreter-IDs]. Schlüssel und Werte können jeweils GUID-Strings, ECMOrganisationObject- oder ECMOrganisationObjectRef-Instanzen sein. Eine leere Liste löscht alle Stellvertreter für diesen Eintrag.

3. Rückgabewert

Keiner. Wirft eine Ausnahme, wenn der Server-Job einen Fehlercode zurückliefert.

4. Beispiele

4.1. Stellvertreter für einen Benutzer setzen

  • Sync

  • Async

org = ecm.workflow.active_organisation()
ecm.workflow.set_substitutes(
    org,
    {"265EF9703E9F430589884976339F0B42": ["46E29564BC464929A0A2ECA5387B4855"]},
)
org = await ecm.workflow.active_organisation()
await ecm.workflow.set_substitutes(
    org,
    {"265EF9703E9F430589884976339F0B42": ["46E29564BC464929A0A2ECA5387B4855"]},
)

4.2. Mehrere Stellvertreter mit Objekt-Instanzen

  • Sync

  • Async

from ecmind_blue_client.ecm import ECMOrganisationObjectRequestType

org = ecm.workflow.active_organisation()
users = {o.name: o for o in ecm.workflow.organisation_objects(org)}

ecm.workflow.set_substitutes(
    org,
    {users["Root"]: [users["USER_WITH_RIGHTS"], users["USER_WITHOUT_RIGHTS"]]},
)
org = await ecm.workflow.active_organisation()
users = {o.name: o for o in await ecm.workflow.organisation_objects(org)}

await ecm.workflow.set_substitutes(
    org,
    {users["Root"]: [users["USER_WITH_RIGHTS"], users["USER_WITHOUT_RIGHTS"]]},
)

4.3. Stellvertreter löschen

Übergib eine leere Liste, um alle Stellvertreter für einen Benutzer/eine Rolle zu entfernen:

  • Sync

  • Async

org = ecm.workflow.active_organisation()
ecm.workflow.set_substitutes(org, {"265EF9703E9F430589884976339F0B42": []})
org = await ecm.workflow.active_organisation()
await ecm.workflow.set_substitutes(org, {"265EF9703E9F430589884976339F0B42": []})

5. Hinweise

  • Pro Aufruf können beliebig viele Benutzer/Rollen aktualisiert werden.

  • Die Stellvertreterliste wird vollständig ersetzt (keine Delta-Operation).

  • Die Änderung ist anschließend über das Stellvertreter-Attribut bei organisation_objects() sichtbar (kommaseparierte GUID-Liste).

6. Siehe auch