// locate the dispatcher to use
LocalDispatcher dispatcher = this.getDispatcher();
// get the job manager
JobManager jm = dispatcher.getJobManager();
if (jm == null) {
throw new WfException("No job manager found on the service dispatcher; cannot start activity");
}
// using the StartActivityJob class to run the activity within its own thread
try {
Job activityJob = new StartActivityJob(activity, req);
jm.runJob(activityJob);
} catch (JobManagerException e) {
throw new WfException("JobManager error", e);
}
// the GenericRequester object will hold any exceptions; and report the job as failed