The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
OutputPortExtender - How to add a precondition
I have input port extender defined as folows:
How can I add a Metadata precodndition to the innerOut1 port?
This approach failed:
private OutputPortExtender innerOut1 = new OutputPortExtender(The code is generated from operator and therefore it is not possible to use any passthrough rule.
"Example Set", getSubprocess(0).getInnerSources());
How can I add a Metadata precodndition to the innerOut1 port?
This approach failed:
innerOut1.deliverMetaData(getMetadata());Thanks in advance for any help.
private List<MetaData> getMetadata() {
List<MetaData> metadata = new Vector<MetaData>();
metadata.add(new MetaData(ExampleSet.class));
return metadata;
}
Tagged:
0
Answers
output ports don't have preconditions. For InputPortExtenders, you either pass it a desiredMetaData in the constuctor if your precondition is as simple as requiring an IOObject of a certain type, or you override makePrecondition.
The rules for the output ports are handeled just as those of any other port.
Best,
Simon
I can't figure out, how to add generation rule for OutputPortExtender. This is defined only for OutputPort. How can I do same thing for OutputPortExtender?
Thanks for your answers.
Simon is out of office right now but I am sure he will come back to you later.
Cheers,
Ingo
I think your solution is perfect. To be honest, I don't know why we don't have a ready-made class like the one you posted, but I also can't think of an operator that would use it - why would an operator produce several identical objects? May I ask what your application is, maybe I can make a better proposal then.
Best,
Simon
Thank you for your answer.
Ciao
StaryVena
then I think your solution is fine.
Best,
Simon