Disconnect flow objects

Overview and Key Concepts

The Disconnect flow objects activity Disconnects one or more FloWorks objects from one or more other FloWorks objects on-the-fly, and then recalculates the network. It can be used for disconnecting connections created during the model run, for example when you want to disconnect a transporter from a loading arm or dynamically manage connections within a set of tanks.

Connectors

The Disconnect flow objects activity only allows one connector out. See Adding and Connecting Activities for more information.

Properties

The following image shows properties for the Disconnect flow objects activity:

Each of these properties will be explained in the following sections.

Name

Used to change the name of the activity. See Name for more information about this property.

Font

The Font button opens a window to edit the activity's background color and font properties. See Font for more information about this property.

Statistics

The Statistics button opens the activity's statistics window. See Statistics for more information about this property.

Disconnect From

Use the Object(s) / Group / Array box to specify the object(s) you want to disconnect from. You can specify a single object (using the eyedropper tool or a model.find() command), an object group (flat or nested) or an array of objects and/or groups. When a token enters the activity, the expression will be parsed recursively such that arrays of groups or groups will be properly handled.

Target Type

The object to disconnect from the source object(s) can be specified in three different ways.

  • As (list of) input port number(s). For the target, you should specify an input port number or a list of input port numbers (see below). The incoming connections to the "Disconnect From" object(s) at that specific input port(s) will be disconnected.
  • As (list of) output port number(s). For the target, you should specify an output port number or a list of output port numbers (see below). The outgoing connections from the "Disconnect From" object(s) at that specific output port(s) will be disconnected.
  • As (list of) object(s). For the target, you should specify a single object (using the eyedropper tool or a model.find() command), an object group (flat or nested) or an array of objects and/or groups. If the specified objects are output objects of the "Disconnect From" object(s), the corresponding connection(s) will be deleted.

Target (Object or Port to Disconnect)

When the "Target Type" is set to "Input Port" or "Output Port", you can specify one or more port numbers as follows:

  • A single port number. For example, to delete the connection to or from the second port, enter 2. This is equivalent to calling something like disconnectFrom.output.ports[2].disconnect() from FlexScript.
  • An array of port number(s). For example, if you specify [1, 3, 4], the objects connected to ports 1, 3 and 4 will be disconnected. The port numbers must be valid, otherwise an error message will be generated for each invalid port number. The valid port numbers will still be disconnected.
  • Zero for all ports. To disconnect all input or output objects, enter 0 as the target port.

When the "Target Type" is set to "Object", you can specify one or more objects as indicated in the "Target Type" section above.

Disconnect All Matching Connections

This option is only available when the "Object" Target Type is in use. It determines which connections should be deleted when multiple connections exist between two objects. When the option is switched off, the only the last connection will be deleted, that is: the highest ranked output connection from the source. When it is switched on, all connections between the two given objects will be deleted. Normally only one connection should exist between any two objects, and having multiple connections is usually an error. Therefore this option is switched on by default.