on 05-25-2016 9:36 AM
Hi All,
I have a XSJS that I need to run :
The XS job file looks like the below:
{
"description": "Valid description",
"action": "package_path::file name",
"schedules": [
{
"description": "Valid description",
"xscron": "* * * * 9 * 59",
"parameter": {
}
}
]
}
As soon as it is run, it goes into error saying ERROR and that's all the log we get.
This is the first time we are attempting to run a XS job. So I assume we are missing some settings or that there is a problem in the above code.
The XSJS on its own runs fine, only when it is called from the scheduler, it shows an error. The log cleanup tab shows a lot of things as not configured.
Could this be a problem? Please let me know. Thanks.
Hello Shyam,
can you provide the information who you have added the XSJS function to the job definition. In your "pseudo" information you wrote "package_path::file_name", which indicates that you provided only the XSJS file name. But in that case a function has to be provided ("package_path:file_name::function_name).
Best Regards,
Florian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Florian,
Sorry for the incomplete information.
Yes- the function name is mentioned.
For some reason, when run from the XS dashboard, it tries to execute the Catch block of the xsjs script and says $.response is undefined.
If I call the function directly in JS, it works perfectly fine but somehow not from the scheduler.
Regards,
Shyam
Hello Shyam,
objects like $.reponse and $.request are not available in that situation, cause the xsjs coding is not executed in a kind of web-usage (so the web request/response objects are not there -> the job scheduler does not provide request information and does not handle the response object).
I assume, your test which was executed successfully, is done calling the xsjs in the browser, right?
Regards,
Florian
You would need to encapsulate in a function in XSJS and call it for it to work
Regards,
Krishna Tangudu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Shyam,
I guess when using .xsjs file you might have set response parameters to check the result in the response. Do remove the response settings from your xsjs file and it should work fine.
if you have mentioned something like this in your script
$.response.contentType = "application/xml";
$.response.setBody(response.body.asString());
$.response.status = $.net.http.OK;
Try removing them and then execute
Regards,
Krishna Tangudu
User | Count |
---|---|
84 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.