Hi Jeff,
Here is the complete code:
here is my static inner class,
public static class CancelTriptaskOperation implements DeferredTask,
Serializable {
private PackageEnqFormDTO enq = null;
Objectify objectifyDeferred = ObjectifyService.begin();
public CancelTriptaskOperation(final PackageEnqFormDTO enq1) {
this.enq = enq1;
}
@Override
public void run() {
try{
enq.setStatus(YFConstant.CANCELLED_ENQUIRY);
LinkedHashMap<String, PackageConversationDTO> convMap =
enq.getLeadAndConvMap();
Set<String> keys = convMap.keySet();
Iterator<String> itr = keys.iterator();
while(itr.hasNext()) {
String key = itr.next();
PackageConversationDTO convDto = convMap.get(key);
convDto.setStatus(YFConstant.CANCELLED_TRIP_PACKAGE_CONVERSATION);
convMap.put(key, convDto);
}
objectifyDeferred.put(enq);
List<HolidayInvoiceDTO> list =
objectifyDeferred.query(HolidayInvoiceDTO.class).filter("tripId",
enq.getId()).list();
for(HolidayInvoiceDTO holiday : list) {
holiday.setStatus(YFConstant.INVOICE_GENERATED_THEN_TRIP_CANCELLED);
objectifyDeferred.put(holiday);
}
}catch (Exception e) {
System.out.println("CommonRpcServiceImpl.TaskOp.run() "+e.getMessage());
}
}
}
Here is my method in outer class:
@Override
public boolean cancelTripEnquiry(final PackageEnqFormDTO enq) {
try{
TaskOptions taskOpt = TaskOptions.Builder.withPayload(new
CancelTriptaskOperation(enq));
Queue defQueue = QueueFactory.getDefaultQueue();
defQueue.add(taskOpt);
}catch (Exception e) {
System.out.println("CommonRpcServiceImpl.cancelTripEnquiry()
"+e.getMessage());
}
return true;
}
Hope the code is understandable.
Thanks
Deepak
On Wed, Apr 18, 2012 at 5:27 AM, Jeff Schnitzer <[email protected]> wrote:
> On Tue, Apr 17, 2012 at 6:25 PM, Deepak Singh <[email protected]>
> wrote:
> > Still no luck. is it a problem with Objectify ?
>
> That is extraordinarily unlikely.
>
> You'll have to post a lot more code if you want help.
>
> Jeff
>
--
Deepak Singh
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en.