what do you have loaded into memory when you run that command ?
Here is what I ran.
The prompt is DC1PRBLTS13%.
DC1PRBLTS13% blcli_execute NSHScriptJob getDBKeyByGroupAndName "/USS Job Workspace/Present Services/Portal/Users/Narahari" "ScriptTester"
DC1PRBLTS13% blcli_execute NSHScriptJob getNSHScriptParamValues
This is the exact set of commands that is resulting in the error.
You need to supply the JobKey to NSHScriptJob getNSHScriptParamValues
JOB_KEY=`blcli NSHScriptJob getDBKeyByGroupAndName $JOB_FOLDER $JOB_NAME`
JOB_PARAMETER_VALUES=`blcli NSHScriptJob getNSHScriptParamValues $JOB_KEY`
Thanks Jim for that answer. Unfortunately it gave a diff error for me. I think the getNSHScriptParamVAlues does not take any args. Not sure if I need to setup something else before I make the call.
Here is what I see.
blcli_execute NSHScriptJob getDBKeyByGroupAndName "/USS Job Workspace/Presentation Services/Portal/Users/Narahari" "ScriptTester"
blcli_execute NSHScriptJob getNSHScriptParamValues $jobKey
Command execution failed. com.bladelogic.om.infra.cli.factory.CommandNotFoundException: Found command 'NSHScript
Job.getNSHScriptParamValues' but with mismatching arguments. : java.lang.IllegalArgumentException: Wrong number
of arguments provided to method : getNSHScriptParamValues expected : 0 received : 1
what version of bsa are you using ? there was a defect w/ this command in some versions. it looks like in 8.6 we fixed it and released it.
This is what I see when I do Help->About.
"We use BLA console version (and I presume BL version too) of 8.2.04.484"
I presume that the version that I have mentioned 8.2.04.484 is the one with the API bug.
Having said that, the work around then is to change the parameter on the NSHScript itself and save it and make it non editable.
How to tell the calling job to either not pass any parameters (from inside of the UI)
tell the NSHScript to ignore all parameters from the calling Job and use the default values only.
I need this workaround till that API getNSHScriptParamValues can be used by me aka when we move to 8.5.
Thank You for the answer. I tried that and I am still getting NPE.
Is 8.2.04.484 version 8.2 SP4 ?
It looks like there was a special patch to fix that issue for that particular company.
the defect was found in 8.3.03, and apparently it's an issue in 8.2.04. it works in 8.5 and later. why do you need this ?
Sorry for the delayed response.
Let us say that my NSHScript has 4 parameters(all required) and then there is a NSHScriptJob that has to pass the parameters for the job to work.
For that the pseudo code is
jobGroup="/USS Job Workspace........"
... get the db key so the job group and name is validated
Utility setTarget nshscriptparamvalues
Utility storeTarget nshscriptparamvalues
NSHScriptJob clearNSHScriptParamValuesByGroupAndName $groupName, $jobName
for......loop thru the nshscriptparamvalues
if $paramname = $param_name_for_hello_param
NSHScriptJob addNSHscriptParameterValueByGroupAndName $groupName, $jobName, $theindex, $defval
Hence I need that call to work.
Also when the clearNSHScriptParamValuesByGroupAndName is called, what will be the value of parameter values ? Is it empty or is it reset to the ones that has been defined when the job was created ?
if you just need to set the parameters you don't need to get them first. you run the 'clear' and then you set each one by index number. iirc it reverts to the default set in the script if you clear it.
Right, that is an issue.
So if the NSHScript has 4 parameters
param1=b param2=d param3=f param4=h
where 'a' is the first parameter.
NSHScriptJob name is "CoolColumbus"
Now in the NSHScriptJob, when I created the job using the UI, the 4 parameters have diff values assigned.
param1=x param2=y param3=z param4=n
Now inside my new job (name of the new job is MyCoolNewJob) that I write, I want to refer to the CoolColumbus job and only want to change the value of parameter param3 and param4 leaving the values for param1 and param2 to be what is in the job(x and y respectively) not in the script (b or d).
When the clear on the CoolColumbus jobs is called from inside of the MyCoolNewJob, what is going to happen
Will the CoolColumbusJob have the default values of x,y,z,n or b,d,f,h ?
Sorry for the long post but I wanted to explain right.
1 of 1 people found this helpful
that's not how it was built. to set the values you always have to clear everything and start over. i wrote a script to kind of hack it - i think it was to reset the 'use' flag but that would also work w/ the values i think, assuming you don't hit the npe. in 8.5 it looks like we fixed the npe and provided a released command so you can do what you are trying to do.
8.2 is almost out of support so it's unlikely we are going to fix it in 8.2.