I have a script that monitors job state and will release a job copy at any state change until it's nullified.
So basically the script operates in two ways. On job receive, it tags the job with e initial state and does nothing else (no exit as I want the job to stay in the input as long as necessary.
Then the timer loop monitors changes and (should) send a job copy to the signle outgoing connection. However this part fails. The job doesn't seem to be moved out. I can't see what I am doing wrong, any hint ?
//on Job arrived
function jobArrived( s : Switch, job : Job )
{
job.setPrivateData("jobStep", "0" );
job.setPrivateData("jobDate", ( new Date().getTime() ) );
s.log ( 3, "JOB RECEIVED" );
}
//on timer fired (short version)
function timerFired( s : Switch )
{
//job is properly referenced to one of the waiting jobs
var copyPath = s.createPathWithName ( job.getName() );
s.copy ( job.getPath()+"/"+job.getName(), copyPath);
outJob = s.createNewJob(copyPath);
outJob.sendToSingle( outJob.getPath(), outJob.getName() );
}
I am expecting the outJob to be moved out but it doesn't and I can't see any errors logged.
This makes me crazy

TIA
Loic