Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Flex + Livecycle + states, without workspace

Not applicable
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
JendaDH
Level 2
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.
pguerett
Level 10
Level 10
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.
JendaDH
Level 2
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.
pguerett
Level 10
Level 10
I am not a Flex person but isn't there a result object created that you have to query to get the result back?
JendaDH
Level 2
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...
Steve_L_Walker
Level 10
Level 10
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
Steve_L_Walker
Level 10
Level 10
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
JendaDH
Level 2
Level 2
S L Walker,



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

Best,



Jan
JendaDH
Level 2
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
JendaDH
Level 2
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.
Steve_L_Walker
Level 10
Level 10
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
JendaDH
Level 2
Level 2
Hi Steve,



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

Best,



Jan