Page 1 of 1

ALH functions using variable arguments

PostPosted: Wed Apr 14, 2021 11:28 am
I would like to use variables as inputs to the arguments for ALH.callBehavior, but it doesn't seem to be working. I've tried a few different things, including changing the type of the variable to a string.
See attachment with simple setup.

I get the error:
org.mozilla.javascript.WrappedException: Wrapped java.lang.IllegalArgumentException: cannot find the behavior with the specified name.

Is there anyway to address this? This is a simple case, but in reality I intend to have many different functions that I want to call dynamically based on signal inputs. Or is there a better way to go about this?


Re: ALH functions using variable arguments [RESOLVED]

PostPosted: Fri Apr 23, 2021 1:44 pm

It requires to opaque behaviors: 1 to get the signal attribute value which outputs a String, and 2 to call the Behavior with the input string name.

I'm not showing it here, but there is an Operation (and associated Opaque Behavior) called "do_func". Therefore the ALH.callBehavior function is able to operate with a variable string!