Basic workflow, with just one input/attribute, named "theModule" of type "Module".
Selecting any random Module
A scriptable task, with just 2 simple lines of code:
System.log(theModule.actions)
System.log(theModule.actions.lenght)
Line1 will output "undefined"
Line2 will throw a error: "Cannot read property "length" from undefined"
I have personally tested this on both vRO v7.0.1 and vRO v7.1.
I have also confirmation from other people testing this on vRO v7.0.1 and vRO v7.2
Anyway to get this to work?
Or is this a actual bug, that seems to have been in the software for at least the last 3 versions?
Hi,
Try these lines of code instead:
System.log(theModule.actionDescriptions);
System.log(theModule.actionDescriptions.length);
Hi,
Try these lines of code instead:
System.log(theModule.actionDescriptions);
System.log(theModule.actionDescriptions.length);
Thanks Ilian
That works, even though its "undocumented".
What is the "best/correct" way to execute a Action found this way?
And yes, I know this is not the normal way to execute actions, but this is a somewhat different/special scenario.
Would it be something like this:
var methodCall = "System.getModule(\"" + theModule.name + "\")." + theModule.actionDescriptions[0].name + "(" + parameter1 + ", " + parameter2 + ")";
actionResult = eval( methodCall );
I would prefer the following alternative without eval():
actionResult = theModule[theModule.actionDescriptions[0].name](parameter1, parameter2);
In general, usage of eval() should be avoided if possible, for various reasons (including performance and security risks).
Thanks Ilian
I figured that out, with the help of some other vExperts, in the vExpert Slack.
But good to have it confirmed here.