vcRoutingRule

vcRoutingRule allows you to define rules for transferring components to different connectors, thereby simulating routing rules for material flow.

Inherits: vcBehaviour, vcFlow, vcContainer

Properties

Name Type Access Description
FlowProxy vcComponentFlowProxy RW Defines if a proxy is used to check capacity of selected connector before routing a component.

If None, this property is ignored.

RuleComponent Enumeration RW Defines the component used for rule processing.

See Routing Constants for more information.

Methods

Name Return Type Parameters Description
createConnector Integer None Adds a new connector in routing rule, and then returns the index of new connector.
deleteConnector None Integer index Deletes a connector from routing rule at a given index.
processRoute Integer Integer from_connector, vcComponent component, vcBehaviour behavior Returns the result of a routing test to verify if a given component would be routed based on a capacity test performed by a given behaviour or FlowProxy.   Depending on the value of RuleComponent, the component can be either:
  • The arriving component (if RuleComponent == VC_ROUTING_PROCESSED)
  • The owner component of the behavior (if RuleComponent == VC_ROUTING_OWNER)

Returns -1 if no valid targets are found.

setTarget None Integer index Sets the connector by index for routing a component, which should be executed in OnRoute event.

Events

Name Parameters Description
OnRoute Integer connector, vcComponent component, vcBehaviour behaviour Triggered when a component is transferred into routing rule and being processed.

Use the processRoute() method to test a viable option, and then use setTarget() method to override default routing logic.