Expand my Community achievements bar.

Initiating a Process Outside of Workspace

Avatar

Former Community Member
I have a form that is going to be housed on a corporate intranet. I want to be able to submit the form from stand alone reader and have it initiate a long lived process passing in the submitted form data. The process has as required input an xfaForm variable. I've tried doing this by simply writing a servlet that uses the Invocation API to invoke the service passing in a Document object that contains the submitted form. When I do this I get the following error:<br /><br />2007-09-19 07:49:07,437 INFO [STDOUT] ALC-DSC-119-000: com.adobe.idp.dsc.util.InvalidCoercionException: Cannot coerce object: <document state="active" senderVersion="3" persistent="false" senderPersistent="true" passivated="false" senderPassivated="true" deserialized="true" senderHostId="127.0.0.1/192.168.43.1/192.168.164.1/192.168.1.123/" callbackId="0" senderCallbackId="84725" callbackRef="null" isLocalizable="true" isTransactionBound="false" defaultDisposalTimeout="600" disposalTimeout="600" maxInlineSize="65536" defaultMaxInlineSize="65536" inlineSize="1309" contentType="null" length="-1"><cacheId/><localBackendId/><globalBackendId/><senderLocalBackendId/><senderGlobalBackendId/><inline><?xml version="1.0" encoding="UTF-8"?><br /><?xfa generator="XFA2_4" APIVersion="2.6.7116.0"?><br /><xdp:xdp x...</inline><senderPullServantJndiName>adobe/idp/DocumentPullServant/adobejb_server1</senderPullServantJndiName><attributes/></document> of type: com.adobe.idp.Document to type: class com.adobe.idp.taskmanager.form.impl.xfa.XFARepositoryFormInstance<br /><br />So it looks like I need to get my form into an XFARepositoryFormInstance variable. Is there an easy way to do this?! Or am I going about this all wrong?<br /><br />Any help would be appreciated.<br />Bryan
4 Replies

Avatar

Level 10
You need to make sure what you submit from the PDF. The submit button can submit XDP, XML, PDF. You can check from the properties of the submit button on your xdp.



Once you know what you submit, you need to make sure the input variable matches what you submit.



In your case it looks like your submitting the whole pdf back to the servlet since you get a coercing error trying to put it into a xfaForm variable.



Try to make your input variable of type "document" instead.



Jasmin

Avatar

Former Community Member
Jasmin - Thanks for the suggestion, however I really want the input variable to be an xfaForm. I feel like I'm trying to the same thing that Workspace does when I start a process from the "Start Process" tab.



I am currently submitting back an XDP, I need to know how to pass this XDP to my process into an XFA Form variable. Is this possible?



Thanks again,

Bryan

Avatar

Level 9
Hi Bryan

I think you need to do the following:

- The submit button on the form should submit in XML format

- Your input variable in the workflow should be of type XML

- Your servlet should extract the forms data (as a string), and convert this to a org.w3c.Document, before passing it as the input to your Workflow.

- In your workflow, the first step should be a SetValue QPAC. This should assign the XML data from the input XML variable to the ../data/ node in the xfaForm variable.



You can't coerce directly from your XDP data to a Form variable, because a Form variable is a complex object that contains both the XML data, and a reference to the form. You have to copy over just the XML data into the correct location within an existing xfaForm variable. I think :-)



I think this will work. Let us know...

Howard

http://www.avoka.com

PS We just have in alpha testing a generic servlet that will do what your custom servlet does, and quite a bit more. Please email info@avoka.com if you're interested in trying this out.

Avatar

Former Community Member
Hey Howard - That worked! Thanks for the help.



Bryan