I just upgraded to version 2.2.0 and hava a question about the Trash class. acording to the comment on the top – “A class that represents Trash port - any data written into it is immediately discarded” i would like to know how to use this node. i use a data intersection and dont care about the data in both sources so i sent it to a trash node but the new Trash class is neither a node nor an edge.
Are you talking about
a) org.jetel.graph.Trash → an class implementing OutPort interface
This (used from inside Java code) could be used like this:
OutputPort trash= new Trash("some ID", metadata);
nodeIntersect.addOutputPort(0,trash);
Such code will satisfy DataIntersection component - its particular output port.
Don’t forget that you would need special instance of org.jetel.graph.Trash class to be assigned to particular port of node
b) org.jetel.component.Trash → a node/component with one input port for reading data ?
This may be connected as any other component to DataIntersection component through DirectEdge
Node intersec=new DataIntersection(....);
Node trash = new org.jetel.component.Trash(...);
intersec.addOutputPort(0,someEdge);
trash.addInputPort(0,someEdge);
I would suggest using org.jetel.component.Trash node asi this is similar what you could achieve by assembling the graph from XML prescription, but the a) option should work as well - it actually shows how you could connect to Clover’s component your own “adapter” which can interact with the component at data level - either provide data or read data.