Custom Input and Output Channels on Scripting Components
Scripting Components require the specification of custom input and/or output channels to manage the data flow through them. The DataShyft Platform UI allows the input and output channels to be specified through the addition of specific comments to the component’s script. This helps to ensure that copying a script from one component/blueprint to another will create all the input and output channels required by a script.
Input and Output Channels are specified by creating a comment in the script similar to the following:
// @InputChannel("inputChannelName", "datatype")
// @OutputChannel("outputChannelName", "datatype")
The first parameter specifies the name of the input or output channel. Channel names can contain alphanumeric characters, hyphens, and periods; any other characters will result in a warning and the channel definition will be ignored. The channel names must be unique and should not match any pre-defined channels on the components (e.g. error).
The second parameter specifies the type of data on which the channel operates. The data type for a channel should be consistent with the type of data the script accepts and/or emits. For a full list of valid data types, see the Data Types category. For convenience, the data types may be specified using either the fully qualified data type name (e.g. com.datashyft.pipeline.dataobjects.SimpleMappedData ) or using the simple data type name (e.g. SimpleMappedData ).
When the script is saved, the UI will scan it for these comments and automatically update the input and output channels of the component to match. If there are any errors in the definitions, a warning dialog will be presented. If the changes would result in any channels being removed, a confirmation dialog will be presented.