I am building a page template and in my pipeline first template is 'Extract components from page' which is out of the box template. After execution I see following package output.
Tridion/Component[] components somexml
Tridion/Component component component detail (Schema type is "Red")
Tridion/Component component component detail (Schema type is "Green")
Tridion/Page page page detail detail
Page is my current page and I have 2 component presentations added to that.
Next in pipeline is my custom TBB that executes following line :
var item = package.GetByName( "Component" );
var component = engine.GetObject( item ) as Component;
if(component.Schema.Title == "Red"){I don't want to process this component and want to get next component.;}
item variable will contain the reference to the last component in the package output. both component have different schema.
My question is, after some processing if I find the component referenced to item variable is not the component I want, Can I get reference to next component? for example if component schema is "Red" I want to get next component.