| | standard library package Actions { |
| | doc |
| | |
| | |
| | |
| | |
| |
|
| | private import Base::Anything; |
| | private import ScalarValues::Positive; |
| | private import ScalarValues::Natural; |
| | private import SequenceFunctions::size; |
| | private import SequenceFunctions::isEmpty; |
| | private import Occurrences::Occurrence; |
| | private import Occurrences::HappensWhile; |
| | private import Performances::Performance; |
| | private import Performances::performances; |
| | private import Transfers::SendPerformance; |
| | private import Transfers::sendPerformances; |
| | private import Transfers::AcceptPerformance; |
| | private import Transfers::acceptPerformances; |
| | private import FeatureReferencingPerformances::FeatureWritePerformance; |
| | private import ControlPerformances::MergePerformance; |
| | private import ControlPerformances::DecisionPerformance; |
| | private import ControlPerformances::IfThenPerformance; |
| | private import ControlPerformances::IfThenElsePerformance; |
| | private import ControlPerformances::LoopPerformance; |
| | private import TransitionPerformances::TransitionPerformance; |
| | private import TransitionPerformances::NonStateTransitionPerformance; |
| | private import Transfers::MessageTransfer; |
| | private import Connections::MessageConnection; |
| | |
| | abstract action def Action :> Performance { |
| | doc |
| | |
| | |
| | |
| | |
| | |
| | ref action self: Action :>> Performance::self; |
| | ref action incomingTransfers :>> Performance::incomingTransfers; |
| | |
| | action start: Action :>> startShot { |
| | doc |
| | |
| | |
| | |
| | } |
| | |
| | action done: Action :>> endShot { |
| | doc |
| | |
| | |
| | |
| | } |
| |
|
| | action subactions: Action[0..*] :> actions, subperformances { |
| | doc |
| | |
| | |
| | |
| | |
| | ref occurrence :>> this = (that as Action).this { |
| | doc |
| | |
| | |
| | |
| | |
| | } |
| | } |
| | |
| | action sendSubactions: SendAction[0..*] :> subactions, sendActions { |
| | doc |
| | |
| | |
| | |
| | } |
| | |
| | action acceptSubactions: AcceptAction[0..*] :> subactions, acceptActions { |
| | doc |
| | |
| | |
| | |
| | } |
| | |
| | abstract action controls : ControlAction[0..*] :> subactions { |
| | doc |
| | |
| | |
| | |
| | } |
| | |
| | abstract action merges : MergeAction[0..*] :> controls { |
| | doc |
| | |
| | |
| | |
| | } |
| | |
| | abstract action decisions : DecisionAction :> controls { |
| | doc |
| | |
| | |
| | |
| | } |
| | |
| | abstract action joins : JoinAction :> controls { |
| | doc |
| | |
| | |
| | |
| | } |
| | |
| | abstract action forks : ForkAction :> controls { |
| | doc |
| | |
| | |
| | |
| | } |
| | |
| | abstract action transitions : TransitionAction[0..*] :> subactions, transitionActions { |
| | doc |
| | |
| | |
| | |
| | } |
| | |
| | abstract action decisionTransitions : DecisionTransitionAction[0..*] :> transitions { |
| | doc |
| | |
| | |
| | |
| | } |
| | |
| | abstract action assignments : AssignmentAction[0..*] :> subactions, assignmentActions { |
| | doc |
| | |
| | |
| | |
| | } |
| | |
| | abstract action ifSubactions : IfThenAction[0..*] :> subactions, ifThenActions { |
| | doc |
| | |
| | |
| | |
| | } |
| | |
| | abstract action loops : LoopAction[0..*] :> subactions, loopActions { |
| | doc |
| | |
| | |
| | |
| | } |
| | |
| | abstract action whileLoops : WhileLoopAction[0..*] :> loops, whileLoopActions { |
| | doc |
| | |
| | |
| | |
| | } |
| | |
| | abstract action forLoops : ForLoopAction[0..*] :> loops, forLoopActions { |
| | doc |
| | |
| | |
| | |
| | } |
| | } |
| | |
| | abstract action actions: Action[0..*] nonunique :> performances { |
| | doc |
| | |
| | |
| | |
| | } |
| | |
| | action def SendAction :> Action, SendPerformance { |
| | doc |
| | |
| | |
| | |
| | |
| | |
| | in payload :>> sentItem; |
| | ref sentMessage :>> sentTransfer: MessageTransfer, MessageConnection; |
| | } |
| | |
| | abstract action sendActions: SendAction[0..*] nonunique :> actions, sendPerformances { |
| | doc |
| | |
| | |
| | |
| | } |
| | |
| | action def AcceptMessageAction :> Action, AcceptPerformance { |
| | doc |
| | |
| | |
| | |
| | |
| | inout payload :>> acceptedItem; |
| | ref acceptedMessage :>> acceptedTransfer: MessageTransfer, MessageConnection; |
| | } |
| | |
| | action def AcceptAction :> AcceptMessageAction { |
| | doc |
| | |
| | |
| | |
| | |
| | |
| | ref :>> acceptedMessage = aState.aTransition.accepter.acceptedMessage; |
| | state aState { |
| | transition aTransition first start accept apayload: Anything via receiver then done; |
| | } |
| | bind payload = aState.aTransition.apayload; |
| | } |
| | |
| | abstract action acceptActions: AcceptAction[0..*] nonunique :> actions, acceptPerformances { |
| | doc |
| | |
| | |
| | |
| | } |
| | |
| | abstract action def ControlAction :> Action { |
| | doc |
| | |
| | |
| | |
| | |
| | bind start = done { |
| | doc |
| | |
| | |
| | |
| | } |
| | } |
| | |
| | action def MergeAction :> ControlAction, MergePerformance { |
| | doc |
| | |
| | |
| | |
| | |
| | |
| | |
| | } |
| | |
| | action def DecisionAction :> ControlAction, DecisionPerformance { |
| | doc |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | } |
| | |
| | action def JoinAction :> ControlAction { |
| | doc |
| | |
| | |
| | |
| | |
| | |
| | |
| | } |
| | |
| | action def ForkAction :> ControlAction { |
| | doc |
| | |
| | |
| | |
| | |
| | |
| | |
| | } |
| | |
| | abstract action def TransitionAction :> Action, TransitionPerformance { |
| | doc |
| | |
| | |
| | |
| | |
| | |
| | in transitionLinkSource : Action :>> TransitionPerformance::transitionLinkSource; |
| | ref acceptedMessage : MessageConnection :>> trigger; |
| | |
| | ref receiver :>> triggerTarget; |
| |
|
| | action accepter : AcceptMessageAction :>> 'accept'; |
| | |
| | bind receiver = accepter.receiver; |
| | bind acceptedMessage = accepter.acceptedMessage; |
| | |
| | action effect: Action :>> TransitionPerformance::effect; |
| | } |
| | |
| | action def DecisionTransitionAction :> TransitionAction, NonStateTransitionPerformance { |
| | doc |
| | |
| | |
| | |
| | |
| | |
| | |
| | ref action :>> accepter[0..0]; |
| | ref action :>> effect[0..0]; |
| | } |
| |
|
| | abstract action transitionActions: TransitionAction[0..*] nonunique :> actions { |
| | doc |
| | |
| | |
| | |
| | } |
| | |
| | action def AssignmentAction :> FeatureWritePerformance, Action { |
| | doc |
| | |
| | |
| | |
| | |
| | |
| | |
| | in target : Occurrence[1]; |
| | inout replacementValues : Anything[0..*] nonunique; |
| | } |
| | |
| | abstract action assignmentActions : AssignmentAction[0..*] nonunique :> actions { |
| | doc |
| | |
| | |
| | |
| | |
| | in :>> target : Occurrence[1] default that as Occurrence { |
| | doc |
| | |
| | |
| | |
| | |
| | } |
| | } |
| | |
| | action def IfThenAction :> Action, IfThenPerformance { |
| | doc |
| | |
| | |
| | |
| | |
| | |
| | in :>> ifTest[1]; |
| | in action :>> thenClause[0..1]; |
| | } |
| | |
| | action def IfThenElseAction :> IfThenAction, IfThenElsePerformance { |
| | doc |
| | |
| | |
| | |
| | |
| | |
| | in :>> ifTest[1]; |
| | in action :>> thenClause[0..1]; |
| | in action :>> elseClause[0..1]; |
| | } |
| | |
| | abstract action ifThenActions : IfThenAction[0..*] nonunique :> actions { |
| | doc |
| | |
| | |
| | |
| | } |
| | |
| | abstract action ifThenElseActions : IfThenElseAction[0..*] nonunique :> actions { |
| | doc |
| | |
| | |
| | |
| | } |
| | |
| | abstract action def LoopAction :> Action { |
| | doc |
| | |
| | |
| | |
| | |
| | |
| | in action body[0..*] { |
| | doc |
| | |
| | |
| | |
| | } |
| | } |
| | |
| | action def WhileLoopAction :> LoopAction, LoopPerformance { |
| | doc |
| | |
| | |
| | |
| | |
| | |
| | in :>> whileTest default {true} { |
| | doc |
| | |
| | |
| | |
| | |
| | |
| | } |
| | |
| | in action body :>> LoopAction::body, LoopPerformance::body { |
| | doc |
| | |
| | |
| | |
| | |
| | } |
| | |
| | in :>> untilTest default {false} { |
| | doc |
| | |
| | |
| | |
| | |
| | } |
| | } |
| | |
| | private abstract action def ForLoopActionBase :> LoopAction { |
| | in action body; |
| | in ref seq[0..*] ordered nonunique; |
| | } |
| | |
| | action def ForLoopAction :> ForLoopActionBase { |
| | doc |
| | |
| | |
| | |
| | |
| | |
| | protected ref var[0..1] :> seq { |
| | doc |
| | |
| | |
| | |
| | |
| | } |
| | |
| | in ref :>> seq { |
| | doc |
| | |
| | |
| | |
| | } |
| | |
| | in action :>> body { |
| | doc |
| | |
| | |
| | |
| | } |
| | |
| | private attribute index : Positive { |
| | doc |
| | |
| | |
| | |
| | |
| | } |
| | |
| | private action initialization |
| | assign index := 1; |
| | then private action whileLoop |
| | while index <= size(seq) { |
| | assign var := seq#(index); |
| | then perform body; |
| | then assign index := index + 1; |
| | } |
| | } |
| | |
| | abstract action loopActions : LoopAction[0..*] nonunique :> actions { |
| | doc |
| | |
| | |
| | |
| | } |
| | |
| | abstract action whileLoopActions : WhileLoopAction[0..*] nonunique :> loopActions { |
| | doc |
| | |
| | |
| | |
| | } |
| | |
| | abstract action forLoopActions : ForLoopAction[0..*] nonunique :> loopActions { |
| | doc |
| | |
| | |
| | |
| | } |
| | } |