From 418d5845b87d5ff549b1987b2e0905d1e64ba431 Mon Sep 17 00:00:00 2001 From: cdelaunay Date: Tue, 18 Jun 2024 14:26:15 +0200 Subject: [PATCH] now considering case of empty input when computing output of parallel node --- source/FingerBoard-Core/FBFlowInstance.class.st | 4 ++-- source/FingerBoard-Core/FBParallelNode.class.st | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/source/FingerBoard-Core/FBFlowInstance.class.st b/source/FingerBoard-Core/FBFlowInstance.class.st index 72ea6a3..920620e 100644 --- a/source/FingerBoard-Core/FBFlowInstance.class.st +++ b/source/FingerBoard-Core/FBFlowInstance.class.st @@ -209,9 +209,9 @@ FBFlowInstance >> nextTransition [ ] { #category : #accessing } -FBFlowInstance >> parallelExecutorFrom: aNode [ +FBFlowInstance >> parallelExecutorFrom: aNode ifAbsent: aBlock [ - ^ executors detect: [ :each | each isParallel and: [each node = aNode] ] + ^ executors detect: [ :each | each isParallel and: [each node = aNode] ] ifNone: aBlock ] { #category : #accessing } diff --git a/source/FingerBoard-Core/FBParallelNode.class.st b/source/FingerBoard-Core/FBParallelNode.class.st index 4a06b2d..a272602 100644 --- a/source/FingerBoard-Core/FBParallelNode.class.st +++ b/source/FingerBoard-Core/FBParallelNode.class.st @@ -20,6 +20,7 @@ FBParallelNode >> outputFor: anActivation [ if no execution in progress, returns the first element of the input value" | executor | - executor := anActivation instance parallelExecutorFrom: self. + + executor := anActivation instance parallelExecutorFrom: self ifAbsent: ["if there was no input, there was no output for the parallel node"^ nil]. ^ executor outputFor: anActivation ]