Highlighted

JS and Environments

priyal_b

23-02-2018

Hello members,

I was able to automate the reporting in campaign with java script and workflow (ref. Sending report via workflow )

However, when I try to use the same script in other adobe campaign environment it goes into infinite execution mode and never goes past the java script box.

I could see submit request is taking forever causing java script box to never stop. Here is the script,

Question is is anything wrong with the script or could it be an environment issue?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

var reportName = "deliveryStatistics"

var path = '/usr/local/neolane/nl6/var/' + getOption('NmsTracking_Instance') + '/export/test3'+formatDate(new Date(), "%2D%2M%2Y")+'.xls';

logInfo(path);

var exportFormat = "XLS"; // export format

isAdHoc = false; // is ad hoc?

var _ctx = <ctx _context="selection" _reportContext={reportName} _selection= "107317360" _selectionCount= "1" _schema= "operation" />; //context, campaign pk and count

xtk.report.export(reportName,_ctx,exportFormat,path,isAdHoc); //submit request

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Thanks!

Replies

Highlighted

priyal_b

26-02-2018

I believe so, because I have been using the same path for data extraction process or Direct Mail delivery within workflow.

Its been taking forever to pass the variables or may be creating the report at the location. Any way we can check logs to see which step its taking this long time?

Thanks for reply.

Highlighted

Jean-Serge_Biro

MVP

27-02-2018

Hi Priyal,

Please may you include the API call xtk.report.export into a Javascript try {} clause so in the catch {} clause you can see if an error is relevant (such as timeout or wrong selection parameter) ?

And are you able with Adobe Campaign client to get the report for the deliveryId 107317360 ?

Regards
JS

Highlighted

priyal_b

01-03-2018

Hi Jean,

I am trying how to for try-catch with this...so far no luck.

For other question, in this particular example I am passing operation schema which is report for that campaign id, from outside  yes I am able to get report on that as well as deliveries.

Thanks again!!

Highlighted

Jean-Serge_Biro

MVP

01-03-2018

Hi priyal,

Please may you confirm if you get some error message in the web.log file (on mta server if web resources are published on this server).

I wonder if it is a real time-out or not.

try {
     xtk.report.export(reportName,_ctx,exportFormat,path,isAdHoc); //submit request

}

catch {

     logError("[WKF12345] Error number: " + e); // or use logWarning if the treatment must go on despite this error

}

Regards
JS

Highlighted

priyal_b

02-03-2018

unfortunately as user, I don't get access to logs on the server, but after adding this try catch snippet, the original script errors out. Once of the scripts been running since long time, I wonder if there is any way to kill the workflow?

Thanks!

Highlighted

Jean-Serge_Biro

MVP

02-03-2018

you should find someone that can check that Adobe Campaign instance can write files in the targeted folder on your live environment, as it does with your tests environment. Perhaps privileges are not the same, or the path folder not the same, or whatever that could explain a time-out.

Highlighted

priyal_b

02-03-2018

yup, since the data extraction writes to those export directories, it could be possible the xtk report export has some permission issues in environment, not 100% sure thanks for the direction! I will do more digging.