So I'm fairly new to writing scripts from scratch and not just hacking others, and I wanted to be able to print some messages in the log for debugging, and thought it would be really handy to just put something like:
System.log("Workflow: " + currentWorkflow);
System.log("Script: " + currentScript);
Is the current workflow and/or script names available as pre-defined variables already?
I am not sure about calling a variable but why not create a title variable in any workflows and call from there
For workflows, you can use one of these:
System.log("Root workflow name: " + workflow.rootWorkflow.name);
System.log("Current workflow name: " + workflow.currentWorkflow.name);
For scripting actions, try the following (note: this is a bit low-level, implementation-specific code that may change in future versions)
var actionName = arguments.callee.name.substr(6);
System.log("Currently running action: " + this.name + "." + actionName);
I found this is another thread, and since I'm getting errors I wonder if support for it's been dropped?
ReferenceError: "arguments" is not defined.
That's the error I get when I tried to use it.
I did a quick test in my environment; seems to work fine.
Which vRO version do you use?
Also, are you sure you put the action name logging code inside an action element? If you put them inside eg. scriptable task element, you'll get reference errors.