Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.

How to set values of Document Form type?

Avatar

Former Community Member
I have a "Document Form" variable which holds my document. Before showing this form to user I want to set some fields in the Form to some values. How can I do that?



Thank you.



Asiye
8 Replies

Avatar

Level 10
You can use the Form data integration to export and re-import the data into a PDF. The Form Data Integration is under the Common category.



Jasmin

Avatar

Former Community Member
Hello Jasmin,

Firstly I have created an xml variable giving the schema of my form, name DegXml. Then I used setValue to set my variables to DegXml parts. Now I have an XML with values. After that I used



importData from FormDataIntegration.

Input: DegDocument (new variable in type "document")

Input data: DegXML

Output: DegDocumentForm/object/@document



Then I will pass that DegDocumentForm (type Document Form) to my User Task.



However it gives

2008-03-05 08:58:31,616 ERROR [com.adobe.workflow.AWS] stalling action-instance: 2139 with message: ALC-DSC-002-000: com.adobe.idp.dsc.RequiredParameterException: Parameter: inPdfDoc is required.

at com.adobe.idp.dsc.interceptor.impl.InvocationInterceptor.intercept(InvocationInterceptor.java:116)

at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptorChainImpl.java:44)

at ...



How can I achive to import that XML to my Document Form, so that user can see the some fields filled document.



Thank you,

Asiye

Avatar

Level 10
When you use the Form Data Integration' import data, you need to supply three parameters:



1- The PDF you want to add the data to. The PDF need to be in a varibale of type "document"



2- The data you want to add to the PDF. The xml data also needs to be in a variable of type "document". If you have it in an xml variable, you can use a setValue to put the content of the xml in a document (ex. /process_data/myDoc = /process_data/myXML).



3- The resulted PDF. You have to put the resulted PDF in a "document" variable. You can re-use the same variable as in step 1.



Now if you want to be able to submit the form from WorkSpace, you need to "Workspace enable" that form. Use the Inject Form Bridge service from the Form Augmenter service (under Process Management).



Once you have the PDF with data in a "document" variable, you need to put it in a "Document Form" variable to use with the user step. The following xPath should do it:



/process_data/MyDocForm/object/@document = /process_data/@myDoc



Then, set the Form Data Mapping (In and Out) to that "Document Form" variable. Now you should see it in Workspace.



Jasmin

Avatar

Former Community Member
Hi, Jasmin

I tired to copy the data form A form to B form, which have the same schema.

I followed the steps you said. But got ALC-DSC-003-000 exception.

I used four variables to create a form data mapping process.

inDoc (document form)

outDoc (document form and mapping the same pdf as inDoc)

formVar (document)

formData (document)



The process steps is:

1. use setvalue to set inDoc to formVar.

2. use exportdata service and set parameter input as formVar and output as formdata.

3. use setvalue to set outDoc to formVar.

4. use importdata service and set parameter input as formVar and output as formdata.

5. use setvalue to set formVar to outDoc.



Then use workspace to initial the process and the process stalled by the ALC-DSC-003-000 exception.



ALC-DSC-003-000: com.adobe.idp.dsc.DSCInvocationException: Invocation error.

at com.adobe.idp.dsc.component.impl.DefaultPOJOInvokerImpl.invoke(DefaultPOJOInvokerImpl.java:210)

at com.adobe.idp.dsc.interceptor.impl.InvocationInterceptor.intercept(InvocationInterceptor.java:134)

at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptorChainImpl.java:44)

at com.adobe.idp.dsc.transaction.interceptor.TransactionInterceptor$1.doInTransaction(TransactionInterceptor.java:74)

at com.adobe.idp.dsc.transaction.impl.ejb.adapter.EjbTransactionCMTAdapterBean.execute(EjbTransactionCMTAdapterBean.java:336)

...

Avatar

Level 10
When you initiate a process,you basically just load or render the form that is stored within the form variable that is set to "IN".



All those import and export operations you're doing will take place after you submit the form. So I suspect the problem is how your IN form variable is setup.



Make sure the IN form variable is either Document Form or xfaForm and point to a valid PDF or XDP and has the right render associated with it. PDF will need to use the Default Render service to, where XDP should use the renderPDFForm service from Sample - Forms.



Jasmin

Avatar

Former Community Member
Hi Jasmin



I set a dynamic pdf(not xdp) in the repository as my inDoc (type document form)and the render is default render.

The form can be initialized in workspace as initial form. But when I completed(submitted) the form, the process stalled by ALC-DSC-003-000 exception.

Could you offer me a sample process of this form data integration term?

Bking@mail.pershing.com.tw

thanks.

Avatar

Level 10
Can you post the server log. It might give us more detail around the error?



Jasmin

Avatar

Former Community Member
Try defining your variable as an XFAForm rather than a DocumentForm. The XFAForm variable can point to dynamic forms saved as either a .pdf or .xdp.



Justin