Skip to content

Commit 6d02846

Browse files
authored
Merge pull request #444 from sartography/bugfix/loop-condition
reverse loop condition check
2 parents e1e4fa7 + 0446b7e commit 6d02846

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

SpiffWorkflow/bpmn/specs/mixins/multiinstance_task.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def merge_child(self, workflow, child):
8383
def loop_complete(self, my_task):
8484
merged = my_task.internal_data.get('merged', [])
8585
max_complete = self.maximum is not None and len(merged) >= self.maximum
86-
cond_complete = self.condition is not None and my_task.workflow.script_engine.evaluate(my_task, self.condition)
86+
cond_complete = self.condition is not None and not my_task.workflow.script_engine.evaluate(my_task, self.condition)
8787
return max_complete or cond_complete
8888

8989

@@ -350,4 +350,4 @@ def create_children(self, my_task):
350350
self.create_child(my_task, item, key_or_index)
351351

352352
def children_complete(self, my_task):
353-
return all(c.state == TaskState.COMPLETED for c in self._instances(my_task))
353+
return all(c.state == TaskState.COMPLETED for c in self._instances(my_task))

tests/SpiffWorkflow/bpmn/data/standard_loop.bpmn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<bpmn:incoming>Flow_0m77cxj</bpmn:incoming>
99
<bpmn:outgoing>Flow_1jbp2el</bpmn:outgoing>
1010
<bpmn:standardLoopCharacteristics testBefore="true" loopMaximum="3">
11-
<bpmn:loopCondition>done</bpmn:loopCondition>
11+
<bpmn:loopCondition>not done</bpmn:loopCondition>
1212
</bpmn:standardLoopCharacteristics>
1313
</bpmn:task>
1414
<bpmn:sequenceFlow id="Flow_0m77cxj" sourceRef="StartEvent_1" targetRef="any_task" />

0 commit comments

Comments
 (0)