Hello All,
I have been trying to find the best way to handle a problem. I use HP composer to handle my VDP impostions. My flow takes the data file, submits a copy to the composer hot folder to generate the pdf, another copy goes to hold where it waits for the output to be found. Once found I replace the text file with the pdf via Inject.
I don't feel like my method for holding a job until output is found works very well. I find jobs getting stuck and having to start and stop the flow to get things moving again. Does anyone have other suggestions on how to better handle this?
My hold element has these parameters and script:
Release Condition with a retry every 30 seconds
Script expression:
var fPath = '\\\\IPAddress\\Composer Presets\\VDP Presets\\POD\\Output\\' + job.getNameProper() + '.pdf';
var fa = new File(fPath);
if ( fa.exists ){
return true;
}
else{
return false;
}
How do others handle sending jobs out to third part processes?
Hold until output is found
Re: Hold until output is found
Try adding a check for hasArrived():
Especially for larger files or files being created in place, it can take a while from the creation of the file to when it is completely written. hasArrived will check the file size twice, and compare the two results. If the file size changes in between the checks, that means the file is not completely written yet, and hasArrived() returns false.
BTW you can make the code quite a bit shorter:
Code: Select all
var fPath = '\\\\IPAddress\\Composer Presets\\VDP Presets\\POD\\Output\\' + job.getNameProper() + '.pdf';
var fa = new File(fPath);
if ( fa.exists && fa.hasArrived( 2 ) ){
true;
}
else{
false;
}
BTW you can make the code quite a bit shorter:
Code: Select all
var fPath = '\\\\IPAddress\\Composer Presets\\VDP Presets\\POD\\Output\\' + job.getNameProper() + '.pdf';
File.exists( fPath) && File.hasArrived( fPath, 2 );
Re: Hold until output is found
Integrating with hot folder based applications can be done with the "Generic application" element.
The folder in front of "Generic application" must (obviously) not be auto-managed, but point to the input hot folder of the hot folder application. The folder after "Generic application" must similarly point to the folder in which the hot folder application generates the output. There could potentially be multiple output folders, one for OK, one for Error, etc. Even when the hot folder application changes the file type Switch will recognize the output(s) as a valid job based on the unique prefix.
This is the normal way of working and does not require the completion checking in "Hold job". However! It may be that this does not work for HP Composer. I know that Composer uses the first part of the file name when it is used for VDP to find a particular template and the unique prefix causes a problem in that case. I do not know about the use for imposition. Check it and let us know.
If you do have to resort to a script expression, then make sure that you do not "return" a value, just state the value. In other words, it is not
but just
The folder in front of "Generic application" must (obviously) not be auto-managed, but point to the input hot folder of the hot folder application. The folder after "Generic application" must similarly point to the folder in which the hot folder application generates the output. There could potentially be multiple output folders, one for OK, one for Error, etc. Even when the hot folder application changes the file type Switch will recognize the output(s) as a valid job based on the unique prefix.
This is the normal way of working and does not require the completion checking in "Hold job". However! It may be that this does not work for HP Composer. I know that Composer uses the first part of the file name when it is used for VDP to find a particular template and the unique prefix causes a problem in that case. I do not know about the use for imposition. Check it and let us know.
If you do have to resort to a script expression, then make sure that you do not "return" a value, just state the value. In other words, it is not
Code: Select all
return true;
Code: Select all
true;