Skip to content

How to model data flow on custom node types? #196

@felipe-xavier-foodtosave

Description

So basically, I’m trying to create a custom node type that will generate a random number and connect to another node. By the way, this is a workaround because I couldn’t develop a custom node with two outputs (like “40% goes to this node and 60% goes to that node”). Anyway, I’m struggling because when I run the backend, it’s not sending the passthrough (since I don’t want any input), so it fails.

How can I create a custom node and change the passthrough behavior?

export const loadNode = createJdmNode({
    kind: 'pingNode',
    displayName: 'Ping',
    group: 'ping',
    icon: '*',
    shortDescription: 'Passthrough node',
    handleLeft: true,
});

When i run the simulation is like this:

{
   "type":"customNode",
   "content":{
      "kind":"pingNode"
   },
   "id":"296b00e8-f103-4706-977d-12e96613ccc0",
   "name":"pingNode1",
   "position":{
      "x":605,
      "y":200
   }
}

Which is a problem i guess since there is not input and also no passThrough and my backend returns error code 5

Probably it would work if my custom node was sent like this:

{
   "type":"customNode",
   "content":{
      "kind":"pingNode"
      "passThrough": true,
   },
   "id":"296b00e8-f103-4706-977d-12e96613ccc0",
   "name":"pingNode1",
   "position":{
      "x":605,
      "y":200
   }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions