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.

Version PDF with date/time

Avatar

Level 2

I need to archive my completed forms with a date/time stamp.  How do I do that in Workbench?

I'm using the Write Document service.  In the Input I put the name/location of the pdf in the Pathname Pattern

and check Make Unique.   When I try to use Xpath and add date/time to either Pathname Pattern or Make Unique

my form gets Stalled with the error of  "Not able to overwrite pdf".

7 Replies

Avatar

Former Community Member

Can you show how exactly are you appending the date time to the pdf using XPATH ?

if it is a windows environment, the date time pattern includes ':' and might not let the OS write the file.

Avatar

Level 2

The pathname pattern looks like this:  c:\eForms\CD\CDPaymentMaint.pdfadd-days-to-date(strDate1, days).

I tried c:\eForms\CD\CDPaymentMaint.pdf:add-days-to-date(strDate1, days) also and stalled again with this error:

Unexpected '\eForms\CD\CDPaymentMaint.pdf:add-days-to-date(strDate1, days)': org.jaxen.XPathSyntaxException: Unexpected '\eForms\CD\CDPaymentMaint.pdf:add-days-to-date(strDate1, days)'

Avatar

Level 10

Your pathname pattern is wrong.

If you use xPath, you'll have to use the concat function to concatenate two strings together.Also you need to use /process_data/@strDate1 to get to your variable and not just the variable name.

Something like concat("c:\eForms\CD\CDPaymentMaint.pdf",add-days-to-date(/process_data/@strDate1, days)).

Jasmin

Avatar

Level 2

I tried your sample and a couple variations: concat("c:\eForms\CD\CDPaymentMaint.pdf",add-days-to-date(/process_data/@strDat e1, days))

but kept getting:  Expected: ): org.jaxen.XPathSyntaxException

Any thoughts?

Avatar

Former Community Member

try the right format...

concat("c:\eForms\CD\CDPaymentMaint.pdf",add-days-to-date(/process_data/@strDate1, days))

Avatar

Former Community Member

Try with the following options.

It worked for me.

you might want to make sure that the file you write is valid for.e.g

concat("c:\eForms\CD\CDPaymentMaint.pdf",add-days-to-date(/process_data/@strDate1, days))

make sure that the variables have values.

strDate1 should be a valid value, and days should be a valid number.

i tried and found the result.