@Override
public void recordHeartbeat(String details) throws CancellationException {
RecordActivityTaskHeartbeatRequest request = new RecordActivityTaskHeartbeatRequest();
request.setDetails(details);
request.setTaskToken(taskToken);
ActivityTaskStatus status = service.recordActivityTaskHeartbeat(request);
status = service.recordActivityTaskHeartbeat(request);
if (status.isCancelRequested()) {
throw new CancellationException();
}
}