主要内容

systemcomposer.activity.SendAction

R2026b

Send action node in activity diagram

Since R2026b

    Description

    A SendAction object represents a send action node in an activity diagram model. A send action node sends object tokens to one or more accept action nodes that have the same tag without using flows between nodes.

    Creation

    Create a send action node in an activity diagram using the addNode function with the nodeType argument specified as sendaction.

    sendAction1 = addNode(activity,'Send Data','sendaction');

    Properties

    expand all

    Tag name, specified as a character vector.

    Example: 'A'

    Data Types: char

    Activity that contains the send action node, specified as a systemcomposer.activity.Activity object.

    Name of send action node, specified as a character vector.

    Example: 'Send Data'

    Data Types: char

    Position on canvas, specified as a vector of coordinates, in pixels: [left top right bottom].

    Each vector specifies the location of the top left corner and bottom right corner of the component, specified as a 1-by-4 numeric array. The array denotes the top left corner in terms of its x and y coordinates followed by the x and y coordinates of the bottom right corner.

    Data Types: double

    Parent activity diagram model, specified as a systemcomposer.activity.Model object.

    Simulink® handle, specified as a double.

    This property is necessary for several Simulink workflows and for using Requirements Toolbox™ programmatic interfaces.

    Example: handle = get(object,'SimulinkHandle')

    Data Types: double

    Universal unique identifier, specified as a character vector.

    Example: '91d5de2c-b14c-4c76-a5d6-5dd0037c52df'

    Data Types: char

    Unique external identifier, specified as a character vector. The external ID is preserved over the lifespan of the element and through all operations that preserve the UUID.

    Data Types: char

    Object Functions

    applyStereotypeApply stereotype to model element
    changeStereotypeChange currently applied stereotype to new stereotype in its stereotype hierarchy
    destroyRemove model element
    getFlowGet flow from activity diagram
    getPinsGet pins from action node
    getStereotypesGet stereotypes applied on model element
    hasStereotypeFind if element has stereotype applied
    removeStereotypeRemove stereotype from profile
    connectCreate activity diagram flows

    Examples

    collapse all

    Create an activity diagram model and get the root activity.

    adModel = systemcomposer.createActivity("sendAcceptModel");
    activity = get(adModel,"Activity");

    Add an initial node, action nodes, and an activity final node.

    initialNode = addNode(activity,"Start","initial");
    action1 = addNode(activity,"Process Data","action");
    action2 = addNode(activity,"Handle Signal","action");
    finalNode = addNode(activity,"End","activityfinal");

    Define a tag in the activity.

    tag = addTag(activity,"A");

    Add a send action node and assign the tag name. A send action node sends object tokens to accept action nodes with the same tag name.

    sendNode = addNode(activity,"Send Data","sendaction");
    sendNode.TagName = "A"
    sendNode =
    
      SendAction with properties:
    
                    TagName: 'A'
                     Parent: [1×1 systemcomposer.activity.Activity]
                       Pins: [1×1 systemcomposer.activity.Pin]
                       Name: 'Send Data'
                   Position: [200 250 300 290]
                      Model: [1×1 systemcomposer.activity.Model]
             SimulinkHandle: 217.0001
        SimulinkModelHandle: 165.0022
                       UUID: 'e3120c5d-62ad-4243-bade-06ff481ae81e'
                ExternalUID: ''

    Add an accept action node with the same tag name. The accept action node receives object tokens from send action nodes that share the same tag name.

    acceptNode = addNode(activity,"Receive Data","acceptaction");
    acceptNode.TagName = "A"
    acceptNode =
    
      AcceptAction with properties:
    
                    TagName: 'A'
                     Parent: [1×1 systemcomposer.activity.Activity]
                       Pins: [1×1 systemcomposer.activity.Pin]
                       Name: 'Receive Data'
                   Position: [200 250 300 290]
                      Model: [1×1 systemcomposer.activity.Model]
             SimulinkHandle: 221.0001
        SimulinkModelHandle: 165.0022
                       UUID: '279b5f42-6697-4097-9fb9-89fed0dbecc7'
                ExternalUID: ''

    Connect nodes to create the activity flow. The send and accept action nodes communicate using a shared tag name.

    connect(initialNode,action1);
    connect(action1,sendNode);
    connect(acceptNode,action2);
    connect(action2,finalNode);

    More About

    expand all

    Version History

    Introduced in R2026b