Expand my Community achievements bar.

How do you populate a process form variable via the web services interface ?

Avatar

Former Community Member
I've created a simple workflow which has an input process form variable and I've enabled ws access to it. My question is... can I populate the form variable via the invoke ws call ? If so, how ? I've tried various experiments sending in the XDP resulting from the form submit with no success.



Thanks in advance
6 Replies

Avatar

Level 9
Hi Rob



What's the behavior you're seeing?



Howard

Avatar

Former Community Member
I created a simple test form with just a single text field, added it to Form Manager and created a simple workflow with a process form variable using that form as it's template. The workflow has jst a single action - the Avoke VariableLogger which just dumps all varibales to the jboss console. I enabled ws access to the workflow and turned on the 'in' attribute of the form variable.<br /><br />I've tried to test this in two ways....<br /><br />1. Fired up Designer (aka Form Designer) and created a new Data Connection using the WSDL of my test workflow. Dragged the Data Connection to the form which gives me a text field for the form variable in the request and a text field for the process id returned in the response. I took an XDP created by my original test form and pasted it into the form variable text field and executed the call. I get no response at this point. I've successfully used this method to test invoking other workflows which take in string varibales as input.<br /><br />I tried using the SoapMonitor to debug what's going on but it doesn't seem to work at all... even for successful calls I make to other workflows.<br /><br />2. Gone to the /services URL for my service and tried pasting the XDP content into the invoke text field produced by that interface. When doing that, I get the following error....<br /><br />org.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL]" is not allowed.<br /><br />Here's my XDP....<br /><br /><?xml version="1.0" encoding="UTF-8"?><br /><?xfa generator="XFA2_4" APIVersion="2.4.5234.0"?><br /><xdp:xdp xmlns:xdp="http://ns.adobe.com/xdp/"><br /><xfa:datasets xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/"><br /><xfa:data><br /><exercise1><sillystring>foo</sillystring><br /><AWS_ACTION/><br /><AWS_PROCESSTYPE></AWS_PROCESSTYPE><br /><AWS_ASSIGNED_ID/><AWS_TASKID/><AWS_CHOICE/><br /><AWS_MAILTO></AWS_MAILTO><br /></exercise1><br /></xfa:data><br /><dd:dataDescription xmlns:dd="http://ns.adobe.com/data-description/" dd:name="exercise1"><br /><exercise1><br /><sillystring/><br /></exercise1><br /></dd:dataDescription><br /></xfa:datasets><br /><pdf href="file:///C|/Documents and Settings/RGABBARD/Local Settings/Temp/_ao109fh2ff51etj.pdf" xmlns="http://ns.adobe.com/xdp/pdf/"/><br /><xfdf xmlns="http://ns.adobe.com/xfdf/" xml:space="preserve"><annots/><br /></xfdf><br /></xdp:xdp>

Avatar

Former Community Member
Is anyone able to comment on this topic? I'm simply trying to understand how to take an XDP-based form submission and use it to populate a form process variable via the web services interface. In other words, how do you send a form into Workflow separately from using Form Manager ? Do you simply send the XDP in to the process varibale parameter as a string ? As a SOAP attachment ? I can't find an example or docs on doing this anywhere.

Avatar

Former Community Member
Hi Rob -



Unfortunately the Web Services interface does not support the Form Variable. You do however have options:



1) Continue to use String Variables for the data you care about, and use the SetValue QPac to create Nodes in your Form Variable from the values in the String Values. This of course could be cumbersome if you have a lot of values you care about. You can create Nodes in a Form Variable with XPath Expressions, in your case you would use an expression like this:



value: /process_data/@stringVar

location: /process_data/[formVarName]/form-data/data/xdp/datasets/data/exercise1/sillystring



2) You could also attempt to use a String variable to pass in the XDP data. You will have to make sure to make the String Variable big enough to hold all of the data. Once you have the string variable in your workflow you should be able to use the 'deserialize' Xpath function in the SetValue QPac to put the data into the Form Variable.



value: deserialize(/process_data/@stringVar)

location: /process_data/[formVarName]/form-data/data/



Option #1 will probably be a more simple operation provided you don't have a huge number of fields.



Good luck!



Will

Avatar

Former Community Member
Thanks for the reply Will. On a related note... can a Document variable be populated via the WS interface ? e.g. can I send in an encoded PDF ?



Thanks again

Avatar

Former Community Member
The Web Services engine does support invoking web services and populating document variables - in order to do so you must use Web Service attachments. You could attach a PDF to your web service message.



What code/client are you using to invoke these web services?



The testing team here using SoapScope to populate Document Variables.



Hope this helps,



Will

Adobe Systems.