Main Content

systemcomposer.createActivity

Create System Composer activity diagram

Since R2024a

    Description

    systemcomposer.createActivity(activityName) creates a System Composer™ activity diagram with the name activityName and opens the activity diagram.

    example

    Examples

    collapse all

    Create an activity diagram and open it.

    systemcomposer.createActivity("activity_name")

    Input Arguments

    collapse all

    Name of new activity diagram, specified as a character vector or string. This name must be a valid MATLAB® identifier.

    Example: "activity_name"

    Data Types: char | string

    More About

    collapse all

    Definitions

    TermDefinitionApplicationMore Information
    activity diagram

    An activity diagram describes an activity in an architectural system. An activity describes system behavior that models the flow of tokens from inputs to outputs through a controlled sequence of actions. An activity diagram contains action nodes with pins connected by flow lines.

    Use activity diagrams to conceptualize a system, visualize functional flow through actions or decisions, and understand how system components interact with one another.

    token

    Tokens are objects that flow in the activity diagram. A token can represent data such as structures and integers, or a token can simply pass on the control.

    These are the types of tokens:

    • Object token — Represents an object, such as a piece of data

    • Control token — Represents a control or a triggering event that does not carry any data

    action node

    An action node is a key building block in an activity diagram. An action node represents an action to be executed. Action nodes consume input tokens and produce output tokens on pins.

    Use a MATLAB function or a nested activity diagram to describe the behavior of an action node.

    control node

    A control node routes a logical flow of tokens through the system.

    Use control nodes and flows to route tokens. Control nodes can be used to initialize, split, merge, and terminate token flows.

    Use Control Nodes to Manipulate Token Flows
    pin

    A pin directs tokens in or out of an action node. The directionality of the pin represents input or output. You can connect pins by object flows.

    Use pins to route an object token to or from an Action Node. Pins are also used to store object tokens before or during execution. You can use pins only for object flows.

    type

    A type defines the contents of a token that flows through a pin. A type has dimension, unit, complexity, minimum, maximum and description.

    These are three token types in activity diagrams:

    • Value type: A value type is a type assigned to a single value.

    • Composite type: A composite type is equivalent to a bus structure that contains field of different values and data types.

    • MATLAB class type: A MATLAB class type references a MATLAB class on the path that defines a complex object with properties and methods. You can use a built-in MATLAB class or define your own MATLAB class. For more information on using MATLAB class type, see Model Complex Objects in Activity Diagrams Using MATLAB Class Tokens.

    parameter node

    A parameter node route tokens into or out of a nested activity diagram. When a pin is created, a corresponding parameter node will be created inside the nested activity.

    Use parameter node to define how tokens enter or leave a nested activity. There are two types of parameter nodes input and output.

    Use Nested Activity to Describe Action

    flow

    A flow in an activity diagram connects two nodes. A dashed line represents a control flow. A solid line represents an object flow.

    These are the types of flows:

    • Object flow — Tokens in an object flow contains token data on which actions operate. You can use object flows to route input or output tokens to carry information or physical items between object nodes.

    • Control flow — Tokens in a control flow trigger the execution of actions. You can use control flows to model transfer of control from one Action Node to another.

    Simulate, Visualize, and Validate Activity Diagrams

    Version History

    Introduced in R2024a