Problem with delivering data to the Output port from Subprocess
monami555
New Altair Community Member
Hello
I have the following problem: I have an Validation operator which consists of two subprocesses. In each subprocesses I have suboperators, and their corresponding ports are connected.
When I execute the main process I get an exception: No data was deliverd at port Validation.model (disconnected) (in fact the Validation operator itself does not pass its results anywhere yet..), which is the Output port of Validation operator. So as I understand the data is not passed from Subprocess(1) of the operator Validation to the output port of Validation. But shouldn't it happen automatically? How do I connect them manually? (it's connecting an output port with another output port.. does not make sense, right..)
Will be grateful for any help.
My code:
I have the following problem: I have an Validation operator which consists of two subprocesses. In each subprocesses I have suboperators, and their corresponding ports are connected.
When I execute the main process I get an exception: No data was deliverd at port Validation.model (disconnected) (in fact the Validation operator itself does not pass its results anywhere yet..), which is the Output port of Validation operator. So as I understand the data is not passed from Subprocess(1) of the operator Validation to the output port of Validation. But shouldn't it happen automatically? How do I connect them manually? (it's connecting an output port with another output port.. does not make sense, right..)
Will be grateful for any help.
My code:
//%Validation
XValidation validation = OperatorService.createOperator(XValidation.class);
process.getRootOperator().getSubprocess(0).addOperator(validation);
set_role.getOutputPorts().getPortByIndex(0).connectTo(validation.getInputPorts().getPortByIndex(0));
KNNLearner k_NN = OperatorService.createOperator(KNNLearner.class);
k_NN.setParameter("k", "3");
validation.getSubprocess(0).addOperator(k_NN);
validation.getSubprocess(0).getInnerSources().getPortByIndex(0).connectTo(k_NN.getInputPorts().getPortByIndex(0));
k_NN.getOutputPorts().getPortByIndex(0).connectTo(validation.getSubprocess(0).getInnerSinks().getPortByIndex(0));
ModelApplier apply_model = OperatorService.createOperator(ModelApplier.class);
validation.getSubprocess(1).addOperator(apply_model);
validation.getSubprocess(1).getInnerSources().getPortByIndex(0).connectTo(apply_model.getInputPorts().getPortByIndex(0));
validation.getSubprocess(1).getInnerSources().getPortByIndex(1).connectTo(apply_model.getInputPorts().getPortByIndex(1));
SimplePerformanceEvaluator performance = OperatorService.createOperator(SimplePerformanceEvaluator.class);
validation.getSubprocess(1).addOperator(performance);
apply_model.getOutputPorts().getPortByIndex(0).connectTo(performance.getInputPorts().getByIndex(0));
performance.getOutputPorts().getPortByIndex(0).connectTo(validation.getSubprocess(1).getInnerSinks().getPortByIndex(0));
//data is not delivered to validation.getOutputPorts().getPortByIndex(0)
process.run();
0
Answers
-
Ok the problem is solved though I have no idea how it happened, now the code just works.. probably had a too long day yesterday :-[0