Skip to content

Commit 58b321e

Browse files
authored
Option to soften lanes (#2507)
* add option to not use lane for task assignment w/ burnettk * lint * add comments --------- Co-authored-by: jasquat <[email protected]>
1 parent 41fc813 commit 58b321e

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

spiffworkflow-backend/src/spiffworkflow_backend/config/default.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,10 @@ def config_from_env(variable_name: str, *, default: str | bool | int | None = No
252252
# check all tasks listed as child tasks are saved to the database
253253
config_from_env("SPIFFWORKFLOW_BACKEND_DEBUG_TASK_CONSISTENCY", default=False)
254254

255+
# When set to False, this will use the initiator for all task assignments.
256+
# This is useful when using arena with api keys only and doing task assignment in a differnt system.
257+
config_from_env("SPIFFWORKFLOW_BACKEND_USE_LANES_FOR_TASK_ASSIGNMENT", default=True)
258+
255259
### for documentation only
256260
# we load the CustomBpmnScriptEngine at import time, where we do not have access to current_app,
257261
# so instead of using config, we use os.environ directly over there.

spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_processor.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -957,8 +957,10 @@ def raise_if_no_potential_owners(self, potential_owners: list[PotentialOwner], m
957957
def get_potential_owners_from_task(self, task: SpiffTask) -> PotentialOwnerIdList:
958958
task_spec = task.task_spec
959959
task_lane = "process_initiator"
960-
if task_spec.lane is not None and task_spec.lane != "":
961-
task_lane = task_spec.lane
960+
961+
if current_app.config.get("SPIFFWORKFLOW_BACKEND_USE_LANES_FOR_TASK_ASSIGNMENT") is not False:
962+
if task_spec.lane is not None and task_spec.lane != "":
963+
task_lane = task_spec.lane
962964

963965
potential_owners: list[PotentialOwner] = []
964966
lane_assignment_id = None

0 commit comments

Comments
 (0)