Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list

Dynamically assigning document type variables to RenderPDFForm service


Level 2

I have a process that takes an xml input, parses it and gets the value from one of its tags. Later I want to feed this value to the next activity in the process that has RenderPDFForm service. The name of the 'Form' input to RenderPDFForm should be the value extracted from the previous process.

How can I do that ?

Any help would be greatly appreciated.



1 Reply


Level 2

I figured out a way to assign the form name dynamically. I added an activity with
'ExecuteScript' service and this activity extracts form name to be rendered from one of the
tags in the input xml document using xpath expression.
This activity composes the actual form name based on what is extracted.
Here is my code that is in ExecuteScript that populates the document object. The document
object in the code will be used in the next activity (RenderPDFForm) in the process as input.

import java.util.List;
import java.lang.String;
import java.util.Map;
import java.util.HashMap;
import com.adobe.idp.Document;
String formId = patExecContext.getProcessDataStringValue("/process_data/inputDoc/form/formHeader/formId");
String formName = "Applications/MyApplication10/1.0/Forms/" + formId;
File file = new File(formName);
Document doc = new Document(file,false);

Now my problem is that the process is failing trying to find the file. It is throwing FileNotFoundException.
How should I specify the file name so that the process finds it.I have made sure that the file actually exists in the location that is specified.


The ultimate experience is back.

Join us in Vegas to build skills, learn from the world's top brands, and be inspired.

Register Now