The @ symbol is used to get the value of a node when it's a simple data type(string, int, long,etc).
At one point all variables get converted internally into an xml structure. That's why we can use xPath to get the value.
If you have a simple type, which can return only one value (string, int, long, etc), then you use the @ symbol.
If you have a complex object (for example FormsResult), then it depends which node you query. If you want to get the value of the action the xPath will be /process_data/test/object/@action. You get the @action, because it returns a string for that property.
If you want to get the list of attachents, then the xPath is /process_data/test/object/attachments. The attachments property doesn't contain a @ because it's not a simple type but a complex type (list of attachments).
Also the xml variable is considered a complex type.
I've never experienced a case when Workbench added the @ and I didn't need to use it. Let me know if you have a specific example.
Thanks for the great answer Jasmin. I believe we had already talked about the @ issue before. I discovered it when doing tests using the byte type.
It's pretty easy to reproduce, jut try setting a value to it and you'll encounter the issue. I've also opened a ticked with support about this.
Hi, maybe I should have started a new thread,
but this is sort of about manipulating the Document variable....
anyways, this is what I want to do:
have a simple form, several text fields on it, plus a signature field,
route it through a simple workflow/process,
everything is running in the out-of-the-box Workspace environment. no customization.
in the User task, Presentation & Data tab, I use a Document variable,
I want to be able to get the data in those text fields on the form in a Set Value task of the process,
how do I do that?
It seems that I can't have xPath on a Document variable...
if I use a "xml" variable, the signature doesn't seem to work.
product is ES2, version 9.0
You can use the Form Data Integration->ExportData to export the XML from the document varibale (which contains the PDF) into an xml variable.
Then you can use xPath to extract the infomation from that xml variable.
Hi, does it matter if the form ("asset" in ES2) is an XDP or a PDF?
My form is .XDP and when I tried the ExportData it stalled.
In previous versions, the variables in the process can have the "xdp" type (if I remember correctly),
but in ES2, there's a "Document" type, and a "xml" type, but no XDP type.
I am all confused.
XDP is a template and not a rendered document. If you want to extract data then it would come from a PDF.
may I ask a stupid question?
in previous versions of LCs, there's a "xfaForm" variable type that I can use xPath to get the field data on the form.
But in ES2, version 9.0, I can't find that type anymore.
Could you tell me what's the equivalent of xfaForm in ES2 ?
in ES2, there's "xml" variable type, but how do I load the form data into a xml variable if my form is a .XDP ?
You're right, now we just have an xml variable.
Just make sure to set an xml variable in the Output->Output Data section of the user step.
Jas is right, the best idea would be to have the form return XML data.
If your stuck with an XDP at the server side: An XDP document is really just a specifically formatted XML. You could load the XDP directly into an xml variable and then parse it from there. I believe your data would be in a datasets\data node.
my server is down right now, so I can't verify this,
but if I remember correctly,
at the Start Point step, the only variable listed in the "Output" tab is a Document variable...
I saw my "xml" variable in the subsequent User steps. But not in the initial step.
so, what should I do at the Start point?
You can still put a xml variable in there (Start Point Output -> variable). The reason it says document is because this is more generic. A document can handle pdf or xml, but if you know it's going to be xml, you can specify a xml variable and it'll work.
please correct me if I am wrong...
if I use .XDP asset with a xml variable, and use that as the Input to the downstream User task,
then the Signature would disappear:
Sign the signature field at the Initiation, but can't see the Signature at the User task.
so, is it true that:
in order to let the Signature along with other text field data to show up at the User task,
I will need to use a PDF form as the asset,
and use a Document variable as the Input/Output,
and use the ExportData service to get the field data on the form?
or there are other ways to do this?
Rather than answer the question bit by bit, perhaps it would be better to back up and look at the use case as a whole. Can you describe to us the process at a higher level?
the process/workflow is really simple:
start ---> SetValue (where I want to populate a text field on the form, based on what the user has already entered in other text fields) --> User task (approver) --> User task (Initiator)
the form has several Text fields, and 2 Signature fields,
the Initiator signs one signature field,
the Approver signs the other.
I tried to use .XDP as the Asset, I can see that my "SetValue" worked, but I lost the Signature at the User steps.
I can use .XDP and a Document variable as Output/Input, then I can see the Signature, but I can't do the SetValue.
so, it seems to me, the only option left is to use .PDF asset with a Document variable.
Ok. On the Start Point, you can use and XDP.
If you need digital signatures, you need to make sure the submit button submit the entire PDF.
In the Output section from the Start Point you want to use a document variable so that it contains the entire PDF.
Then you need to use another service (like Form Data Integration) to extract the xml from the PDF.
For the subsequent user steps, you cannot use an XDP anymore. You would use the document variable that contains the PDF.
Thank you all for answering my questions. My server is still down, so I can't report Success on trying out your solution yet, but I trust that it will work.
One last question:
you mentioned that at subsequent steps I can't use XDP anymore. I'd like to know is there anything that I can't do with the PDF and Document variable? Is there anything I must use XDP and not Document? If I can do everything with PDF and Document variable, then I won't bother using XDP anymore.
You can do everything with PDF.
You just need to manually extract the xml data every times.
Hi, the ExportData's output (xml variable) contains this in the Playback:
<xfdf:field xmlns:xfdf="http://ns.adobe.com/xfdf/" xmlns:xfdfi="http://ns.adobe.com/xfdf-transition/" xfdfi:original="FSAPPLICATIONDATA_">H4sIAAAAAAAAAJVT70+kMBD9VzZ8h4Kb9bgNW1OhKN7+8CjE+IlU6 Co5oYT2br3//qYsq3jGD5KQ9M2892aGDsHFS/M8+yN6Vct2ZXmOa81EW8qqbh9XVp7Ftm9d4OCl6pbwzoDcKnNaWU9 ad0uEWuXwSj4Ip5QNggSygL3ny4prroRWJ8mev0oOh4MD2JH9I1Llk2g4AmgbBYIGpg442Mu+8XBA7liREfYjifDCc 70ATQJDMrzeJSFFR8AykuUMj7QRDZkNSdbZbqSRMEt22xNgLLna0qgAR9f3FlDmzA79ObXhENnkG6W2Cw8JvXjhz+d H76kqiKFSekWzPF0X4IrG3v8LA6Sb2zXJaAGcdyhm8S7d/Mxpel9gRLruuS65hptR6CYSQgulhy8Ug/HC6aq90U8kx jsl2yFEzGxJVODbKDb8odSH5Lvm8OmCuDKl3LPld9c/RwfZ/1IdL4WtRA+rgtTvh6bWn8WHQm+eUIHcpV/0Nh6DCtS fi81YbJAZ/kgP0zxNCtyLTqpay/4v6Ex6jAPjkjD69XGNx6syQG8biqbrbuDxX8H/ACKYbUJbAwAA</xfdf:field>
<xfdf:field xmlns:xfdf="http://ns.adobe.com/xfdf/" xmlns:xfdfi="http://ns.adobe.com/xfdf-transition/" xfdfi:original="FSTARGETURL_">http://wastest02:9086/workspace-server/submit/workspace-server/submit</xfdf:field>
<dd:dataDescription xmlns:dd="http://ns.adobe.com/data-description/" dd:name="test">
I see the data on the form are in the <form1>
but in the xPath, when I drill down, there's no form1, only the <test>,
how do I get my form data?
what have I done wrong?
Are you using a schema?
yes. schema root is <test>.
Are you using that schema in you pdf?
in the XDP form, I created the data connection using that schema,
then I [Save As] and created the PDF form.