m8flow-core 1.0.0b1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- m8flow_core/__init__.py +10 -0
- m8flow_core/api.py +234 -0
- m8flow_core/application/__init__.py +65 -0
- m8flow_core/application/commands.py +149 -0
- m8flow_core/application/dispatcher.py +274 -0
- m8flow_core/application/queries.py +50 -0
- m8flow_core/db.py +42 -0
- m8flow_core/errors.py +51 -0
- m8flow_core/models/__init__.py +86 -0
- m8flow_core/models/base.py +40 -0
- m8flow_core/models/bpmn_process.py +49 -0
- m8flow_core/models/bpmn_process_definition.py +105 -0
- m8flow_core/models/future_task.py +44 -0
- m8flow_core/models/group.py +41 -0
- m8flow_core/models/json_data.py +87 -0
- m8flow_core/models/permission_assignment.py +67 -0
- m8flow_core/models/permission_target.py +79 -0
- m8flow_core/models/principal.py +49 -0
- m8flow_core/models/process_instance.py +164 -0
- m8flow_core/models/process_instance_event.py +145 -0
- m8flow_core/models/process_instance_metadata.py +40 -0
- m8flow_core/models/process_model_bpmn_version.py +31 -0
- m8flow_core/models/scheduler_job.py +87 -0
- m8flow_core/models/task.py +85 -0
- m8flow_core/models/task_definition.py +46 -0
- m8flow_core/models/task_types.py +6 -0
- m8flow_core/models/tenant.py +45 -0
- m8flow_core/models/tenant_scoped.py +16 -0
- m8flow_core/models/user.py +49 -0
- m8flow_core/models/user_group_assignment.py +40 -0
- m8flow_core/models/work_item.py +122 -0
- m8flow_core/models/work_item_user.py +66 -0
- m8flow_core/services/__init__.py +81 -0
- m8flow_core/services/authorization.py +888 -0
- m8flow_core/services/connector_proxy_service_tasks.py +383 -0
- m8flow_core/services/lane_assignment.py +499 -0
- m8flow_core/services/process_definitions.py +278 -0
- m8flow_core/services/process_instances.py +704 -0
- m8flow_core/services/scheduler_jobs.py +142 -0
- m8flow_core/services/scheduler_runtime.py +502 -0
- m8flow_core/services/service_tasks.py +333 -0
- m8flow_core/services/tasks.py +308 -0
- m8flow_core/services/tenant_users.py +89 -0
- m8flow_core/services/work_items.py +104 -0
- m8flow_core/services/workflow_runtime.py +2465 -0
- m8flow_core/settings.py +19 -0
- m8flow_core/utils/__init__.py +2 -0
- m8flow_core/utils/keycloak/__init__.py +24 -0
- m8flow_core/utils/keycloak/config.py +53 -0
- m8flow_core/utils/keycloak/service.py +882 -0
- m8flow_core-1.0.0b1.dist-info/METADATA +200 -0
- m8flow_core-1.0.0b1.dist-info/RECORD +55 -0
- m8flow_core-1.0.0b1.dist-info/WHEEL +4 -0
- m8flow_core-1.0.0b1.dist-info/licenses/LICENSE +201 -0
- m8flow_core-1.0.0b1.dist-info/licenses/NOTICE +48 -0
m8flow_core/__init__.py
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from importlib.metadata import PackageNotFoundError, version
|
|
4
|
+
|
|
5
|
+
try:
|
|
6
|
+
__version__ = version("m8flow-core")
|
|
7
|
+
except PackageNotFoundError: # pragma: no cover - package not installed yet.
|
|
8
|
+
__version__ = "1.0.0"
|
|
9
|
+
|
|
10
|
+
__all__ = ["__version__"]
|
m8flow_core/api.py
ADDED
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
"""Public library API for the platform/app layer.
|
|
2
|
+
|
|
3
|
+
This package is intended to be imported directly, not exposed over HTTP.
|
|
4
|
+
|
|
5
|
+
Stability: every name re-exported here is part of the public contract.
|
|
6
|
+
See ``docs/reference/api.md`` for the full reference, including per-command input
|
|
7
|
+
fields, return types, and the error classes each operation may raise.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from __future__ import annotations
|
|
11
|
+
|
|
12
|
+
from datetime import datetime
|
|
13
|
+
|
|
14
|
+
from sqlalchemy.engine import Connection
|
|
15
|
+
from sqlalchemy.orm import Session
|
|
16
|
+
|
|
17
|
+
from m8flow_core.application import (
|
|
18
|
+
ClaimTaskCommand,
|
|
19
|
+
CompleteTaskCommand,
|
|
20
|
+
CreateProcessInstanceCommand,
|
|
21
|
+
ErrorProcessInstanceCommand,
|
|
22
|
+
GetPendingTasksQuery,
|
|
23
|
+
GetProcessInstanceEventsQuery,
|
|
24
|
+
GetProcessInstanceMetadataQuery,
|
|
25
|
+
GetProcessInstanceQuery,
|
|
26
|
+
ImportBpmnProcessDefinitionCommand,
|
|
27
|
+
InitializeProcessInstanceFromDefinitionCommand,
|
|
28
|
+
InitializeProcessInstanceWorkflowCommand,
|
|
29
|
+
ListErrorProcessInstancesQuery,
|
|
30
|
+
ListProcessInstancesQuery,
|
|
31
|
+
ListSuspendedProcessInstancesQuery,
|
|
32
|
+
ListTerminatedProcessInstancesQuery,
|
|
33
|
+
RecordProcessInstanceEventCommand,
|
|
34
|
+
ResumeProcessInstanceCommand,
|
|
35
|
+
RetryProcessInstanceCommand,
|
|
36
|
+
ScheduleProcessInstanceRetryCommand,
|
|
37
|
+
SuspendProcessInstanceCommand,
|
|
38
|
+
TerminateProcessInstanceCommand,
|
|
39
|
+
UpsertProcessInstanceMetadataCommand,
|
|
40
|
+
execute_command,
|
|
41
|
+
execute_query,
|
|
42
|
+
)
|
|
43
|
+
from m8flow_core.application.dispatcher import _session_scope
|
|
44
|
+
from m8flow_core.errors import (
|
|
45
|
+
AuthorizationError,
|
|
46
|
+
BpmnCoreError,
|
|
47
|
+
InvalidStateError,
|
|
48
|
+
NotFoundError,
|
|
49
|
+
ServiceTaskExecutionError,
|
|
50
|
+
ValidationError,
|
|
51
|
+
)
|
|
52
|
+
from m8flow_core.models.process_instance import ProcessInstanceStatus
|
|
53
|
+
from m8flow_core.models.process_instance_event import (
|
|
54
|
+
ProcessInstanceEventCategory,
|
|
55
|
+
ProcessLifecycleEventType,
|
|
56
|
+
TaskEventType,
|
|
57
|
+
)
|
|
58
|
+
from m8flow_core.services.authorization import (
|
|
59
|
+
PROCESS_DEFINITION_IMPORT_COMMAND,
|
|
60
|
+
PROCESS_RESUME_COMMAND,
|
|
61
|
+
PROCESS_RETRY_COMMAND,
|
|
62
|
+
PROCESS_START_COMMAND,
|
|
63
|
+
PROCESS_SUSPEND_COMMAND,
|
|
64
|
+
PROCESS_TERMINATE_COMMAND,
|
|
65
|
+
TASK_CLAIM_COMMAND,
|
|
66
|
+
TASK_COMPLETE_COMMAND,
|
|
67
|
+
AuthorizationDecision,
|
|
68
|
+
AuthorizationPolicy,
|
|
69
|
+
AuthorizationPolicyFactory,
|
|
70
|
+
AuthorizationRequest,
|
|
71
|
+
DatabaseAuthorizationPolicy,
|
|
72
|
+
authorization_policy_scope,
|
|
73
|
+
set_default_authorization_policy_factory,
|
|
74
|
+
)
|
|
75
|
+
from m8flow_core.services.connector_proxy_service_tasks import (
|
|
76
|
+
ConnectorProxyServiceTaskConnector,
|
|
77
|
+
build_connector_proxy_service_task_connectors,
|
|
78
|
+
build_connector_proxy_service_task_registry,
|
|
79
|
+
fetch_connector_proxy_command_definitions,
|
|
80
|
+
)
|
|
81
|
+
from m8flow_core.services.lane_assignment import resolve_lane_assignment_id
|
|
82
|
+
from m8flow_core.services.process_instances import (
|
|
83
|
+
create_process_instance,
|
|
84
|
+
error_process_instance,
|
|
85
|
+
get_process_instance,
|
|
86
|
+
get_process_instance_events,
|
|
87
|
+
get_process_instance_metadata,
|
|
88
|
+
list_error_process_instances,
|
|
89
|
+
list_process_instances,
|
|
90
|
+
list_suspended_process_instances,
|
|
91
|
+
list_terminated_process_instances,
|
|
92
|
+
record_process_instance_event,
|
|
93
|
+
resume_process_instance,
|
|
94
|
+
retry_process_instance,
|
|
95
|
+
schedule_process_instance_retry,
|
|
96
|
+
suspend_process_instance,
|
|
97
|
+
terminate_process_instance,
|
|
98
|
+
upsert_process_instance_metadata,
|
|
99
|
+
)
|
|
100
|
+
from m8flow_core.services.scheduler_runtime import (
|
|
101
|
+
run_due_scheduler_jobs as _run_due_scheduler_jobs,
|
|
102
|
+
)
|
|
103
|
+
from m8flow_core.services.service_tasks import (
|
|
104
|
+
ServiceTaskCommandDefinition,
|
|
105
|
+
ServiceTaskConnector,
|
|
106
|
+
ServiceTaskContext,
|
|
107
|
+
ServiceTaskParameterDefinition,
|
|
108
|
+
ServiceTaskRegistry,
|
|
109
|
+
ServiceTaskRegistryFactory,
|
|
110
|
+
ServiceTaskRequest,
|
|
111
|
+
ServiceTaskResult,
|
|
112
|
+
build_service_task_operation_id,
|
|
113
|
+
service_task_registry_scope,
|
|
114
|
+
set_default_service_task_registry_factory,
|
|
115
|
+
split_service_task_operation_id,
|
|
116
|
+
)
|
|
117
|
+
from m8flow_core.services.tasks import (
|
|
118
|
+
assign_pending_tasks_for_user,
|
|
119
|
+
claim_task,
|
|
120
|
+
complete_task,
|
|
121
|
+
get_pending_tasks,
|
|
122
|
+
)
|
|
123
|
+
from m8flow_core.services.workflow_runtime import (
|
|
124
|
+
advance_process_instance_workflow,
|
|
125
|
+
)
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
def run_due_scheduler_jobs(
|
|
129
|
+
session_or_connection: Session | Connection,
|
|
130
|
+
*,
|
|
131
|
+
now: datetime | None = None,
|
|
132
|
+
limit: int = 100,
|
|
133
|
+
worker_id: str = "inline",
|
|
134
|
+
tenant_id: str | None = None,
|
|
135
|
+
) -> int:
|
|
136
|
+
with _session_scope(session_or_connection) as session:
|
|
137
|
+
return _run_due_scheduler_jobs(
|
|
138
|
+
session,
|
|
139
|
+
now=now,
|
|
140
|
+
limit=limit,
|
|
141
|
+
worker_id=worker_id,
|
|
142
|
+
tenant_id=tenant_id,
|
|
143
|
+
)
|
|
144
|
+
|
|
145
|
+
__all__ = [
|
|
146
|
+
"AuthorizationError",
|
|
147
|
+
"AuthorizationDecision",
|
|
148
|
+
"AuthorizationPolicy",
|
|
149
|
+
"AuthorizationPolicyFactory",
|
|
150
|
+
"AuthorizationRequest",
|
|
151
|
+
"BpmnCoreError",
|
|
152
|
+
"ClaimTaskCommand",
|
|
153
|
+
"CompleteTaskCommand",
|
|
154
|
+
"ConnectorProxyServiceTaskConnector",
|
|
155
|
+
"CreateProcessInstanceCommand",
|
|
156
|
+
"DatabaseAuthorizationPolicy",
|
|
157
|
+
"ErrorProcessInstanceCommand",
|
|
158
|
+
"GetPendingTasksQuery",
|
|
159
|
+
"GetProcessInstanceEventsQuery",
|
|
160
|
+
"GetProcessInstanceMetadataQuery",
|
|
161
|
+
"GetProcessInstanceQuery",
|
|
162
|
+
"ImportBpmnProcessDefinitionCommand",
|
|
163
|
+
"InitializeProcessInstanceFromDefinitionCommand",
|
|
164
|
+
"InitializeProcessInstanceWorkflowCommand",
|
|
165
|
+
"InvalidStateError",
|
|
166
|
+
"ListErrorProcessInstancesQuery",
|
|
167
|
+
"ListProcessInstancesQuery",
|
|
168
|
+
"ListSuspendedProcessInstancesQuery",
|
|
169
|
+
"ListTerminatedProcessInstancesQuery",
|
|
170
|
+
"NotFoundError",
|
|
171
|
+
"PROCESS_DEFINITION_IMPORT_COMMAND",
|
|
172
|
+
"PROCESS_RESUME_COMMAND",
|
|
173
|
+
"PROCESS_RETRY_COMMAND",
|
|
174
|
+
"PROCESS_START_COMMAND",
|
|
175
|
+
"PROCESS_SUSPEND_COMMAND",
|
|
176
|
+
"PROCESS_TERMINATE_COMMAND",
|
|
177
|
+
"ProcessInstanceEventCategory",
|
|
178
|
+
"ProcessLifecycleEventType",
|
|
179
|
+
"ProcessInstanceStatus",
|
|
180
|
+
"RecordProcessInstanceEventCommand",
|
|
181
|
+
"ResumeProcessInstanceCommand",
|
|
182
|
+
"RetryProcessInstanceCommand",
|
|
183
|
+
"ScheduleProcessInstanceRetryCommand",
|
|
184
|
+
"ServiceTaskCommandDefinition",
|
|
185
|
+
"ServiceTaskConnector",
|
|
186
|
+
"ServiceTaskContext",
|
|
187
|
+
"ServiceTaskExecutionError",
|
|
188
|
+
"ServiceTaskParameterDefinition",
|
|
189
|
+
"ServiceTaskRegistry",
|
|
190
|
+
"ServiceTaskRegistryFactory",
|
|
191
|
+
"ServiceTaskRequest",
|
|
192
|
+
"ServiceTaskResult",
|
|
193
|
+
"SuspendProcessInstanceCommand",
|
|
194
|
+
"TASK_CLAIM_COMMAND",
|
|
195
|
+
"TASK_COMPLETE_COMMAND",
|
|
196
|
+
"TaskEventType",
|
|
197
|
+
"TerminateProcessInstanceCommand",
|
|
198
|
+
"UpsertProcessInstanceMetadataCommand",
|
|
199
|
+
"ValidationError",
|
|
200
|
+
"advance_process_instance_workflow",
|
|
201
|
+
"assign_pending_tasks_for_user",
|
|
202
|
+
"authorization_policy_scope",
|
|
203
|
+
"build_connector_proxy_service_task_connectors",
|
|
204
|
+
"build_connector_proxy_service_task_registry",
|
|
205
|
+
"build_service_task_operation_id",
|
|
206
|
+
"claim_task",
|
|
207
|
+
"complete_task",
|
|
208
|
+
"create_process_instance",
|
|
209
|
+
"error_process_instance",
|
|
210
|
+
"execute_command",
|
|
211
|
+
"execute_query",
|
|
212
|
+
"fetch_connector_proxy_command_definitions",
|
|
213
|
+
"get_pending_tasks",
|
|
214
|
+
"get_process_instance",
|
|
215
|
+
"get_process_instance_events",
|
|
216
|
+
"get_process_instance_metadata",
|
|
217
|
+
"list_error_process_instances",
|
|
218
|
+
"list_process_instances",
|
|
219
|
+
"list_suspended_process_instances",
|
|
220
|
+
"list_terminated_process_instances",
|
|
221
|
+
"record_process_instance_event",
|
|
222
|
+
"resolve_lane_assignment_id",
|
|
223
|
+
"run_due_scheduler_jobs",
|
|
224
|
+
"resume_process_instance",
|
|
225
|
+
"retry_process_instance",
|
|
226
|
+
"schedule_process_instance_retry",
|
|
227
|
+
"service_task_registry_scope",
|
|
228
|
+
"set_default_authorization_policy_factory",
|
|
229
|
+
"set_default_service_task_registry_factory",
|
|
230
|
+
"split_service_task_operation_id",
|
|
231
|
+
"suspend_process_instance",
|
|
232
|
+
"terminate_process_instance",
|
|
233
|
+
"upsert_process_instance_metadata",
|
|
234
|
+
]
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from importlib import import_module
|
|
4
|
+
from typing import Any
|
|
5
|
+
|
|
6
|
+
from m8flow_core.application.commands import (
|
|
7
|
+
ClaimTaskCommand,
|
|
8
|
+
CompleteTaskCommand,
|
|
9
|
+
CreateProcessInstanceCommand,
|
|
10
|
+
ErrorProcessInstanceCommand,
|
|
11
|
+
ImportBpmnProcessDefinitionCommand,
|
|
12
|
+
InitializeProcessInstanceFromDefinitionCommand,
|
|
13
|
+
InitializeProcessInstanceWorkflowCommand,
|
|
14
|
+
RecordProcessInstanceEventCommand,
|
|
15
|
+
ResumeProcessInstanceCommand,
|
|
16
|
+
RetryProcessInstanceCommand,
|
|
17
|
+
ScheduleProcessInstanceRetryCommand,
|
|
18
|
+
SuspendProcessInstanceCommand,
|
|
19
|
+
TerminateProcessInstanceCommand,
|
|
20
|
+
UpsertProcessInstanceMetadataCommand,
|
|
21
|
+
)
|
|
22
|
+
from m8flow_core.application.queries import (
|
|
23
|
+
GetPendingTasksQuery,
|
|
24
|
+
GetProcessInstanceEventsQuery,
|
|
25
|
+
GetProcessInstanceMetadataQuery,
|
|
26
|
+
GetProcessInstanceQuery,
|
|
27
|
+
ListErrorProcessInstancesQuery,
|
|
28
|
+
ListProcessInstancesQuery,
|
|
29
|
+
ListSuspendedProcessInstancesQuery,
|
|
30
|
+
ListTerminatedProcessInstancesQuery,
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def __getattr__(name: str) -> Any:
|
|
35
|
+
if name in {"execute_command", "execute_query"}:
|
|
36
|
+
dispatcher = import_module("m8flow_core.application.dispatcher")
|
|
37
|
+
return getattr(dispatcher, name)
|
|
38
|
+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
|
39
|
+
|
|
40
|
+
__all__ = [
|
|
41
|
+
"ClaimTaskCommand",
|
|
42
|
+
"CompleteTaskCommand",
|
|
43
|
+
"CreateProcessInstanceCommand",
|
|
44
|
+
"ErrorProcessInstanceCommand",
|
|
45
|
+
"GetPendingTasksQuery",
|
|
46
|
+
"GetProcessInstanceEventsQuery",
|
|
47
|
+
"GetProcessInstanceMetadataQuery",
|
|
48
|
+
"GetProcessInstanceQuery",
|
|
49
|
+
"ImportBpmnProcessDefinitionCommand",
|
|
50
|
+
"InitializeProcessInstanceFromDefinitionCommand",
|
|
51
|
+
"InitializeProcessInstanceWorkflowCommand",
|
|
52
|
+
"ListErrorProcessInstancesQuery",
|
|
53
|
+
"ListProcessInstancesQuery",
|
|
54
|
+
"ListSuspendedProcessInstancesQuery",
|
|
55
|
+
"ListTerminatedProcessInstancesQuery",
|
|
56
|
+
"RecordProcessInstanceEventCommand",
|
|
57
|
+
"ResumeProcessInstanceCommand",
|
|
58
|
+
"RetryProcessInstanceCommand",
|
|
59
|
+
"ScheduleProcessInstanceRetryCommand",
|
|
60
|
+
"SuspendProcessInstanceCommand",
|
|
61
|
+
"TerminateProcessInstanceCommand",
|
|
62
|
+
"UpsertProcessInstanceMetadataCommand",
|
|
63
|
+
"execute_command",
|
|
64
|
+
"execute_query",
|
|
65
|
+
]
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
from datetime import datetime
|
|
5
|
+
from typing import Any
|
|
6
|
+
|
|
7
|
+
from m8flow_core.models.process_instance_event import (
|
|
8
|
+
ProcessLifecycleEventType,
|
|
9
|
+
TaskEventType,
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@dataclass(frozen=True, slots=True)
|
|
14
|
+
class ClaimTaskCommand:
|
|
15
|
+
tenant_id: str
|
|
16
|
+
work_item_id: int
|
|
17
|
+
user_id: int
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
@dataclass(frozen=True, slots=True)
|
|
21
|
+
class CompleteTaskCommand:
|
|
22
|
+
tenant_id: str
|
|
23
|
+
work_item_id: int
|
|
24
|
+
user_id: int
|
|
25
|
+
completed_at: datetime | None = None
|
|
26
|
+
task_payload: dict[str, str] | None = None
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
@dataclass(frozen=True, slots=True)
|
|
30
|
+
class RecordProcessInstanceEventCommand:
|
|
31
|
+
tenant_id: str
|
|
32
|
+
process_instance_id: int
|
|
33
|
+
event_type: (
|
|
34
|
+
ProcessLifecycleEventType | TaskEventType | str
|
|
35
|
+
)
|
|
36
|
+
task_guid: str | None = None
|
|
37
|
+
user_id: int | None = None
|
|
38
|
+
occurred_at: datetime | None = None
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
@dataclass(frozen=True, slots=True)
|
|
42
|
+
class CreateProcessInstanceCommand:
|
|
43
|
+
tenant_id: str
|
|
44
|
+
process_model_identifier: str
|
|
45
|
+
process_model_display_name: str
|
|
46
|
+
process_initiator_id: int
|
|
47
|
+
bpmn_process_definition_id: int
|
|
48
|
+
bpmn_process_id: int
|
|
49
|
+
summary: str | None = None
|
|
50
|
+
process_version: int = 1
|
|
51
|
+
created_at: datetime | None = None
|
|
52
|
+
updated_at: datetime | None = None
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
@dataclass(frozen=True, slots=True)
|
|
56
|
+
class ImportBpmnProcessDefinitionCommand:
|
|
57
|
+
tenant_id: str
|
|
58
|
+
bpmn_identifier: str
|
|
59
|
+
user_id: int
|
|
60
|
+
source_bpmn_xml: str | bytes
|
|
61
|
+
source_dmn_xml: str | bytes | None = None
|
|
62
|
+
bpmn_name: str | None = None
|
|
63
|
+
properties_json: dict[str, Any] | None = None
|
|
64
|
+
bpmn_version_control_type: str | None = None
|
|
65
|
+
bpmn_version_control_identifier: str | None = None
|
|
66
|
+
process_xml_digest: str | None = None
|
|
67
|
+
created_at: datetime | None = None
|
|
68
|
+
updated_at: datetime | None = None
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
@dataclass(frozen=True, slots=True)
|
|
72
|
+
class InitializeProcessInstanceFromDefinitionCommand:
|
|
73
|
+
tenant_id: str
|
|
74
|
+
bpmn_process_definition_id: int
|
|
75
|
+
process_initiator_id: int
|
|
76
|
+
submission_metadata: dict[str, str] | None = None
|
|
77
|
+
summary: str | None = None
|
|
78
|
+
process_version: int = 1
|
|
79
|
+
started_at: datetime | None = None
|
|
80
|
+
bpmn_process_id: str | None = None
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
@dataclass(frozen=True, slots=True)
|
|
84
|
+
class InitializeProcessInstanceWorkflowCommand:
|
|
85
|
+
tenant_id: str
|
|
86
|
+
process_instance_id: int
|
|
87
|
+
bpmn_xml: str | bytes
|
|
88
|
+
bpmn_process_id: str | None = None
|
|
89
|
+
started_at: datetime | None = None
|
|
90
|
+
dmn_xml: str | bytes | None = None
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
@dataclass(frozen=True, slots=True)
|
|
94
|
+
class UpsertProcessInstanceMetadataCommand:
|
|
95
|
+
tenant_id: str
|
|
96
|
+
process_instance_id: int
|
|
97
|
+
key: str
|
|
98
|
+
value: str
|
|
99
|
+
updated_at: datetime
|
|
100
|
+
created_at: datetime | None = None
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
@dataclass(frozen=True, slots=True)
|
|
104
|
+
class SuspendProcessInstanceCommand:
|
|
105
|
+
tenant_id: str
|
|
106
|
+
process_instance_id: int
|
|
107
|
+
user_id: int
|
|
108
|
+
suspended_at: datetime | None = None
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
@dataclass(frozen=True, slots=True)
|
|
112
|
+
class ResumeProcessInstanceCommand:
|
|
113
|
+
tenant_id: str
|
|
114
|
+
process_instance_id: int
|
|
115
|
+
user_id: int
|
|
116
|
+
resumed_at: datetime | None = None
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
@dataclass(frozen=True, slots=True)
|
|
120
|
+
class ErrorProcessInstanceCommand:
|
|
121
|
+
tenant_id: str
|
|
122
|
+
process_instance_id: int
|
|
123
|
+
user_id: int | None = None
|
|
124
|
+
errored_at: datetime | None = None
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
@dataclass(frozen=True, slots=True)
|
|
128
|
+
class RetryProcessInstanceCommand:
|
|
129
|
+
tenant_id: str
|
|
130
|
+
process_instance_id: int
|
|
131
|
+
user_id: int
|
|
132
|
+
retried_at: datetime | None = None
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
@dataclass(frozen=True, slots=True)
|
|
136
|
+
class ScheduleProcessInstanceRetryCommand:
|
|
137
|
+
tenant_id: str
|
|
138
|
+
process_instance_id: int
|
|
139
|
+
user_id: int
|
|
140
|
+
retry_at: datetime
|
|
141
|
+
scheduled_at: datetime | None = None
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
@dataclass(frozen=True, slots=True)
|
|
145
|
+
class TerminateProcessInstanceCommand:
|
|
146
|
+
tenant_id: str
|
|
147
|
+
process_instance_id: int
|
|
148
|
+
user_id: int
|
|
149
|
+
terminated_at: datetime | None = None
|