[SOLVED] SendToSingle outputs nothing

Post Reply
loicaigon
Advanced member
Posts: 373
Joined: Wed Jul 10, 2013 10:22 am

[SOLVED] SendToSingle outputs nothing

Post by loicaigon »

Hi,

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 :P

TIA
Loic
Last edited by loicaigon on Wed Jun 21, 2017 2:34 pm, edited 1 time in total.
loicaigon
Advanced member
Posts: 373
Joined: Wed Jul 10, 2013 10:22 am

Re: SendToSingle outputs nothing

Post by loicaigon »

Ok I got it.
So for whoever this may help, I ended doing :

var jobName = job.getName();
var copyPath = s.createPathWithName (job.getName());
s.copy ( job.getPath(), copyPath);
outJob = s.createNewJob();
outJob.sendToSingle( copyPath,jobName );
Post Reply