Details
-
New Feature
-
Resolution: Canceled
-
Minor
-
None
-
None
-
None
-
None
-
All
-
GreenHopper Ranking:0|i0tb57:
-
9223372036854775807
-
Small
Description
Every component has a schema that can be specified by the user (or is there any that may not have one ?).
So we should provide an API to let the component designer say which property is the schema associated with it.
I think the best way is to associate the Schema property path with the connector defined in the component definition.
I will also refactor the way connectors are defined where you can set InputConnectors and OuputConnectors.
InputConnectors :
will only define the number of possible input connections.
OutputConnectors :
- the type of connections
- will define the max number of this connections (-1 will mean it is infinite, ex for tReplicate)
- will define the schema property associated with the connector.
- whether the schema is a single schema or may be a multiple one (for tMap that may have an infinite set of outputs and an infinite set of schemas). The single Schema would be a SchemaProperties type and for multiple schema we may create a new ComponentProperties named MultipleSchemaProperties that would hold a list of avro schemas.
So we could image in the tSaleforceInputDefinition we could have the follwing
setOutputConnectors(new OutputConnector(ConnectorType.MAIN, 1,"module.schema.schema", false)); //false for Multiple schemas
for tMap (multple input, multiple output and multiple schemas)
setInputConnectors(new InputConnector(INFINITE)); //INFINITE would be -1 setOutputConnectors(new OutputConnector(ConnectorType.MAIN, INFINITE,"schemas", true)); //true for multiple output schema
for tReplicate (1 input, multiple output and same schema)
setInputConnectors(new InputConnector(1)); setOutputConnectors(new OutputConnector(ConnectorType.MAIN, INFINITE,"schema", false)); //false cause same schema for all outputs
For error purpose will shall add a new attribute to the component to tell that the component may be final, this mean that if no connection if made on the output then no error shall be returned to the user but if it is not a final component then it is required to have one output.
About the multiple schema boolean, if we do not need the information in the ComponentDefinition then the value can be derived by an instanceof the schema property (thanks Pibafe for this idea). What you do think of this ?