I’ve played around with node.js, and had limited success. I was able to get node.js jobs running via an external interpreter for jobs of type Interpreter. But :REGISTER_VARIABLE wasn't working. I discovered that on my system, REGISTER_VARIABLE.WINDOWS (in client 0) is configured so that :REGISTER_VARIABLE will work only for jobs of type BAT.
:set &uc_register_varname = sys_last_registered_varname()
:set &uc_register_valuename = sys_last_registered_valuename()
:set &uc_register_otype# = sys_act_me_type()
:if &uc_register_otype# = 'JOBS'
: set &uc_windows_typ = get_att(win_typ)
: if &UC_WINDOWS_TYP = "BAT"
&UC_JOBMD JNR=&UC_REALNR MNR=&UC_MANDANT PNR=&UC_IP_PORT IPA=&UC_IP_ADR TYP=V VTYPE=T NAME=&uc_register_varname VALUE="&uc_register_valuename"
: endif
:endif
If you turn on extended reports and look at the Script tab of the report, you can see where :REGISTER_VARIABLE is being expanded. (In this context, :REGISTER_VARIABLE is shortened to just :RGSTV).
var var1 = "Hello, world.";
console.log(var1);
:RGSTV VARIABLE_1#,var1
:set &uc_register_varname = sys_last_registered_varname()
:set &uc_register_valuename = sys_last_registered_valuename()
:set &uc_register_otype# = sys_act_me_type()
:if &uc_register_otype# = 'JOBS'
: set &uc_windows_typ = get_att(win_typ)
: if &UC_WINDOWS_TYP = "BAT"
&UC_JOBMD JNR=&UC_REALNR MNR=&UC_MANDANT PNR=&UC_IP_PORT IPA=&UC_IP_ADR TYP=V VTYPE=T NAME=&uc_register_varname VALUE="&uc_register_valuename"
: endif
:endif
:END_EXT_INT NODEJS
/h
Making the command run for other cases is not enough though. In addition, the job messenger command will have to be updated for the special case where &$EXT_INTERPRETER# = "NODE" because the syntax will be different from inside node.js. If I get time, I might experiment more with it later.