Skip to content

Commit

Permalink
made sure parallel node has only one activation per node
Browse files Browse the repository at this point in the history
  • Loading branch information
cdelaunay committed May 21, 2024
1 parent 85ab7a9 commit 49b68dc
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
4 changes: 4 additions & 0 deletions source/FingerBoard-Core-Tests/FBFlowTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ FBFlowTest >> testParallelNodeOpenEnd [
instance := flow newInstance.
instance executeWith: { 1 . 2 . 3 }.
self assert: instance atEnd.
self assert: instance state equals: #done.
"there should be one activation per node.
The activation for a parallel node is specific and holds collection of arguments and values"
self assert: instance activations size equals: flow nodes size

]

Expand Down
5 changes: 0 additions & 5 deletions source/FingerBoard-Core/FBActivation.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ FBActivation >> flow [
^ executor flow
]

{ #category : #testing }
FBActivation >> hasError [
^ state = #error
]

{ #category : #accessing }
FBActivation >> id [

Expand Down
5 changes: 5 additions & 0 deletions source/FingerBoard-Core/FBBaseActivation.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ FBBaseActivation >> followTransition: aTransition [
executor flowInstance executor addPending: aTransition ]
]

{ #category : #testing }
FBBaseActivation >> hasError [
^ state = #error
]

{ #category : #initialization }
FBBaseActivation >> initialize [
super initialize.
Expand Down
8 changes: 8 additions & 0 deletions source/FingerBoard-Core/FBParallelExecutor.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ Class {
#category : #'FingerBoard-Core-Model'
}

{ #category : #accessing }
FBParallelExecutor >> activate: activation [

"unlike default behavior, the activation is already added to the list when being instantiated.
here we only take care of the execution part"
flowInstance activateProtected: activation
]

{ #category : #accessing }
FBParallelExecutor >> activationClass [
^ FBParallelActivation
Expand Down

0 comments on commit 49b68dc

Please sign in to comment.