Testing to see if a folder exists in a location
Posted: Wed Mar 12, 2014 7:12 pm
I have a flow that will reach out and grab a folder from a location and injects it into a flow via metadata.
What i need is;
if (folder exists){current code}
else {send email}.
I have tried the job.getFileCount() but I couldn't retrieve a value with a location path.
Any suggestions would be helpful.
Thanks,
PH
function jobArrived( s : Switch, job : Job )
{
var JobNumber = job.getVariableAsString('[Metadata.Text:Path="/field-list/field[2]/field-list/field/value",Dataset="Submit",Model="XML"]');
var theSourcePath = job.createPathWithName( JobNumber );
s.copy( "/Users/prinergy/Desktop/Fake jobs/"+JobNumber, theSourcePath );
job.sendToSingle( theSourcePath );
job.sendToNull( job.getPath() );
s.log(1,JobNumber);
}
What i need is;
if (folder exists){current code}
else {send email}.
I have tried the job.getFileCount() but I couldn't retrieve a value with a location path.
Any suggestions would be helpful.
Thanks,
PH
function jobArrived( s : Switch, job : Job )
{
var JobNumber = job.getVariableAsString('[Metadata.Text:Path="/field-list/field[2]/field-list/field/value",Dataset="Submit",Model="XML"]');
var theSourcePath = job.createPathWithName( JobNumber );
s.copy( "/Users/prinergy/Desktop/Fake jobs/"+JobNumber, theSourcePath );
job.sendToSingle( theSourcePath );
job.sendToNull( job.getPath() );
s.log(1,JobNumber);
}