次の方法で共有


Connecting Activities

Glossary Item Box

VPL User Guide: Creating and Editing ActivitiesConfiguring ServicesRunning And Debugging

See Also Microsoft Robotics Developer Studio Send feedback on this topic

Connecting Activities

Connections between activity blocks define the messages and data passed between them. To connect two activity blocks, you must drag from the output connection (response or notification) pin of one activity to the input connection pin of the other. If there are multiple ways to connect outputs and inputs a Connections dialog box will appear. If there are no connection options, the Connections dialog does not appear. Often the options available for an activity’s output may depend on its input connection.

Using the Connections dialog box enables you to define which of the inputs and outputs you want to connect.

Connections Dialog.PNG

To select the connection, choose an output connection from the left list (From) and an input action from the right list (To) and click OK.

Sometimes connections between activities also require selecting what data is to be passed between the connections. When this occurs a Data Connections dialog box appears and displays the message sender’s data options on the left side and the receiver options on the right. Incoming data options can include the default value for its data type (0 for numeric types, false for Boolean types, and null for all other types), the value of the data, or sub-data (data member) values.

Data Connections dialog

At the bottom of the dialog is a checkbox labeled "Edit values directly". This is feature can be used when you want to use more complex expressions (covered in a later section) or you cannot find the particular value you want to send in the Value drop-down list.

You can change a connection from one activity to another by first selecting the connection link and dragging the end you want to reconnect. You can also change the connections or data settings by using the pop-up context menu for the connection link.

To delete a connection link click the link to select it and click Delete from the Edit menu or the pop-up context menu for the link. You can also use the Del key.

Activities may support several input actions (requests) but each block can only accept one input connection at a time. If you have already connected a link to an activity and you want to connect to one of its other input actions, then create a reference copy of it (using Copy and Paste from the Edit menu or the context pop-up menu) and then connect to the copy. You can also create a reference copy of a service by dragging it again from the Services toolbox, and you will be given the option of creating a copy of the current instance or creating a new instance.

You can only create one connection link to the same input connection pin of an activity. However, you can use Merge or Join activities to route messages from multiple activities to the same input connection pin.

While Merge and Join provide similar functionality to consolidate or connect separate sequences or dataflows, they do have some subtle differences. Join activities cannot be used to connect two or more notification connections. This is also true even where the connections may not be coming directly from notification outputs, but where notification links reside in the dataflows you are trying to connect. In such a case, use a Merge activity instead. Similarly, note that a Merge activity forwards on messages as soon as they are received. The Join activity only forwards messages when messages are received on all of its incoming inputs.

You can create multiple connection links from an activity's output pin. However, if an activity offers more than one result or notification choice, you can only connect to one of these at a time. So if you want to create a connection, create a reference (using Copy and Paste or dragging the service from the toolbox) and then you can connect to it.

See Also 

VPL User Guide: Creating and Editing ActivitiesConfiguring ServicesRunning And Debugging

 

 

© 2012 Microsoft Corporation. All Rights Reserved.