Page 1 of 1
Script not starting
Posted: Thu Jan 07, 2016 11:31 am
by Qpdv
I'm testing with a very easy script, but its not starting, the job stays in the folder before the script.
Code: Select all
function jobArrived( s : Switch, job : Job )
{
job.setPrivateData('testcontainer', 'testvalue');
}
How can i Start a script?
Thanks in advance,
Peter
Re: Script not starting
Posted: Thu Jan 07, 2016 2:57 pm
by gabrielp
Hey man, add this line at the end of the jobArrived function:
Code: Select all
job.sendToSingle( job.getPath() );
Re: Script not starting
Posted: Thu Jan 07, 2016 3:46 pm
by Qpdv
Hi, Thanks!
That worked, but does it do? Why doesn't a simple return do the trick?
Peter
Re: Script not starting
Posted: Thu Jan 07, 2016 4:05 pm
by gabrielp
Qpdv wrote:Hi, Thanks!
That worked, but does it do? Why doesn't a simple return do the trick?
Peter
It moves the job to the next connector. There's a few ways to process jobs through Switch scripts so you need to tell Switch what to do. The traffic light version is a little different. You can also do job.fail() and stuff too...
Processing a job in a script usually consists of the following steps:
Decide on how to process the job based on file type etc.
Get the path to the incoming job.
Get a temporary path for one or more output files or folders.
Create the output(s) in the temporary location.
Call one of the sendTo functions for each output.
...
A job remains in the input folder until one of the Job.sendTo() or Job.fail() functions has been called for the job. The jobArrived entry point will be invoked only once for each job, so if the entry point does not call a sendTo() or fail() function for the job, the script should do so at a later time (in a timerFired entry point or in a subsequent invocation of the jobArrived entry point for a different job).
See here:
http://www.enfocus.com/manuals/Develope ... class.html
Re: Script not starting
Posted: Thu Jan 07, 2016 5:07 pm
by Qpdv
Ah... I found the job.fail() method but wasn't aware of the extra required functions, although very understandable actually

.
Thanks again!