Hi Steffen,
I started a new account from a different email 
I decided to go with 4.7 version itself as custom nodes were not present in 4.6 documentation. Now I am able to create custom ports but output port created by one node is not being able to be passed as input port to the next node.
The below is my code.
I defined the my custom node in a file called myfile.py
class MyPortObjectSpec(knext.PortObjectSpec):
def __init__(self, spec_data: str) -> None:
self._spec_data = spec_data
def serialize(self) -> dict:
return {"spec_data": self._spec_data}
@classmethod
def deserialize(cls, data: dict) -> "MyPortObjectSpec":
cls(data["spec_data"])
@property
def spec_data(self) -> str:
return self._data
import pickle
class MyPortObject(knext.PortObject):
def __init__(self, spec: MyPortObjectSpec, model) -> None:
super().__init__(spec)
self._model = model
def serialize(self) -> bytes:
return pickle.dumps(self._model)
@classmethod
def deserialize(cls, spec: MyPortObjectSpec, data: bytes) -> "MyPortObject":
return cls(spec, pickle.loads(data))
def predict(self, data):
return self._model.predict(data)
my_model_port_type = knext.port_type(name="My model port type", object_class=MyPortObject, spec_class=MyPortObjectSpec, id="0001")
In above code I create a nodetype with id=0001. I want this node to be output of first node and input of the next node.
Now in my first node I use
@knext.node(name="My Template Node", node_type=knext.NodeType.LEARNER, icon_path="icon.png", category="/")
@knext.output_port("Trained Model", "Trained fancy machine learning model", port_type=myfile.my_model_port_type)
class TemplateNode:
def configure(self, configure_context, input_schema_1):
return myfile.MyPortObjectSpec("sdada")
def execute(self, exec_context, input_1):
return myfile.MyPortObject(myfile.MyPortObjectSpec("sdada"),{"a":1})
In the second node which should get the output of this node as input I try to use.
@knext.node(name="New node 1", node_type=knext.NodeType.LEARNER, icon_path="icon.png", category="/")
@knext.input_port("Trained Model", "Trained fancy machine learning model", port_type=myfile.my_model_port_type)
class TemplateNode:
def configure(self, configure_context, input_schema_1):
pass
def execute(self, exec_context, input_1):
pass
But this does not work I get the below error
AssertionError: Expected input port ID 0001 but got org.tutorial.first_extension.myfile.MyPortObject