Highlighted

Flex + Livecycle + states, without workspace

Avatar

01-12-2008

Hi All,



I'm beginning with livecycle Workbench.

I need develope a process in Workbench, but the customer does not want to use the workspace.

There are 3 flex application that they will send data to process management. The Flex application, is outside workspace.



In the process I must have states that hope that the Flex application causes that they follow.



Please, How Can I do it?

How my Flex App talk with the process management (outside Workspace)?

How I would have design the tasks in the workbench?

(I'm beginning)

Thanks very much



María.

Replies

Highlighted

Avatar

Avatar

JendaDH

Avatar

JendaDH

JendaDH

26-03-2009

Hi,



I am facing simillar issue. You can call tasks (processes) over the WSDL from flex. I can manage short-lived well, however, I am struggling with the long-live as it is async.

I guess that I can invoke the process from flex, however, I can not get back the invokationID or the JobID.

Anyone could help?



Thanks



J.
Highlighted

Avatar

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692
pguerett

26-03-2009

The Long lived process will give you back a process ID. You then need to make subsequent calls to the wsdl using different methods (i.e. Status, Result etc) and use the process ID as input.
Highlighted

Avatar

Avatar

JendaDH

Avatar

JendaDH

JendaDH

26-03-2009

Hi Paul,



I seem to be unable (with my knowledge) to get back the processID. I do invoke the WSDL with the invoke_Async() method, but I do not know how to get the result back in Flex.



I did use the import WSDL function in Flex Builder3 and have this button click function:



public function clickbtn():void

{

var myService:TestidService = new TestidService();

myService.invoke_Async();

//I assume that I either have to add event listener, or invoke another request for the process ID

}



Could you please share some code with me if possible?

Thanks a lot in advance.



J.
Highlighted

Avatar

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692
pguerett

26-03-2009

I am not a Flex person but isn't there a result object created that you have to query to get the result back?
Highlighted

Avatar

Avatar

JendaDH

Avatar

JendaDH

JendaDH

26-03-2009

Hi Paul,



it seems that the method invoke_async() itself can be assigned to AsyncToken from RPC services, but I have no clue how to handle that object...
Highlighted

Avatar

Avatar

Steve_L_Walker

Total Posts

1.4K

Likes

197

Correct Answer

212

Avatar

Steve_L_Walker

Total Posts

1.4K

Likes

197

Correct Answer

212
Steve_L_Walker

26-03-2009

Maria,<br /><br />I would recommend taking a look at<br /><br />http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/help/wwhelp/wwhimpl/js/html/wwhelp.htm?&accessible=true<br /><br />Invoking LiveCycle ES Using APIs > Invoking LiveCycle ES Using LiveCycle Remoting<br /><br />There is nothing special about a Flex app calling LiveCycle. It goes something like this:<br /><br />1. You build a long-lived process in Workspace ES. Let's call the process 'FlexToWorkspace'. The process includes an input variable of type 'xml' (or whatever format you prefer) and name it 'vendorData', a SetValue operation to get the input xml, and an Assign Task operation. <br /><br />2. You build a Flex and define a remote object call to the process<br /><br /><mx:RemoteObject id="ro" destination="FlexToWorkspace" <br /> result="handleResult(event)" fault="handleFault(event)"/><br /><br />3. You define a function to bind the data from the Flex form to an string.<br /><br />private function buildXmlStr():String {<br /> var xmlStr:String = "<vendor>"<br /> + "<name>" + vendor.text + "</name>"<br /> + "<city>" + vendorCity.text + "</city>"<br /> ... <br /> + "</vendor>";<br /> return (xmlStr);<br />}<br /><br />4. You define a function to call buildXmlStr() and invoke the remote object representing the LiveCycle process. Note that invoke binds the variable 'xmlData' to the input variable 'vendorData' defined in the LiveCycle process.<br /><br />private function callLiveCycle():void {<br /> var xmlData:XML = XML(buildXmlStr());<br /> ro.invoke_Async({vendorData:xmlData});<br />}<br /><br />5. You define handlers.<br /><br />private function handleResult(event:ResultEvent):void {<br /> // do something<br />}<br />private function handleFault(event:FaultEvent):void {<br /> var faultObj:Object = event.fault;<br />}<br /><br />Steve
Highlighted

Avatar

Avatar

Steve_L_Walker

Total Posts

1.4K

Likes

197

Correct Answer

212

Avatar

Steve_L_Walker

Total Posts

1.4K

Likes

197

Correct Answer

212
Steve_L_Walker

26-03-2009

Jan,



For an asynchronous remote object call, the job id is available in the resultEvent object.



private function handleResult(event:ResultEvent):void {

jobId.text = event.result.jobId;

}



Steve
Highlighted

Avatar

Avatar

JendaDH

Avatar

JendaDH

JendaDH

26-03-2009

S L Walker,



thanks a thousand times. I will try it right now.

Best,



Jan
Highlighted

Avatar

Avatar

JendaDH

Avatar

JendaDH

JendaDH

26-03-2009

Hi S L Walker,

I might be the dummest person here. I cant get it working.
I have a long-live process on the livecycle called "dlouhy"
in the flex app, I create the remote object:


(I tryed with the mx:method specs too)

than I have the invoke on the button click:
ro.invoke_Async();

(livecycle process has no input variables)

than I have the event handler:
private function necoo(event:ResultEvent):void
{
trace(event.result.jobId);
}

If I run it, I get error that dlouhy is unknown. In the documentation you have send me, there is something about channels. I cant get that to work too 😞
Sorry to bother you with this so much.
Would you know how to set up a channel for the wsdl service for the long-live process called "dlouhy" and bind it to the remote object?
The flex app is on a different server than the livecycle.

Thanks

Jan