Use io ports in Script Execution Operator in Java

kemoc
kemoc New Altair Community Member
edited November 2024 in Community Q&A
Hi,
I have another problem:
I try to use 2 Input ports and 2 output ports into Script Execution Operator and unfortunatelly it dosen't work,
my code:

ExampleSet exampleSet5 = table.createExampleSet(label);

List<IOObject> connList = new IOContainer(exampleSet5).asList();
operator.getOutputPorts().getPortByName("output 1").receive( connList.get(0) );

I have Exception
groovy.lang.MissingMethodException: No signature of method: com.rapidminer.operator.ports.impl.OutputPortImpl.receive() is applicable for argument types: (com.rapidminer.example.set.SimpleExampleSet) values: [SimpleExampleSet:
Possible solutions: deliver(com.rapidminer.operator.IOObject).

I tried:
IOObject ioo = examplseSet5;
IOContainer ioc = new IOContainer(new IOObject[] {ioo});
but RM still throw Exception.

Welcome!

It looks like you're new here. Sign in or register to get started.

Answers

  • Marco_Boeck
    Marco_Boeck New Altair Community Member
    Hi,

    is there any particular reason why you don't want to take the advice I posted in your other thread here?
    Trying to programmatically create processes is a) tedious and b) error-prone, so it is discouraged.

    Regards,
    Marco
  • kemoc
    kemoc New Altair Community Member
    Marco Boeck wrote:

    Hi,

    is there any particular reason why you don't want to take the advice I posted in your other thread here?
    Trying to programmatically create processes is a) tedious and b) error-prone, so it is discouraged.

    Regards,
    Marco
    I got task from my academic teacher, where RM must read data from Java code and show part of that data in a chart, another part data in each iteration.
  • kemoc
    kemoc New Altair Community Member
    Could somebody help? Please.
  • Marco_Boeck
    Marco_Boeck New Altair Community Member
    Hi,

    the "Execute script" operator can take inputs and deliver them to the according output ports - if you do so in the script.
    So for example when you deliver an ExampleSet, you need to return it inside the script:

    ExampleSet exampleSet = input[0];
    [...]
    return exampleSet;
    You don't need to call the output ports directly.


    Regards,
    Marco
  • marcin_blachnik
    marcin_blachnik New Altair Community Member
    Look at your code and check what you are doing - do you really want to "receive" data from output port ? Or maybe you want to "deliver" data to the output port.

    Best
    Marcin

Welcome!

It looks like you're new here. Sign in or register to get started.

Welcome!

It looks like you're new here. Sign in or register to get started.