quantumbpm-sdk 1.2.0__tar.gz → 1.3.0__tar.gz

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.
Files changed (120) hide show
  1. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/PKG-INFO +56 -8
  2. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/README.md +55 -7
  3. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/pyproject.toml +1 -1
  4. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/api/bpmn_api.py +81 -16
  5. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/api/default_api.py +90 -25
  6. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/auth.py +6 -6
  7. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/bpmn.py +24 -13
  8. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/client.py +31 -7
  9. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/configuration.py +3 -3
  10. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/dmn.py +22 -7
  11. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/exceptions.py +1 -1
  12. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/__init__.py +2 -1
  13. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/active_scope.py +1 -1
  14. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/batch_evaluate_design_request.py +1 -1
  15. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/batch_evaluation_response.py +1 -1
  16. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/batch_evaluation_response_results_inner.py +1 -1
  17. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/bpmn_external_job_paginated_response.py +1 -1
  18. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/bpmn_incident.py +4 -4
  19. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/bpmn_incident_record.py +6 -8
  20. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/bpmn_incident_record_paginated_response.py +1 -1
  21. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/bpmn_instance.py +4 -2
  22. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/bpmn_instance_children_response.py +1 -1
  23. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/bpmn_instance_paginated_response.py +1 -1
  24. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/bpmn_instance_state.py +19 -4
  25. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/bpmn_process_definition.py +1 -1
  26. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/bpmn_process_summary.py +1 -1
  27. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/bpmn_process_summary_paginated_response.py +1 -1
  28. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/bpmn_process_version.py +1 -1
  29. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/bpmn_process_version_paginated_response.py +1 -1
  30. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/bpmn_resource.py +1 -1
  31. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/bpmn_resource_detail.py +1 -1
  32. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/bpmn_resource_paginated_response.py +1 -1
  33. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/bpmn_resource_summary.py +1 -1
  34. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/bpmn_resource_summary_paginated_response.py +1 -1
  35. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/bpmn_user_task_paginated_response.py +1 -1
  36. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/bpmn_validate_response.py +1 -1
  37. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/bpmn_validation_issue.py +1 -1
  38. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/complete_bpmn_external_job_request.py +2 -2
  39. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/complete_bpmn_external_jobs_batch_request.py +2 -2
  40. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/complete_bpmn_external_jobs_batch_request_items_inner.py +1 -1
  41. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/correlation_keys.py +2 -2
  42. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/create_bpmn_resource_request.py +1 -1
  43. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/create_definition_request.py +1 -1
  44. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/create_project_request.py +1 -1
  45. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/decision_input_field.py +1 -1
  46. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/decision_summary.py +1 -1
  47. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/definition.py +1 -1
  48. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/element_mapping.py +1 -1
  49. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/error.py +4 -4
  50. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/error_mode.py +1 -1
  51. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/evaluate_design_request.py +1 -1
  52. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/evaluate_stored_request.py +2 -2
  53. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/evaluation_result.py +1 -1
  54. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/execution.py +1 -1
  55. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/external_job.py +2 -2
  56. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/external_job_batch_response.py +1 -1
  57. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/external_job_batch_response_results_inner.py +2 -2
  58. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/external_job_queue_depth_item.py +1 -1
  59. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/external_job_queue_depth_response.py +1 -1
  60. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/feel_warning.py +1 -1
  61. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/get_bpmn_instance_variables200_response.py +1 -1
  62. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/get_version200_response.py +1 -1
  63. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/heartbeat_bpmn_external_job_request.py +1 -1
  64. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/hit_rule.py +1 -1
  65. quantumbpm_sdk-1.3.0/quantumbpm/models/join_arrivals.py +92 -0
  66. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/migrate_bpmn_instance_request.py +1 -1
  67. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/migration_validation_result.py +1 -1
  68. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/modification_instruction.py +1 -1
  69. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/modify_bpmn_instance_request.py +1 -1
  70. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/paginated_decisions_response.py +1 -1
  71. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/paginated_definitions_response.py +1 -1
  72. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/paginated_executions_response.py +1 -1
  73. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/pagination_metadata.py +1 -1
  74. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/poll_bpmn_job_request.py +2 -2
  75. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/project.py +1 -1
  76. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/publish_bpmn_message_request.py +1 -1
  77. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/publish_bpmn_signal_request.py +1 -1
  78. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/start_bpmn_instance201_response.py +1 -1
  79. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/start_bpmn_instance_request.py +1 -1
  80. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/start_bpmn_test_instance201_response.py +1 -1
  81. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/start_bpmn_test_instance_request.py +1 -1
  82. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/suspend_bpmn_definition_request.py +1 -1
  83. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/suspend_bpmn_instance_request.py +1 -1
  84. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/suspension_entry.py +4 -3
  85. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/throw_bpmn_external_job_error_request.py +2 -2
  86. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/throw_bpmn_external_job_errors_batch_request.py +2 -2
  87. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/throw_bpmn_external_job_errors_batch_request_items_inner.py +1 -1
  88. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/throw_bpmn_user_task_error_request.py +1 -1
  89. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/trigger_bpmn_ad_hoc_node_request.py +1 -1
  90. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/update_bpmn_instance_variables_request.py +1 -1
  91. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/update_definition_request.py +1 -1
  92. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/update_user_task_assignment_request.py +5 -10
  93. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/user_task.py +1 -1
  94. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/validate_bpmn_resource_request.py +1 -1
  95. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/workers.py +195 -88
  96. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm_sdk.egg-info/PKG-INFO +56 -8
  97. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm_sdk.egg-info/SOURCES.txt +5 -1
  98. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/setup.py +1 -1
  99. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/tests/test_business_id_threading.py +6 -5
  100. quantumbpm_sdk-1.3.0/tests/test_token_refresh.py +116 -0
  101. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/tests/test_workers_job.py +2 -2
  102. quantumbpm_sdk-1.3.0/tests/test_workers_options.py +139 -0
  103. quantumbpm_sdk-1.3.0/tests/test_workers_run.py +231 -0
  104. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/LICENSE +0 -0
  105. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/__init__.py +0 -0
  106. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/api/__init__.py +0 -0
  107. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/api_client.py +0 -0
  108. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/api_response.py +0 -0
  109. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/models/feel_value.py +0 -0
  110. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/py.typed +0 -0
  111. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/rest.py +0 -0
  112. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/tracing.py +0 -0
  113. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm/variables.py +0 -0
  114. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm_sdk.egg-info/dependency_links.txt +0 -0
  115. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm_sdk.egg-info/requires.txt +0 -0
  116. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/quantumbpm_sdk.egg-info/top_level.txt +0 -0
  117. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/setup.cfg +0 -0
  118. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/tests/test_decimal_roundtrip.py +0 -0
  119. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/tests/test_smoke.py +0 -0
  120. {quantumbpm_sdk-1.2.0 → quantumbpm_sdk-1.3.0}/tests/test_workers_clamp.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: quantumbpm-sdk
3
- Version: 1.2.0
3
+ Version: 1.3.0
4
4
  Summary: QuantumBPM Python SDK - DMN evaluation, BPMN orchestration, and external job workers.
5
5
  Home-page: https://quantumbpm.com
6
6
  Author: QuantumBPM
@@ -73,11 +73,11 @@ async def main():
73
73
  asyncio.run(main())
74
74
  ```
75
75
 
76
- The async context manager (`async with`) acquires a fresh bearer token on entry. Skipping the context manager and calling methods directly works too - the SDK refreshes tokens on demand.
76
+ The async context manager (`async with`) fetches a bearer token on entry, so an authentication problem shows up right away. Every API call also asks the token provider for a token first, so calling methods without the context manager works too, and a long-running worker keeps sending a valid token.
77
77
 
78
78
  ## Authentication
79
79
 
80
- The `TokenProvider` Protocol returns a bearer token on each request. Two implementations ship out of the box.
80
+ The SDK awaits `TokenProvider.get_token()` before every API call and sends the result as the bearer token. Two implementations ship out of the box.
81
81
 
82
82
  ### Zitadel service account
83
83
 
@@ -92,7 +92,7 @@ provider = ZitadelTokenProvider(
92
92
  )
93
93
  ```
94
94
 
95
- The provider caches tokens in-memory until shortly before expiry.
95
+ The provider caches the token in memory and fetches a new one once the cached token is within 60 seconds of expiry, so the lookup before each call is cheap.
96
96
 
97
97
  ### Static bearer token
98
98
 
@@ -118,6 +118,8 @@ class MyProvider:
118
118
  provider: TokenProvider = MyProvider()
119
119
  ```
120
120
 
121
+ `get_token` runs before every API call, so cache the token when fetching one is expensive.
122
+
121
123
  ## DMN evaluation
122
124
 
123
125
  The `client.dmn` sub-client offers four async methods.
@@ -262,7 +264,7 @@ async def main():
262
264
  asyncio.run(main())
263
265
  ```
264
266
 
265
- `run(stop)` resolves when the `asyncio.Event` is set, after in-flight handlers settle.
267
+ `run(stop)` resolves once the `asyncio.Event` is set and running handlers have finished, or the shutdown timeout has passed. See [Heartbeats, lost locks, and shutdown](#heartbeats-lost-locks-and-shutdown).
266
268
 
267
269
  ### Concurrency, polling, and locks
268
270
 
@@ -270,14 +272,57 @@ asyncio.run(main())
270
272
  @worker.handler(
271
273
  "send-email",
272
274
  max_jobs=10, # up to 10 in flight per task type
273
- poll_timeout="45s", # long-poll wait
275
+ poll_timeout="5s", # long-poll wait per request, at most 5s
274
276
  lock_duration="2m", # exclusive lock per job
275
277
  )
276
278
  async def handle(job: Job) -> Vars:
277
279
  ...
278
280
  ```
279
281
 
280
- Concurrency is per task type. Different task types run independently. The runtime auto-renews the lock at half the lock-duration interval while the handler runs.
282
+ Concurrency is per task type. Different task types run independently.
283
+
284
+ `poll_timeout` and `lock_duration` take Go duration strings such as `30s`, `1m30s`, `12.5s` or `500ms`. `handler` and `handle` raise `ValueError` for a value that does not parse. One poll request waits at most 5 seconds on the server, and a larger `poll_timeout` is capped to that. When a poll returns no job, the worker polls again right away.
285
+
286
+ The server clamps every lock to between 10 seconds and 5 minutes by default (`BPMN_WORKER_LEASE_MIN` and `BPMN_WORKER_LEASE_MAX`). Each polled job carries `job.raw.lock_expires_at`, the expiry of the lock the server granted. While the handler runs, the runtime heartbeats at half of the granted lock, or at half of `lock_duration` when that is shorter. A `lock_duration` of `11m` gets a 5 minute lock and a heartbeat every 2.5 minutes.
287
+
288
+ ### Heartbeats, lost locks, and shutdown
289
+
290
+ A polled job is locked to this worker. Each heartbeat extends the lock by `lock_duration`, clamped the same way, and the server caps one attempt at 30 minutes by default (`BPMN_JOB_MAX_HOLD`). When the lock runs out, the server charges the job a retry and offers it again, or raises an incident when no retries are left. So abandoning a running job always costs a retry.
291
+
292
+ When a heartbeat answers that this worker no longer holds the job (HTTP 409 or 404), the runtime cancels the handler with `asyncio.CancelledError` and reports nothing. A complete or error report rejected with 409 is discarded by the server and logged as a warning. Let `CancelledError` propagate out of handlers.
293
+
294
+ Setting the `stop` event shuts the worker down gracefully:
295
+
296
+ - No new poll starts. A poll already in flight cannot be cancelled. It returns within 5 seconds, and jobs it returns before the shutdown timeout still run.
297
+ - Running handlers keep heartbeating, and their results are reported.
298
+ - Handlers still running `shutdown_timeout` seconds (default `20.0`) after `stop` is set are cancelled and not reported. Their locks run out on the server. Then `run` returns.
299
+
300
+ Wire `stop` to SIGTERM so a stop signal drains the worker:
301
+
302
+ ```python
303
+ import asyncio
304
+ import signal
305
+ from quantumbpm import QuantumBPM, Vars
306
+ from quantumbpm.workers import Job
307
+
308
+ async def main():
309
+ async with QuantumBPM(...) as client:
310
+ worker = client.new_worker(client_id="billing-svc", shutdown_timeout=20.0)
311
+
312
+ @worker.handler("send-email")
313
+ async def handle(job: Job) -> Vars:
314
+ ...
315
+
316
+ stop = asyncio.Event()
317
+ loop = asyncio.get_running_loop()
318
+ loop.add_signal_handler(signal.SIGTERM, stop.set)
319
+ loop.add_signal_handler(signal.SIGINT, stop.set)
320
+ await worker.run(stop)
321
+
322
+ asyncio.run(main())
323
+ ```
324
+
325
+ On Kubernetes, set `terminationGracePeriodSeconds` above the shutdown timeout, or the pod is killed mid-drain. A poll in flight at stop can also hold process exit for up to 5 seconds, so leave room for that too.
281
326
 
282
327
  ### Throwing typed BPMN errors
283
328
 
@@ -293,7 +338,7 @@ async def handle(job: Job) -> Vars:
293
338
  raise BpmnError("INSUFFICIENT_FUNDS", Vars().set("availableBalance", 12.0))
294
339
  ```
295
340
 
296
- Any other exception is reported as `WORKER_ERROR`, which the server treats as a retryable failure that decrements the job's retry budget.
341
+ Any other exception is reported as `WORKER_ERROR`, which the server treats as a retryable failure that decrements the job's retry budget. The exception message goes into the `error` variable, cut to `max_error_message_bytes` bytes of UTF-8 (a `new_worker` option, default 2048).
297
342
 
298
343
  ### Typed handlers (Pydantic)
299
344
 
@@ -348,10 +393,13 @@ The `client.raw` property exposes the underlying generated `ApiClient` for endpo
348
393
  ```python
349
394
  from quantumbpm.api.bpmn_api import BpmnApi
350
395
 
396
+ await client.authenticate()
351
397
  api = BpmnApi(client.raw)
352
398
  result = api.migrate_bpmn_instance(client.project_id, workflow_id, body)
353
399
  ```
354
400
 
401
+ Calls through `client.raw` send the token of the last SDK call. `await client.authenticate()` puts a current token on it first.
402
+
355
403
  ## License
356
404
 
357
405
  MIT License - see [LICENSE](LICENSE) for details.
@@ -49,11 +49,11 @@ async def main():
49
49
  asyncio.run(main())
50
50
  ```
51
51
 
52
- The async context manager (`async with`) acquires a fresh bearer token on entry. Skipping the context manager and calling methods directly works too - the SDK refreshes tokens on demand.
52
+ The async context manager (`async with`) fetches a bearer token on entry, so an authentication problem shows up right away. Every API call also asks the token provider for a token first, so calling methods without the context manager works too, and a long-running worker keeps sending a valid token.
53
53
 
54
54
  ## Authentication
55
55
 
56
- The `TokenProvider` Protocol returns a bearer token on each request. Two implementations ship out of the box.
56
+ The SDK awaits `TokenProvider.get_token()` before every API call and sends the result as the bearer token. Two implementations ship out of the box.
57
57
 
58
58
  ### Zitadel service account
59
59
 
@@ -68,7 +68,7 @@ provider = ZitadelTokenProvider(
68
68
  )
69
69
  ```
70
70
 
71
- The provider caches tokens in-memory until shortly before expiry.
71
+ The provider caches the token in memory and fetches a new one once the cached token is within 60 seconds of expiry, so the lookup before each call is cheap.
72
72
 
73
73
  ### Static bearer token
74
74
 
@@ -94,6 +94,8 @@ class MyProvider:
94
94
  provider: TokenProvider = MyProvider()
95
95
  ```
96
96
 
97
+ `get_token` runs before every API call, so cache the token when fetching one is expensive.
98
+
97
99
  ## DMN evaluation
98
100
 
99
101
  The `client.dmn` sub-client offers four async methods.
@@ -238,7 +240,7 @@ async def main():
238
240
  asyncio.run(main())
239
241
  ```
240
242
 
241
- `run(stop)` resolves when the `asyncio.Event` is set, after in-flight handlers settle.
243
+ `run(stop)` resolves once the `asyncio.Event` is set and running handlers have finished, or the shutdown timeout has passed. See [Heartbeats, lost locks, and shutdown](#heartbeats-lost-locks-and-shutdown).
242
244
 
243
245
  ### Concurrency, polling, and locks
244
246
 
@@ -246,14 +248,57 @@ asyncio.run(main())
246
248
  @worker.handler(
247
249
  "send-email",
248
250
  max_jobs=10, # up to 10 in flight per task type
249
- poll_timeout="45s", # long-poll wait
251
+ poll_timeout="5s", # long-poll wait per request, at most 5s
250
252
  lock_duration="2m", # exclusive lock per job
251
253
  )
252
254
  async def handle(job: Job) -> Vars:
253
255
  ...
254
256
  ```
255
257
 
256
- Concurrency is per task type. Different task types run independently. The runtime auto-renews the lock at half the lock-duration interval while the handler runs.
258
+ Concurrency is per task type. Different task types run independently.
259
+
260
+ `poll_timeout` and `lock_duration` take Go duration strings such as `30s`, `1m30s`, `12.5s` or `500ms`. `handler` and `handle` raise `ValueError` for a value that does not parse. One poll request waits at most 5 seconds on the server, and a larger `poll_timeout` is capped to that. When a poll returns no job, the worker polls again right away.
261
+
262
+ The server clamps every lock to between 10 seconds and 5 minutes by default (`BPMN_WORKER_LEASE_MIN` and `BPMN_WORKER_LEASE_MAX`). Each polled job carries `job.raw.lock_expires_at`, the expiry of the lock the server granted. While the handler runs, the runtime heartbeats at half of the granted lock, or at half of `lock_duration` when that is shorter. A `lock_duration` of `11m` gets a 5 minute lock and a heartbeat every 2.5 minutes.
263
+
264
+ ### Heartbeats, lost locks, and shutdown
265
+
266
+ A polled job is locked to this worker. Each heartbeat extends the lock by `lock_duration`, clamped the same way, and the server caps one attempt at 30 minutes by default (`BPMN_JOB_MAX_HOLD`). When the lock runs out, the server charges the job a retry and offers it again, or raises an incident when no retries are left. So abandoning a running job always costs a retry.
267
+
268
+ When a heartbeat answers that this worker no longer holds the job (HTTP 409 or 404), the runtime cancels the handler with `asyncio.CancelledError` and reports nothing. A complete or error report rejected with 409 is discarded by the server and logged as a warning. Let `CancelledError` propagate out of handlers.
269
+
270
+ Setting the `stop` event shuts the worker down gracefully:
271
+
272
+ - No new poll starts. A poll already in flight cannot be cancelled. It returns within 5 seconds, and jobs it returns before the shutdown timeout still run.
273
+ - Running handlers keep heartbeating, and their results are reported.
274
+ - Handlers still running `shutdown_timeout` seconds (default `20.0`) after `stop` is set are cancelled and not reported. Their locks run out on the server. Then `run` returns.
275
+
276
+ Wire `stop` to SIGTERM so a stop signal drains the worker:
277
+
278
+ ```python
279
+ import asyncio
280
+ import signal
281
+ from quantumbpm import QuantumBPM, Vars
282
+ from quantumbpm.workers import Job
283
+
284
+ async def main():
285
+ async with QuantumBPM(...) as client:
286
+ worker = client.new_worker(client_id="billing-svc", shutdown_timeout=20.0)
287
+
288
+ @worker.handler("send-email")
289
+ async def handle(job: Job) -> Vars:
290
+ ...
291
+
292
+ stop = asyncio.Event()
293
+ loop = asyncio.get_running_loop()
294
+ loop.add_signal_handler(signal.SIGTERM, stop.set)
295
+ loop.add_signal_handler(signal.SIGINT, stop.set)
296
+ await worker.run(stop)
297
+
298
+ asyncio.run(main())
299
+ ```
300
+
301
+ On Kubernetes, set `terminationGracePeriodSeconds` above the shutdown timeout, or the pod is killed mid-drain. A poll in flight at stop can also hold process exit for up to 5 seconds, so leave room for that too.
257
302
 
258
303
  ### Throwing typed BPMN errors
259
304
 
@@ -269,7 +314,7 @@ async def handle(job: Job) -> Vars:
269
314
  raise BpmnError("INSUFFICIENT_FUNDS", Vars().set("availableBalance", 12.0))
270
315
  ```
271
316
 
272
- Any other exception is reported as `WORKER_ERROR`, which the server treats as a retryable failure that decrements the job's retry budget.
317
+ Any other exception is reported as `WORKER_ERROR`, which the server treats as a retryable failure that decrements the job's retry budget. The exception message goes into the `error` variable, cut to `max_error_message_bytes` bytes of UTF-8 (a `new_worker` option, default 2048).
273
318
 
274
319
  ### Typed handlers (Pydantic)
275
320
 
@@ -324,10 +369,13 @@ The `client.raw` property exposes the underlying generated `ApiClient` for endpo
324
369
  ```python
325
370
  from quantumbpm.api.bpmn_api import BpmnApi
326
371
 
372
+ await client.authenticate()
327
373
  api = BpmnApi(client.raw)
328
374
  result = api.migrate_bpmn_instance(client.project_id, workflow_id, body)
329
375
  ```
330
376
 
377
+ Calls through `client.raw` send the token of the last SDK call. `await client.authenticate()` puts a current token on it first.
378
+
331
379
  ## License
332
380
 
333
381
  MIT License - see [LICENSE](LICENSE) for details.
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "quantumbpm-sdk"
3
- version = "1.2.0"
3
+ version = "1.3.0"
4
4
  description = "QuantumBPM Python SDK - DMN evaluation, BPMN orchestration, and external job workers."
5
5
  authors = [
6
6
  {name = "QuantumBPM",email = "support@quantumbpm.com"},
@@ -3,7 +3,7 @@
3
3
 
4
4
  Public API for the QuantumBPM application. SDKs are generated from this spec.
5
5
 
6
- The version of the OpenAPI document: 1.7.0
6
+ The version of the OpenAPI document: 1.8.0
7
7
  Generated by OpenAPI Generator (https://openapi-generator.tech)
8
8
 
9
9
  Do not edit the class manually.
@@ -423,6 +423,7 @@ class BpmnApi:
423
423
  '200': None,
424
424
  '403': None,
425
425
  '404': None,
426
+ '409': "Error",
426
427
  }
427
428
  response_data = self.api_client.call_api(
428
429
  *_param,
@@ -500,6 +501,7 @@ class BpmnApi:
500
501
  '200': None,
501
502
  '403': None,
502
503
  '404': None,
504
+ '409': "Error",
503
505
  }
504
506
  response_data = self.api_client.call_api(
505
507
  *_param,
@@ -577,6 +579,7 @@ class BpmnApi:
577
579
  '200': None,
578
580
  '403': None,
579
581
  '404': None,
582
+ '409': "Error",
580
583
  }
581
584
  response_data = self.api_client.call_api(
582
585
  *_param,
@@ -623,6 +626,13 @@ class BpmnApi:
623
626
  _body_params = get_bpmn_instance_variables200_response
624
627
 
625
628
 
629
+ # set the HTTP header `Accept`
630
+ if 'Accept' not in _header_params:
631
+ _header_params['Accept'] = self.api_client.select_header_accept(
632
+ [
633
+ 'application/json'
634
+ ]
635
+ )
626
636
 
627
637
  # set the HTTP header `Content-Type`
628
638
  if _content_type:
@@ -1280,6 +1290,7 @@ class BpmnApi:
1280
1290
  '204': None,
1281
1291
  '400': "Error",
1282
1292
  '401': "Error",
1293
+ '404': "Error",
1283
1294
  '500': "Error",
1284
1295
  }
1285
1296
  response_data = self.api_client.call_api(
@@ -1354,6 +1365,7 @@ class BpmnApi:
1354
1365
  '204': None,
1355
1366
  '400': "Error",
1356
1367
  '401': "Error",
1368
+ '404': "Error",
1357
1369
  '500': "Error",
1358
1370
  }
1359
1371
  response_data = self.api_client.call_api(
@@ -1428,6 +1440,7 @@ class BpmnApi:
1428
1440
  '204': None,
1429
1441
  '400': "Error",
1430
1442
  '401': "Error",
1443
+ '404': "Error",
1431
1444
  '500': "Error",
1432
1445
  }
1433
1446
  response_data = self.api_client.call_api(
@@ -2398,6 +2411,7 @@ class BpmnApi:
2398
2411
 
2399
2412
  _response_types_map: Dict[str, Optional[str]] = {
2400
2413
  '200': "BpmnResourceDetail",
2414
+ '404': "Error",
2401
2415
  }
2402
2416
  response_data = self.api_client.call_api(
2403
2417
  *_param,
@@ -2469,6 +2483,7 @@ class BpmnApi:
2469
2483
 
2470
2484
  _response_types_map: Dict[str, Optional[str]] = {
2471
2485
  '200': "BpmnResourceDetail",
2486
+ '404': "Error",
2472
2487
  }
2473
2488
  response_data = self.api_client.call_api(
2474
2489
  *_param,
@@ -2540,6 +2555,7 @@ class BpmnApi:
2540
2555
 
2541
2556
  _response_types_map: Dict[str, Optional[str]] = {
2542
2557
  '200': "BpmnResourceDetail",
2558
+ '404': "Error",
2543
2559
  }
2544
2560
  response_data = self.api_client.call_api(
2545
2561
  *_param,
@@ -3673,7 +3689,7 @@ class BpmnApi:
3673
3689
  project_id: UUID,
3674
3690
  page: Optional[StrictInt] = None,
3675
3691
  page_size: Optional[StrictInt] = None,
3676
- q: Annotated[Optional[StrictStr], Field(description="Optional case-insensitive substring match against process id or process name.")] = None,
3692
+ q: Annotated[Optional[StrictStr], Field(description="Optional case-insensitive prefix match against process id or process name.")] = None,
3677
3693
  created_after: Annotated[Optional[datetime], Field(description="Bounds the totalCount aggregate to instances created at or after this timestamp. Strongly recommended for monitoring views - instance history accumulates indefinitely and unfiltered totals scan the full table per definition. runningCount ignores this filter (it is always point-in-time). ")] = None,
3678
3694
  suspended: Annotated[Optional[StrictBool], Field(description="Filter by paused versions. `true` → only processes with at least one paused version; `false` → only processes with none. Omit for no filter. This is the cross-process answer to \"which definitions are paused?\"; `suspendedVersionCount` on each row says how many. ")] = None,
3679
3695
  _request_timeout: Union[
@@ -3699,7 +3715,7 @@ class BpmnApi:
3699
3715
  :type page: int
3700
3716
  :param page_size:
3701
3717
  :type page_size: int
3702
- :param q: Optional case-insensitive substring match against process id or process name.
3718
+ :param q: Optional case-insensitive prefix match against process id or process name.
3703
3719
  :type q: str
3704
3720
  :param created_after: Bounds the totalCount aggregate to instances created at or after this timestamp. Strongly recommended for monitoring views - instance history accumulates indefinitely and unfiltered totals scan the full table per definition. runningCount ignores this filter (it is always point-in-time).
3705
3721
  :type created_after: datetime
@@ -3762,7 +3778,7 @@ class BpmnApi:
3762
3778
  project_id: UUID,
3763
3779
  page: Optional[StrictInt] = None,
3764
3780
  page_size: Optional[StrictInt] = None,
3765
- q: Annotated[Optional[StrictStr], Field(description="Optional case-insensitive substring match against process id or process name.")] = None,
3781
+ q: Annotated[Optional[StrictStr], Field(description="Optional case-insensitive prefix match against process id or process name.")] = None,
3766
3782
  created_after: Annotated[Optional[datetime], Field(description="Bounds the totalCount aggregate to instances created at or after this timestamp. Strongly recommended for monitoring views - instance history accumulates indefinitely and unfiltered totals scan the full table per definition. runningCount ignores this filter (it is always point-in-time). ")] = None,
3767
3783
  suspended: Annotated[Optional[StrictBool], Field(description="Filter by paused versions. `true` → only processes with at least one paused version; `false` → only processes with none. Omit for no filter. This is the cross-process answer to \"which definitions are paused?\"; `suspendedVersionCount` on each row says how many. ")] = None,
3768
3784
  _request_timeout: Union[
@@ -3788,7 +3804,7 @@ class BpmnApi:
3788
3804
  :type page: int
3789
3805
  :param page_size:
3790
3806
  :type page_size: int
3791
- :param q: Optional case-insensitive substring match against process id or process name.
3807
+ :param q: Optional case-insensitive prefix match against process id or process name.
3792
3808
  :type q: str
3793
3809
  :param created_after: Bounds the totalCount aggregate to instances created at or after this timestamp. Strongly recommended for monitoring views - instance history accumulates indefinitely and unfiltered totals scan the full table per definition. runningCount ignores this filter (it is always point-in-time).
3794
3810
  :type created_after: datetime
@@ -3851,7 +3867,7 @@ class BpmnApi:
3851
3867
  project_id: UUID,
3852
3868
  page: Optional[StrictInt] = None,
3853
3869
  page_size: Optional[StrictInt] = None,
3854
- q: Annotated[Optional[StrictStr], Field(description="Optional case-insensitive substring match against process id or process name.")] = None,
3870
+ q: Annotated[Optional[StrictStr], Field(description="Optional case-insensitive prefix match against process id or process name.")] = None,
3855
3871
  created_after: Annotated[Optional[datetime], Field(description="Bounds the totalCount aggregate to instances created at or after this timestamp. Strongly recommended for monitoring views - instance history accumulates indefinitely and unfiltered totals scan the full table per definition. runningCount ignores this filter (it is always point-in-time). ")] = None,
3856
3872
  suspended: Annotated[Optional[StrictBool], Field(description="Filter by paused versions. `true` → only processes with at least one paused version; `false` → only processes with none. Omit for no filter. This is the cross-process answer to \"which definitions are paused?\"; `suspendedVersionCount` on each row says how many. ")] = None,
3857
3873
  _request_timeout: Union[
@@ -3877,7 +3893,7 @@ class BpmnApi:
3877
3893
  :type page: int
3878
3894
  :param page_size:
3879
3895
  :type page_size: int
3880
- :param q: Optional case-insensitive substring match against process id or process name.
3896
+ :param q: Optional case-insensitive prefix match against process id or process name.
3881
3897
  :type q: str
3882
3898
  :param created_after: Bounds the totalCount aggregate to instances created at or after this timestamp. Strongly recommended for monitoring views - instance history accumulates indefinitely and unfiltered totals scan the full table per definition. runningCount ignores this filter (it is always point-in-time).
3883
3899
  :type created_after: datetime
@@ -6290,6 +6306,7 @@ class BpmnApi:
6290
6306
 
6291
6307
  _response_types_map: Dict[str, Optional[str]] = {
6292
6308
  '200': None,
6309
+ '400': "Error",
6293
6310
  }
6294
6311
  response_data = self.api_client.call_api(
6295
6312
  *_param,
@@ -6361,6 +6378,7 @@ class BpmnApi:
6361
6378
 
6362
6379
  _response_types_map: Dict[str, Optional[str]] = {
6363
6380
  '200': None,
6381
+ '400': "Error",
6364
6382
  }
6365
6383
  response_data = self.api_client.call_api(
6366
6384
  *_param,
@@ -6432,6 +6450,7 @@ class BpmnApi:
6432
6450
 
6433
6451
  _response_types_map: Dict[str, Optional[str]] = {
6434
6452
  '200': None,
6453
+ '400': "Error",
6435
6454
  }
6436
6455
  response_data = self.api_client.call_api(
6437
6456
  *_param,
@@ -6475,6 +6494,13 @@ class BpmnApi:
6475
6494
  _body_params = publish_bpmn_message_request
6476
6495
 
6477
6496
 
6497
+ # set the HTTP header `Accept`
6498
+ if 'Accept' not in _header_params:
6499
+ _header_params['Accept'] = self.api_client.select_header_accept(
6500
+ [
6501
+ 'application/json'
6502
+ ]
6503
+ )
6478
6504
 
6479
6505
  # set the HTTP header `Content-Type`
6480
6506
  if _content_type:
@@ -6571,6 +6597,7 @@ class BpmnApi:
6571
6597
 
6572
6598
  _response_types_map: Dict[str, Optional[str]] = {
6573
6599
  '200': None,
6600
+ '400': "Error",
6574
6601
  }
6575
6602
  response_data = self.api_client.call_api(
6576
6603
  *_param,
@@ -6642,6 +6669,7 @@ class BpmnApi:
6642
6669
 
6643
6670
  _response_types_map: Dict[str, Optional[str]] = {
6644
6671
  '200': None,
6672
+ '400': "Error",
6645
6673
  }
6646
6674
  response_data = self.api_client.call_api(
6647
6675
  *_param,
@@ -6713,6 +6741,7 @@ class BpmnApi:
6713
6741
 
6714
6742
  _response_types_map: Dict[str, Optional[str]] = {
6715
6743
  '200': None,
6744
+ '400': "Error",
6716
6745
  }
6717
6746
  response_data = self.api_client.call_api(
6718
6747
  *_param,
@@ -6756,6 +6785,13 @@ class BpmnApi:
6756
6785
  _body_params = publish_bpmn_signal_request
6757
6786
 
6758
6787
 
6788
+ # set the HTTP header `Accept`
6789
+ if 'Accept' not in _header_params:
6790
+ _header_params['Accept'] = self.api_client.select_header_accept(
6791
+ [
6792
+ 'application/json'
6793
+ ]
6794
+ )
6759
6795
 
6760
6796
  # set the HTTP header `Content-Type`
6761
6797
  if _content_type:
@@ -7973,9 +8009,9 @@ class BpmnApi:
7973
8009
  _headers: Optional[Dict[StrictStr, Any]] = None,
7974
8010
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
7975
8011
  ) -> StartBpmnTestInstance201Response:
7976
- """Start a test instance from a draft resource
8012
+ """Start a test instance from a resource
7977
8013
 
7978
- Starts a process instance against a draft (non-deployed) resource. Useful for trying out an in-progress design before deploying. Test instances run with the same engine as production but are flagged so they can be filtered out of dashboards.
8014
+ Starts a test instance of a resource, draft or deployed. A draft can only be started this way, which makes it the way to try out an in-progress design before deploying. Test instances run with the same engine as production but are flagged so they can be filtered out of dashboards.
7979
8015
 
7980
8016
  :param project_id: (required)
7981
8017
  :type project_id: UUID
@@ -8019,6 +8055,7 @@ class BpmnApi:
8019
8055
  '201': "StartBpmnTestInstance201Response",
8020
8056
  '400': "Error",
8021
8057
  '401': "Error",
8058
+ '404': "Error",
8022
8059
  '500': "Error",
8023
8060
  }
8024
8061
  response_data = self.api_client.call_api(
@@ -8051,9 +8088,9 @@ class BpmnApi:
8051
8088
  _headers: Optional[Dict[StrictStr, Any]] = None,
8052
8089
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
8053
8090
  ) -> ApiResponse[StartBpmnTestInstance201Response]:
8054
- """Start a test instance from a draft resource
8091
+ """Start a test instance from a resource
8055
8092
 
8056
- Starts a process instance against a draft (non-deployed) resource. Useful for trying out an in-progress design before deploying. Test instances run with the same engine as production but are flagged so they can be filtered out of dashboards.
8093
+ Starts a test instance of a resource, draft or deployed. A draft can only be started this way, which makes it the way to try out an in-progress design before deploying. Test instances run with the same engine as production but are flagged so they can be filtered out of dashboards.
8057
8094
 
8058
8095
  :param project_id: (required)
8059
8096
  :type project_id: UUID
@@ -8097,6 +8134,7 @@ class BpmnApi:
8097
8134
  '201': "StartBpmnTestInstance201Response",
8098
8135
  '400': "Error",
8099
8136
  '401': "Error",
8137
+ '404': "Error",
8100
8138
  '500': "Error",
8101
8139
  }
8102
8140
  response_data = self.api_client.call_api(
@@ -8129,9 +8167,9 @@ class BpmnApi:
8129
8167
  _headers: Optional[Dict[StrictStr, Any]] = None,
8130
8168
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
8131
8169
  ) -> RESTResponseType:
8132
- """Start a test instance from a draft resource
8170
+ """Start a test instance from a resource
8133
8171
 
8134
- Starts a process instance against a draft (non-deployed) resource. Useful for trying out an in-progress design before deploying. Test instances run with the same engine as production but are flagged so they can be filtered out of dashboards.
8172
+ Starts a test instance of a resource, draft or deployed. A draft can only be started this way, which makes it the way to try out an in-progress design before deploying. Test instances run with the same engine as production but are flagged so they can be filtered out of dashboards.
8135
8173
 
8136
8174
  :param project_id: (required)
8137
8175
  :type project_id: UUID
@@ -8175,6 +8213,7 @@ class BpmnApi:
8175
8213
  '201': "StartBpmnTestInstance201Response",
8176
8214
  '400': "Error",
8177
8215
  '401': "Error",
8216
+ '404': "Error",
8178
8217
  '500': "Error",
8179
8218
  }
8180
8219
  response_data = self.api_client.call_api(
@@ -8924,6 +8963,8 @@ class BpmnApi:
8924
8963
 
8925
8964
  _response_types_map: Dict[str, Optional[str]] = {
8926
8965
  '200': None,
8966
+ '404': "Error",
8967
+ '409': "Error",
8927
8968
  }
8928
8969
  response_data = self.api_client.call_api(
8929
8970
  *_param,
@@ -8999,6 +9040,8 @@ class BpmnApi:
8999
9040
 
9000
9041
  _response_types_map: Dict[str, Optional[str]] = {
9001
9042
  '200': None,
9043
+ '404': "Error",
9044
+ '409': "Error",
9002
9045
  }
9003
9046
  response_data = self.api_client.call_api(
9004
9047
  *_param,
@@ -9074,6 +9117,8 @@ class BpmnApi:
9074
9117
 
9075
9118
  _response_types_map: Dict[str, Optional[str]] = {
9076
9119
  '200': None,
9120
+ '404': "Error",
9121
+ '409': "Error",
9077
9122
  }
9078
9123
  response_data = self.api_client.call_api(
9079
9124
  *_param,
@@ -9120,6 +9165,13 @@ class BpmnApi:
9120
9165
  _body_params = throw_bpmn_external_job_error_request
9121
9166
 
9122
9167
 
9168
+ # set the HTTP header `Accept`
9169
+ if 'Accept' not in _header_params:
9170
+ _header_params['Accept'] = self.api_client.select_header_accept(
9171
+ [
9172
+ 'application/json'
9173
+ ]
9174
+ )
9123
9175
 
9124
9176
  # set the HTTP header `Content-Type`
9125
9177
  if _content_type:
@@ -9510,6 +9562,7 @@ class BpmnApi:
9510
9562
  '200': None,
9511
9563
  '403': None,
9512
9564
  '404': None,
9565
+ '409': "Error",
9513
9566
  }
9514
9567
  response_data = self.api_client.call_api(
9515
9568
  *_param,
@@ -9587,6 +9640,7 @@ class BpmnApi:
9587
9640
  '200': None,
9588
9641
  '403': None,
9589
9642
  '404': None,
9643
+ '409': "Error",
9590
9644
  }
9591
9645
  response_data = self.api_client.call_api(
9592
9646
  *_param,
@@ -9664,6 +9718,7 @@ class BpmnApi:
9664
9718
  '200': None,
9665
9719
  '403': None,
9666
9720
  '404': None,
9721
+ '409': "Error",
9667
9722
  }
9668
9723
  response_data = self.api_client.call_api(
9669
9724
  *_param,
@@ -9710,6 +9765,13 @@ class BpmnApi:
9710
9765
  _body_params = throw_bpmn_user_task_error_request
9711
9766
 
9712
9767
 
9768
+ # set the HTTP header `Accept`
9769
+ if 'Accept' not in _header_params:
9770
+ _header_params['Accept'] = self.api_client.select_header_accept(
9771
+ [
9772
+ 'application/json'
9773
+ ]
9774
+ )
9713
9775
 
9714
9776
  # set the HTTP header `Content-Type`
9715
9777
  if _content_type:
@@ -10681,7 +10743,7 @@ class BpmnApi:
10681
10743
  ) -> UserTask:
10682
10744
  """Update User Task Assignment
10683
10745
 
10684
- Reassign / change candidates on a CREATED user task. Returns 404 if the task does not exist or is no longer in CREATED state. Requires Executor role on the project.
10746
+ Reassign / change candidates on a CREATED user task. Only the fields in the body change. Returns 400 for a body with none of them, and 404 if the task does not exist or is no longer in CREATED state. Requires Executor role on the project.
10685
10747
 
10686
10748
  :param project_id: (required)
10687
10749
  :type project_id: UUID
@@ -10723,6 +10785,7 @@ class BpmnApi:
10723
10785
 
10724
10786
  _response_types_map: Dict[str, Optional[str]] = {
10725
10787
  '200': "UserTask",
10788
+ '400': "Error",
10726
10789
  '404': None,
10727
10790
  }
10728
10791
  response_data = self.api_client.call_api(
@@ -10757,7 +10820,7 @@ class BpmnApi:
10757
10820
  ) -> ApiResponse[UserTask]:
10758
10821
  """Update User Task Assignment
10759
10822
 
10760
- Reassign / change candidates on a CREATED user task. Returns 404 if the task does not exist or is no longer in CREATED state. Requires Executor role on the project.
10823
+ Reassign / change candidates on a CREATED user task. Only the fields in the body change. Returns 400 for a body with none of them, and 404 if the task does not exist or is no longer in CREATED state. Requires Executor role on the project.
10761
10824
 
10762
10825
  :param project_id: (required)
10763
10826
  :type project_id: UUID
@@ -10799,6 +10862,7 @@ class BpmnApi:
10799
10862
 
10800
10863
  _response_types_map: Dict[str, Optional[str]] = {
10801
10864
  '200': "UserTask",
10865
+ '400': "Error",
10802
10866
  '404': None,
10803
10867
  }
10804
10868
  response_data = self.api_client.call_api(
@@ -10833,7 +10897,7 @@ class BpmnApi:
10833
10897
  ) -> RESTResponseType:
10834
10898
  """Update User Task Assignment
10835
10899
 
10836
- Reassign / change candidates on a CREATED user task. Returns 404 if the task does not exist or is no longer in CREATED state. Requires Executor role on the project.
10900
+ Reassign / change candidates on a CREATED user task. Only the fields in the body change. Returns 400 for a body with none of them, and 404 if the task does not exist or is no longer in CREATED state. Requires Executor role on the project.
10837
10901
 
10838
10902
  :param project_id: (required)
10839
10903
  :type project_id: UUID
@@ -10875,6 +10939,7 @@ class BpmnApi:
10875
10939
 
10876
10940
  _response_types_map: Dict[str, Optional[str]] = {
10877
10941
  '200': "UserTask",
10942
+ '400': "Error",
10878
10943
  '404': None,
10879
10944
  }
10880
10945
  response_data = self.api_client.call_api(