Skip to content

Declaring output values

Leon Starr edited this page Nov 6, 2023 · 3 revisions

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”.

Output a scalar value

On the class diagram, use the UML method signature style to define return values:

Computer area( length : Distance ) : Area

Output a table

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

Output a set of instances

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.

Introduction

Model semantics

Flows (as Variables)

Constants and literals

Structure of an activity

Accessing the class model

Data flow


Grammar and parsing notes

Components

Clone this wiki locally