Main Content

systemcomposer.createActivity

Create System Composer activity diagram

Since R2024a

    Description

    example

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

    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 is the primary diagram to describe an activity. 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. Activity diagrams represent the flow of tokens through various actions that describe the execution of activities.

    Use activity diagrams to conceptualize a system, visualize functional flow through actions or decisions, and understand how system components interact with one another. You can use activity diagrams to describe the behavior of systems as a transformation of inputs to outputs through actions that process token flows.

    token

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

    Use a token to move data or control across the activity diagram. 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.

    Author Activity Diagrams
    flow

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

    You can use object flows to route input or output tokens to carry information or physical items between object nodes. You can use control flows to model transfer of control from one Action Node to another. These are the types of flows:

    • Object flow — Tokens in an object flow contains token data on which actions operate.

    • Control flow — Tokens in a control flow trigger the execution of actions.

    Simulate, Visualize, and Validate Activity Diagrams

    Version History

    Introduced in R2024a