# Breaking Changes
# Introduction
Below is a list of breaking changes to the way python components are defined in Flow 5.5 vs Flow 6.0. To bring a Flow 5.5 component over into a Flow 6.0 or later environment the following changes will need to be made in order for the component to be detected when the library is loaded. If you require help to make these changes, please reach out to TEC through your usual support channels.
# Port Definitions
definition = Definition(...)has been replaced byports = Ports(...).- Defining ports via a dictionary has been removed. Using the
Portsclass is mandatory.
# Changes to Both Port Definitions
- Inports and Outports can be added to
Portsusing theadd_inportandadd_outportmethods respectively. [None]is no longer accepted as a port type. This has been replaced by theALL_FLOW_TYPES. If you think you have a need to use this to convert over your component, please reach out to us for guidance.
# Changes to Inport Definitions
multi_connectionrenamed toarrayand is nowFalseby default.requiredhas been removed and replaced withdefault, which takes a default value for the port if it is not connected.- If default is not set, the port will be required - this is the standard behaviour
- If
arrayis false, default must be a single flow type value - If
arrayis true, default must be a list of flow type values - If the port should be optional, but doesn't need a default value (the component should do different things if the port is connected and unconnected), specify the default as
base.Null().
# Changes to Outport Definitions
- Both
requiredandmulti_connectionhave been removed. Outports are always optional and multi-connection. - Only
idandtypescan now be set for an outport.
# Process
def process(component: Component)should now bedef process(component: Process).is_connectedhas been removed.- Optional ports should have a default value specified, so even if they are unconnected they will have data. As such this function is obsolete.
- If you still want to determine if an optional port is connected, set its default value to
base.Null()and following a call toget_dataon the port, use theis_nullmethod (orisinstance(value, base.Null)).
component.logis now an async function. This means it will not work outside of an async process and must be used with the await keyword.component.logshould generally not be used, but if you think you have a need for this please reach out for guidance.run_blockingcan now be imported fromflow.utils.