start_process()
Creates a workflow process instance and starts it in one call. Internally runs
wfm.CreateProcessInstance (returning the ProcessId) followed by wfm.StartProcess.
Returns the ID of the new process.
1. Signature
-
Sync
-
Async
ecm.workflow.start_process(
user: ECMOrganisationObjectIdLike,
workflow: str | ECMWorkflow,
client_type: str | ECMClientType,
organisation: str | ECMOrganisation | None = None,
*,
variables: Mapping[str, str | RawWorkflowVariable] | None = None,
documents: Iterable[ECMWorkspaceDocument] | None = None,
) -> str
await ecm.workflow.start_process(
user: ECMOrganisationObjectIdLike,
workflow: str | ECMWorkflow,
client_type: str | ECMClientType,
organisation: str | ECMOrganisation | None = None,
*,
variables: Mapping[str, str | RawWorkflowVariable] | None = None,
documents: Iterable[ECMWorkspaceDocument] | None = None,
) -> str
2. Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
|
|
— |
The workflow-organisation user — not the security user GUID. Look it up via |
|
|
— |
The workflow to start: an |
|
|
— |
Client type as an |
|
|
|
Defaults to the active organisation when |
|
|
|
Workflow input variables — either a mapping (string values as |
|
|
|
Documents to place into the workflow file’s workspace. |
2.1. ECMWorkspaceDocument
-
id(int) — document ID -
type(int) — object type ID of the document -
location(int, default1) —1= SDREL,2= system archive -
moveable(bool, defaultTrue) — may move between info area and workspace -
deleteable(bool, defaultFalse) — may delete from the file -
in_workspace(bool, defaultTrue) —True= in workspace (workflow default),False= in info area
4. Errors
-
ECMMissingArgumentException— no client type given -
ECMNotFoundException— a workflow or client-type name does not exist -
ECMWrongStateException— a workflow or client-type name is ambiguous
5. Examples
5.1. Shortest path: by model name, active organisation
process_id = ecm.workflow.start_process(
user=user,
workflow="test", # workflow model name
client_type="#OSECM_Client#", # client-type name
)
print(process_id)
5.2. With input variables and a document
from ecmind_blue_client.ecm import ECMWorkspaceDocument, RawWorkflowVariable
process_id = ecm.workflow.start_process(
user=user,
workflow="test",
client_type="#OSECM_Client#",
variables={
"StringVar": "Hello",
# scalars (incl. numbers/dates/times) go in as <String> — the server converts
"IntegerVar": RawWorkflowVariable("<WFVar><String>42</String></WFVar>"),
},
documents=[ECMWorkspaceDocument(id=4711, type=131073)],
)
6. Variable value formats
Formats verified against the enaio® server, for RawWorkflowVariable:
-
Scalars (string, integer, float, date, time) are sent as
<WFVar><String>VALUE</String></WFVar>— the server converts them. Typed tags such as<Integer>are rejected. -
Datetime expects a Unix epoch timestamp inside the
<String>. -
Lists are not wrapped in
<WFVar>:<List><ListItem Id="GUID" Selection="0"><STRING>VALUE</STRING></ListItem></List>(upper-case<STRING>member tag). -
Records use
<Record><Member Name="…">…</Member></Record>and must set every member the record type declares.
7. Notes on the server response
-
ClientTypeIdmust be exactly one GUID on the server. An empty value is rejected withGUID 'ClientTypeId' is not set, and a multi-GUID list as an invalid GUID — there is no "all clients" value (verified empirically against the enaio® test server). -
wfm.StartProcessalways places supplied documents into the workflow file’s workspace.
8. See also
-
client_types() — list client types
-
workflow_list() — list startable workflows
-
workflow_by_name() — resolve a workflow by model name
-
workflow_model_by_name() — typed variable models