-
Notifications
You must be signed in to change notification settings - Fork 0
Declaring output values
A method or operation can output a scalar, relation, or instance reference set. The declaration of a method or operation signature is not performed with action language. Instead, you show it in the lower compartment of whatever model element provides the method or operation (class, external entity, domain operation) and also in a comment at the top of your activity.
We use the term “output” since it more accurately reflects our data flow thinking (an activity has inputs and outputs) than the programming concept of a “return value”.
On the class diagram, use the UML method signature style to define return values:
Computer area( length : Distance ) : Area
Name the table and preface name with #
followed by a heading consisting of attribute name : data type pairs in parentheses:
Stimulus Occurrence.Match pattern( ext system, stimulus, param values ) : #( Name : Pattern Name )
This signature outputs a table of Name attributes typed Pattern Name
Name the class and preface name with .
or ..
(This avoids collision with a class name and a data type name or a table name)
For example:
Behavior.Next task() : .Task
Outputs zero or one Task class instance references.
Or:
Behavior.All tasks(): ..Task
Outputs a set of zero, one or many Task instance references.
Copyright 2020, 2021, 2022, 2023 © Leon Starr under MIT Open Source License
- Why they are problematic
- Instance attribute creation values
- Boolean values
- Special values
- Enumerated values
- Action block
- Statement
- Single line action
- Multiple dependent actions on a single line
- An action spread across multiple lines
- A conditional group of single line actions
- Comments
- Finding instances
- Attribute access
- Creation and deletion
- Subclass migration
- Creating a table from a class
- Creating a table with a definition
- Converting a table into a class
- Set operations on tables
- Set comparisons on tables
- Join
- Rename
- Extend
- Aggregation
- Rank
- Image
- Input values
- Signatures and name doubling
- Output values
- Execution order
- Sequential execution
- Conditional execution
- Signals
- Scrall has no for_each action
- Iteration