try {
humanService = new HumanService(peopleActivity, B4PServiceComponent.getClientConfigurationContext(),
B4PServiceComponent.getHttpConnectionManager());
} catch (AxisFault axisFault) {
log.error("Error while initializing Human Service: " + peopleActivity.getServiceName(), axisFault);
throw new FaultException(new QName(B4PExtensionBundle.NS, axisFault.getMessage()), axisFault);
}
//org.apache.ode.bpel.iapi.Message response = humanService.invoke();
if (peopleActivity.getActivityType().equals(InteractionType.TASK)) {
taskID = humanService.invoke();
if (taskID == null) {
log.error("Task ID not found for the Human Task invoked.");
throw new FaultException(new QName(B4PExtensionBundle.NS, "Task ID not found for the Human Task invoked."));
}
if (log.isDebugEnabled()) {
log.debug(taskID + ": FeedBack Received");
}
CountDownLatch cdl = new CountDownLatch(1);
//countDownLatch = cdl;
countDownLatches.put(taskID, cdl);
AxisService callbackService = null;
try {
callbackService = CallbackServiceFactory.getCallbackService(peopleActivity.getCallbackServiceName(),
peopleActivity.getCallbackServicePort(),
B4PServiceComponent.getConfigurationContext().getAxisConfiguration(),
peopleActivity.getCallbackWSDL(), peopleActivity.getCallbackOperation());
} catch (AxisFault axisFault) {
log.error("The callback service not found for the service: " + peopleActivity.getCallbackServiceName(),
axisFault);
throw new FaultException(new QName(B4PExtensionBundle.NS, axisFault.getMessage()), axisFault);
}
if (callbackService == null) {
log.error("The callback service not found for the service: " + peopleActivity.getCallbackServiceName());
throw new FaultException(new QName(B4PExtensionBundle.NS, "The callback service not found for the service: "
+ peopleActivity.getCallbackServiceName()));
}
try {
if (log.isDebugEnabled()) {
log.debug(taskID + ": Waiting For the response");
}
cdl.await();
if (log.isDebugEnabled()) {
log.debug(taskID + ": Latch is continueing");
}
} catch (InterruptedException e) {
log.error("The thread is interrupted. TaskID: " + taskID, e);
throw new FaultException(new QName(B4PExtensionBundle.NS, e.getMessage()), e);
}
writeOutputVariable();
} else {
humanService.invoke();