lutzer / node-red-contrib-finite-statemachine

A finite state machine implementation for node red.
MIT License
16 stars 5 forks source link

FSM deletes all properties of msg #12

Closed RSWilli closed 3 years ago

RSWilli commented 4 years ago

I'm using the FSM for a light switch. I have an http entry that either sets the the light state or triggers a "test" transition, which is a loop on the current state, to get the state the machine is in (which would be a nice feature if this was a native feature btw :D).

My problem is, that since the FSM deletes the req and res properties on msg, I cannot send the resulting state back to the client.

Would it be possible, that payload and topic are changed, but the rest of the incoming msg object stays the same?

lutzer commented 3 years ago

hey. sorry for taking so long to respond to this. the current structure of the statemachine does not allow to forward the original message easily. maybe its possible in your case to save the original msg in a flow variable and merge it later on with the statemachine output?

RSWilli commented 3 years ago

yeah i am taking a different route by now. I looked at the code and figured that such a change would not be easy