ALH functions using variable arguments

Moderator: Moderators

ALH functions using variable arguments

Postby btalbert-goldstein@draper.com » Wed Apr 14, 2021 11:28 am

Hello,
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?

Thanks,
You do not have the required permissions to view the files attached to this post.
btalbert-goldstein@draper.com
Forum Newbie
Forum Newbie
 
Posts: 5
Posts Rating:0
Joined: Thu Apr 08, 2021 1:20 pm

Re: ALH functions using variable arguments [RESOLVED]

Postby btalbert-goldstein@draper.com » Fri Apr 23, 2021 1:44 pm

RESOLVED:

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!
You do not have the required permissions to view the files attached to this post.
btalbert-goldstein@draper.com
Forum Newbie
Forum Newbie
 
Posts: 5
Posts Rating:0
Joined: Thu Apr 08, 2021 1:20 pm


Return to Cameo Simulation Toolkits

Who is online

Users browsing this forum: No registered users and 0 guests