Expand my Community achievements bar.

how do I wait until the workbench process is finished?

Avatar

Former Community Member

Hello,

I had call a process in my flex application? I was wondering how can wait unit the process is finished?

for example, I have following code in a class called loadMember:

private var loadMemberById:RemoteObject = new RemoteObject(PROCESS_LOAD_MEMBER);;

private var memberId:String;

public function LoadMemberManager(id:String)

{

this.memberId = id;

loadMemberById.channelSet = ChannelSetHelper.getRemoteObjectInstance().channelSet;

loadMemberById.addEventListener(ResultEvent.RESULT,handleResult);

}

public function load():void

{

var params:Object=new Object();

params[MEMBER_ID]=memberId;

loadMemberById.invoke(params);

}

// This method handles a successful conversion invocation

private function handleResult(event:ResultEvent):void

{

//Retrieve information returned from the service invocation

var res:Object=event.result;

var member:MemberDTO=res[MEMBER] as MemberDTO;

}

in a method of another class, I do following

var load:loadMember=new loadMember(memberName);

load.load();

//do something here

How can I wait load.load() to finished until do something?

Thanks,

1 Reply

Avatar

Former Community Member

Use an asynchronous request. When invoke is dispatched on an asynchronous request you can store the responder to call later.

See http://livedocs.adobe.com/livecycle/8.2/programLC/common/langref/mx/rpc/AsyncRequest.html

Steve