how to use asyncronous submitJob and get back job status on server?

741
2
Jump to solution
06-27-2013 07:49 AM
eddiequinlan
Occasional Contributor
Ok, I must be missing something simple......

I have an asyncronous job to create printable maps on the server.  Currently this is accomplished by

MapPrintTask.submitJob(printingparams);

However, I would like to receive the status of the jobs as they are processing.  Therefore, I am trying to use the submitJob task as briefly explained in the esri help.  submitJob(printingparams, 'some responder', 'some status responder')

As in my case I'm doing it as such:  submitJob(printingparams, myResponder, myStatus);

function myResponder():void
{
do something
}

function myStatus():void
{
do something
}

I can't get the two responders to work properly and get the following error.........

Description Resource Path Location Type
1067: Implicit coercion of a value of type Function to an unrelated type mx.rpc:IResponder.

I'm not sure how the responders work to invoke the function/tasks?

thanx,
Eddie
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
PaulHastings1
Occasional Contributor
signature for submitJob says those two functions need to use "IResponder" so maybe something like:

MapPrintTask.submitJob(
printingparams,
new AsyncResponder(myResponder,myResponderFaultHandler),
new AsyncResponder(myStatus,myStatusFaultHandler)
);

private function myStatus(event:JobInfo,token:Object=null): void {
// do stuff based on event.jobStatus
}

View solution in original post

0 Kudos
2 Replies
PaulHastings1
Occasional Contributor
signature for submitJob says those two functions need to use "IResponder" so maybe something like:

MapPrintTask.submitJob(
printingparams,
new AsyncResponder(myResponder,myResponderFaultHandler),
new AsyncResponder(myStatus,myStatusFaultHandler)
);

private function myStatus(event:JobInfo,token:Object=null): void {
// do stuff based on event.jobStatus
}
0 Kudos
eddiequinlan
Occasional Contributor
Hi Paul,

Thanx for the help.... that did the trick.  I new it was looking for a responder, but I wasn't sure how to set the responder up.

Sincerely,
Eddie
0 Kudos