Expand my Community achievements bar.

Using Read Resource Content

Avatar

Level 8
Level 8
Hi all,



I have a problem using the Read Resource Content service. I need it to create a document variable, but the variable I get is not populated with data. So how can I make sure that the document variable that I need contains the data which I need it to contain.



The reason why I need to make my form (xfaform) to a document is that I need to send it by email and the emailsendwith document only supports the document types as attachments



Thanks in advance



Sincerely

Kim Christensen
4 Replies

Avatar

Former Community Member
Hi Kim



the
Read Resource Content component loads only "static" templates from the repository. If you want to populate the form with data you can use the
renderPDFForm service of the Forms component. This serivce merges xml data with the form. But there are also other options to achieve that.



You find also more information in other threads, e.g. here:


Jasmin Charbonneau, "Output form as PDF" #5, 20 Nov 2007 10:26 am



Regards,

Nico

Avatar

Level 8
Level 8
Hi Nico,



Thanks for your reply, I will try out your suggestion and read the post you have linked to.



Sincerely

Kim Christensen

Avatar

Level 8
Level 8
I have now tried out some of what is suggested in the post you refer to. However I have not been succesful in achieving the wanted scenario.

I need to send an xfaform with data to and end user and I have created a simple process that tries to do this. In my process I have the following:

- Two xdp-forms with embedded xml schema (added in the repository)

- inVar (Xfa form)
- middleVar (document)
- outVar (document)

- Read Resource Content service (start activity)
- Resource URI: \test.xdp
- result: middleVar

- importData (next activity)
- PDF document: middleVar
- input data: /process_data/inVar/object/data/xdp/datasets/data/*
- Data merged PDF: outVar

- sendWithDocument (last activity)
- attachment outVar

This fails when I invoke the process with an error that the PDF or data is malformed. Although the form and schema only contains one element (a textfield) - and I believe that it is setup correctly.

When I log the XML variable from /process_data/inVar/object/data/xdp/datasets/data/* i get:


Test


and this seems correct to me, however the importData service will not accept it as stated above.

When I try to insert this xml as preview data in the Designer it shows up fine with "Test" inside the textfield.

How can I start my hunt for the solution to this problem?

Hope that you have not died during your reading of this post ;)

Have a nice weekend

Sincerely
Kim Christensen

Avatar

Level 10
You can't use importData on an XDP. This operation will only import data in a PDF.



You can use the renderPDFForm form the Forms service to convert your XDP into a PDF before calling importData, but the renderPDFForm can also merge the data for you.



Jasmin