Sometimes I find the App trigger mechanism a bit much. For simple triggers, it works great. I have one case, though, where I’m building a state machine. There are 4 states, and one state variable (a number). Each time you get a trigger it figures out what to do with the outer layer of “IF current state ==2 THEN …” and then makes some decisions on what state to advanced to next based on other variables.
What I end up with is something that’s kind of long. It doesn’t all fit on one screen, it’s a little hard to read, and very tedious to initially enter.
As a workaround, I tried it another way: I made a custom widget that has a little tiny HTML that basically just indicates that this logic exists on the Step. I then feed the inputs into the state machine, but let the javascript keep track of the current state. All the state transitions are internal. The javascript can fire off events. There are a number of events, and I also write back variables directly when necessary.
It works great, but in a lot of ways it really goes against the philosophy of no-code / low-code development. What’s important to realize though is that the no-code approach is a little frustrating for more sophisticated users who realize that they can replace a complicated muilti-part trigger with a few, readable lines of code.
This drives home something else I have already asked about, though: it would be nice to be able to insert custom javascript at the Step level, just like you would insert a widget but skip the CSS and HTML. If you do that, then there are no limits. Want some other kind of Aggregation that’s not currently supported? No problem, just write one. Want to compute kurtosis? easy. Give me an easy way to access tables (and the rest of the API) by passing in an ‘api’ object. Then, give me the ability to pull in pandas and numpy and things really start to get wild.
I appreciate that Tulip might not want some of this. I get the concerns, in particular, about impacts on performance and stability. My counterargument, though, is that you can always hose yourself somehow, if I do something that fork-bombs the player that’s kind of my problem. I think the other half of the concern is when that happens someone will call Tulip support demanding answers. I get the concern and sensitivity to things like that.
Regardless … this is all just food for thought, I’m curious what everyone else is doing out there.
–C