Created
May 12, 2010 12:16
-
-
Save nsdevaraj/398508 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private function resultHandler( rpcevt:ResultEvent, token:Object = null ):void { | |
var resultObj:Object = rpcevt.result; | |
var outCollection:ICollection = | |
updateCollection(serviceSignal.currentCollection, serviceSignal.currentSignal,resultObj); | |
if(serviceSignal.currentProcessor) processVO(serviceSignal.currentProcessor,outCollection); | |
resultSignal.dispatch(rpcevt.result, serviceSignal.currentSignal); | |
signalSeq.onSignalDone(); | |
} | |
private function processVO(process:IVOProcessor, collection:ICollection):void{ | |
process.processCollection(collection.items); | |
} | |
private function updateCollection | |
(collection:ICollection,currentSignal:SignalVO,resultObj:Object):ICollection{ | |
switch(currentSignal.action){ | |
case Action.CREATE: | |
collection.addItem(resultObj); | |
break; | |
case Action.UPDATE: | |
collection.updateItem(currentSignal.valueObject,resultObj); | |
break; | |
case Action.READ: | |
collection.updateItems(resultObj as ArrayCollection); | |
break; | |
case Action.FIND_ID: | |
collection.updateItems(resultObj as ArrayCollection); | |
break; | |
case Action.DELETE: | |
collection.removeItem(currentSignal.valueObject); | |
break; | |
case Action.GET_COUNT: | |
collection.length = resultObj as int; | |
break; | |
case Action.GET_LIST: | |
collection.updateItems(resultObj as ArrayCollection); | |
break; | |
case Action.BULK_UPDATE: | |
collection.updateItems(resultObj as ArrayCollection); | |
break; | |
case Action.DELETE_ALL: | |
collection.removeAll(); | |
break; | |
} | |
return collection; | |
} | |
private function faultHandler( event:FaultEvent, token:Object = null ):void { | |
signalSeq.onSignalDone(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment