Expand my Community achievements bar.

Storing XFA forms in content space

Avatar

Former Community Member
I've recently begun playing with ContentSpace and am now finding it difficult to store an XFA form from and ES process in a ContentSpace space. I probably just missed a basic thing, but here's what I have:



I have an XfaForm variable in my process that contains a populated form (the user completed it earlier in the process). I now use the storeContent service to store the form into the repository using my XfaForm variable as the NodeContent.



When validating the process it seems that LC finds it difficult to assign the content type of my XfaForm variable. I get the message WBP-036 Unable to coerce blah blah.



Any idea what I'm doing wrong?
2 Replies

Avatar

Level 10
The xfaForm variable is really just a pointer to and XDP in the repository and the data submitted by the user when they hit submit.



That being said the Node Content parameter of the storeContent operation needs a variable of type 'document'. The variable of type 'document' can contain pretty much anything.



If you want to store the data that was submitted by the user you can use a setValue to assign the data of the xfaForm variable to a document variable (ex. /process_data/@myDocVar = /process_data/xfaForm/object/datasets/data). This would store the xml data in Content Space.



If you want to save the entire PDF you have two options. You make sure the form submits the entire PDF, in which case you need to use a different variable type (other than xfaForm) since it can only hold xml. You would use a Document Form variable type.



The other option is to render the PDF on the server using renderPDFForm with the xml data submitted by the user. Once the pdf is created, pass that to the storeContent operation.



Jasmin

Avatar

Former Community Member
Thanks Jasmin



I'll give this a go and let you know