| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (7 out of 13)

Using Connection Posts

If you need to connect objects across workspaces, you can do so by using a connection post. A connection post is an instance of the CONNECTION-POST class of objects, analogous to the connection posts found in flow diagrams and electrical schematics. Using a connection post lets you connect two or more objects on different workspaces, indicating that endpoints of connections on separate workspaces are actually joined.

To create a connection post:

The Names attribute specifies the name of the connection post. All connection posts of the same name are connected to each other, regardless of their locations. Connecting an object to a connection post connects it to any other object connected to that connection post, and to any object connected to any other connection post having the same name.

For example, this figure shows three connection posts of the same name, CONNECT-WS. All of the objects, transfer-car1, transfer-car2, and transfer-car3 are connected to each other via the CONNECT-WS connection posts.



Hint: Although connection posts are most often used to connect objects across workspaces, you can also use them to connect objects on the same workspace. Also, you can attach any number of connections to a connection post.

You cannot connect objects with opposing directions of flow.

Creating Connection Posts on Subworkspaces Automatically

G2 provides a special configuration clause that affects how you use connection posts and how items are connected through the workspace hierarchy. The configuration clause is:

This configuration is a convenient way to create connection posts automatically upon the subworkspaces of objects. If an object definition includes this configuration statement in its Instance-configuration attribute (not Item-configuration), whenever a subworkspace is created for that class, G2 automatically creates a connection post for each connection stub on the class icon.

For example, the next diagram shows the water-tank class, with its instance configuration declaring subworkspace connection posts. An instance of this class, water-tank1, has a subworkspace, shown below it. Upon the subworkspace is the connection post that G2 creates automatically due to the configuration clause. Further, the connection post has a completed Superior-connection attribute, indicating the specific connection to which it is attached.


Creating a Connection Post Subclass

To create a connection post subclass:

  1. Create an object definition.

  2. Name the class by completing the Class-names attribute.

  3. In the Direct-superior-classes attribute, specify CONNECTION-POST as the superior class.

Once the class exists, use it whenever you need a connection post by choosing:

| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (7 out of 13)

Copyright © 1997 Gensym Corporation, Inc.