How to Create Nodes with dynamic names and get output reference?
See original GitHub issueOk, I have a educational project where I need to create a bot using a nonSQL DB (firebase, mongodb etc). I’ll try my best to explain what I’m trying to do:
So, I have a chat bot, where it’s structure is object oriented, where the object names matters, and each object is composed by, A Text and it’s next steps. All object steps are structured the same way.
example of S Objects (S is just a prefix for the object name):
s0: {
text: "Hello and welcome to botchat."
nextStep: {
"1": { description: "show Website link", target: "s1"}
"2": { description: "end chat", target: ""}
}
}
s1: {
text: "some website here."
nextStep: {}
}
I have a backend to treat it, so don’t really mind so much how it works, So, what I am trying to do is create a Node where it acts like these S Objects. I tried some ways, but didn’t get it working as intended…
My questions are,
How to make an Node take an Output connection and read it’s destination, so it can make a reference to this destination node inside the nextStep object (inside target).
And is there a way to make nodes get a unique name? if there’s only one S Node, it’s name should be s0, and every new object inserted should be named with a new number, like s1, s2, s3, s4…
I didn’t figure out how to do it with rete, maybe I could invert output and input (I mean, their CSS’s, their positions) so I could take a reference of the last object, and pass the information I want, since output can’t have controllers. Well, I hope someone can help me with this, it’s been frustrating to make it work…
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (3 by maintainers)
@creadicted I am using Angular. I’ll probably just use css to control the input box and output socket positions, so they stay aligned. And about the input box, I’ll try to read info from the input and place it in a variable, and the socket outputs this variable, I don’t know how to do this part yet (not using rete) but I think it will work.
If I get it working, I can share it! No problems
Node name must be predefined (like function name in programming languages)
editor.toJSON() returns scheme where you can find
output
->connections
propertiesThis is done inside
Rete.Engine
when processing. I think you should convert your schema to compatible Rete.js scructure