Skip to content

Commit

Permalink
add constraints to all elements
Browse files Browse the repository at this point in the history
  • Loading branch information
JanBliznicenko committed Nov 21, 2023
1 parent 6bd1fda commit 73305ce
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 2 deletions.
10 changes: 9 additions & 1 deletion repository/OpenPonk-BormModel/BormActivity.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,19 @@ Class {
#category : #'OpenPonk-BormModel-Models'
}

{ #category : #'as yet unclassified' }
{ #category : #associating }
BormActivity >> ==> anActivity [
^ BormFactory communicationFrom: self to: anActivity
]

{ #category : #accessing }
BormActivity >> allElements [
"should return all elements recursively (incl. sub-elements)"

^ super allElements , (self communications flatCollect: [ :each |
(Set with: each) , each allElements ])
]

{ #category : #accessing }
BormActivity >> allEntities [
^ super allEntities , (self sent flatCollect: #allEntities)
Expand Down
10 changes: 9 additions & 1 deletion repository/OpenPonk-BormModel/BormCommunication.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,15 @@ BormCommunication >> constraints [

{ #category : #accessing }
BormCommunication >> dataFlows [
^ self elements

^ elements
]

{ #category : #accessing }
BormCommunication >> elements [

self hasConstraint ifFalse: [ ^ super elements ].
^ super elements , { self constraint }
]

{ #category : #testing }
Expand Down
8 changes: 8 additions & 0 deletions repository/OpenPonk-BormModel/BormProcessNode.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ BormProcessNode >> addTransition: aTransition [
ifFalse: [ self changed ]
]

{ #category : #accessing }
BormProcessNode >> allElements [
"should return all elements recursively (incl. sub-elements)"

^ super allElements , (self transitions flatCollect: [ :each |
(Set with: each) , each allElements ])
]

{ #category : #accessing }
BormProcessNode >> allEntities [
^ (Set with: self entity) , (self outgoing flatCollect: #allEntities)
Expand Down
7 changes: 7 additions & 0 deletions repository/OpenPonk-BormModel/BormTransition.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ BormTransition >> constraints [
^ constraint ifNil: [ #() ] ifNotNil: [ ^ {constraint} ]
]

{ #category : #accessing }
BormTransition >> elements [

self hasConstraint ifFalse: [ ^ #( ) ].
^ { self constraint }
]

{ #category : #accessing }
BormTransition >> has: anEntity [
^ constraint = anEntity
Expand Down

0 comments on commit 73305ce

Please sign in to comment.