add new output port to shared component

Hi, i have a shared component and i need to add a new output port.

when i have a non shared component i know how to do it with the setup menu:

But in a saved component like this:

image

i dont know how to do it. If i open the component i have this:

and i can’t find how i can add a new output port. can someone help me?

thanks

Hello @Pablo
As far as I know, a shared component has an owner administration, then editing the setup is blocked.

If you want to edit a shared component you can disconnect the component from reference Hub, by ‘Disconnect Link’ option. Then it will be available for customization purposes.

BR

4 Likes

Hi @Pablo a shared component can be modified, but at the source only - which will then prompt all the workflows that use the shared component to update the shared component in the workflows to the new “version” of it.

If you want to modify a shared component in a specific workflow only, you can’t use it as a shared component anymore, you have to disconnect/unlink it (unshare) from the source and then be able to modify it, but it won’t be a shared component anymore.

2 Likes

thanks, by the moment thats the only way i founded. my wish wash to edit de shared component so then i can update it in all workflows where i’m using it.

thanks

hi! my wish was to modify it for all the workflows where im using it. I know its posible to modify the shared component at the source. But i cant add a new output port in the source.

i’ll create a new component with the output ports that i need and i will share it again

i think it would be a good option that knime let us to modify the ports of a shared component

thanks

Hi @Pablo , ok I did not have Knime opened when I was writing my comments, and did not realize that Knime did not allow adding and output port the way you were describing it.

I can see why Knime does not allow modifying the ports on the shared components as this has potential of breaking workflows that already use the shared components, though adding an output port in particular should generally be safe. Any other modifications of ports would not be safe, but it’s probably not as straight forward on their side to allow only addition of output ports.

2 Likes

I have found the inability to add input and output ports to an existing component to be an irritation as well. I often like to add additional optional capabilities to my components at a later date like inputs to pre-load settings, or outputs for backup or to communicate settings to another downstream component.

1 Like

I’d recommend adding a new topic in #feedback and gather some votes for it :slight_smile:

1 Like

Hi @iCFO , just to expand on the issue that I mentioned above.

As with any node, you cannot start a workflow with a node that has an input data port for example. It has to start with a node without an input data port (unless it’s an optional port). The same goes with components.

Now, let’s say you create a Component that does not have an input data port. You then use this component as a shared component in several workflows, which is fine. But if you modify that Component at source and add an input data port, this would break the workflows that use that component and do not have any connected upstream data to it.

Adding an output data port on the other hand, should not be an issue as I already mentioned. But I don’t see how Knime is going to separate this and allow only the addition of output ports (or optional input ports).

1 Like

I agree that there are obvious dangers involved in adding new ports on shared components but presumably there is nothing to stop a shared component being added to a workflow, then disconnected, having a new port added to it and then it being re-shared and overwriting the existing shared component… ?

I’ve not tried it but in theory i don’t see that KNIME would prevent it.

[edit: just tried it and KNIME allows me to add ports on a shared component in this way, and then the workflows using that shared component can receive the update, so @Pablo, keeping mind the caveats mentioned by @bruno29a , it can be done, but just be careful you don’t break anything! :wink: ]

3 Likes

Thanks @takbb

With great power comes great responsibility :smiley:

1 Like

Thanks takbb. i’ve finally done like you said. and it works

1 Like

Hi @takbb
Just to confirm. Did you update an other user’s shared component in hub? I mean, was it initially shared in a hub were you cannot login, edited and updated it?

I see it logical that you can disconnect the link and edit it as an open source code, then re-share it as a new ‘inspired by’ component but… is a security problem to be concerned if the case

BR

Hi @gonhaddock , no I was only referring to updating a shared component of my own, and for my own test I didn’t update one I’d shared on the hub, but simply a component I’d shared into my own local file system and used by a number of my workflows.

If I were to download and disconnect somebody else’s component from the hub, then change it according to my needs, KNIME would only let me re-share it to a location I have write access to, so I’m only seeing this as a way of modifying my own local components. Is that what you meant?

I agree that I wouldn’t expect to be able to update somebody else’s hub component. and also its probably worth me adding that if I’d shared a component on my public hub space, I would certainly be ill-advised to make future changes that add input ports to it, as (assuming it was a popular component!) who knows how many people’s workflows it might break…

1 Like

Hi @takbb . Thanks for clarifying this point.
I could expect the answer, but is good to type it down for the literature purposes, it will help to understand for any user reading this post up to this point.
BR

1 Like

@Pablo @takbb @gonhaddock @bruno29a @ArjenEX

I think we should have a separate designation for “optional inputs / outputs”. They could be turned off by default. I like to continually improve my components over time, without necessarily modifying the core in/out structure. The ability to designate new inputs and outputs as “optional” with an If Switch approach, or a Configuration / Widget setting (or even auto activating when connected) would be useful. That way additions wouldn’t impact existing workflows, and more development can continue freely.

3 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.