Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Flex + Livecycle + states, without workspace

Avatar

Former Community Member
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.
12 Replies

Avatar

Level 2
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.

Avatar

Former Community Member
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.

Avatar

Level 2
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.

Avatar

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

Avatar

Level 2
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...

Avatar

Former Community Member
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

Avatar

Former Community Member
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

Avatar

Level 2
S L Walker,



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

Best,



Jan

Avatar

Level 2
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

Avatar

Level 2
Hi,



I did manage to invoke the long-live process on the livecycle and get back the invokation ID (the long string). How do I get the actual process ID? (the short number)

Thanks in advance



J.

Avatar

Former Community Member
Jan,



If you are referring to the process ID, it is not exposed in the API.



Process management is hung together through many tables. If you go looking at the tables in the 'adobe' schema you can piece together the relationship between invocation ids, task ids, process ids, etc.



In the case of the jobId that is defined in the ActionScript API, the equivalent value will surface in numerous tables, including the column long_lived_invocation_id in the table adobe.tb_process_instance and the column public_id in the table adobe.tb_job_instance.



So if you really had to you could use the JDBC Service and build a query to find what you are looking for.



Steve

Avatar

Level 2
Hi Steve,



thanks a lot once again. You helped me a lot with this.

Best,



Jan