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

Checking document exists (Foundation > FileUtilsService > Exists)

Avatar

Level 2

Hello, I've got a problem with something that should be basic but has got me struggling.

I have a process, its location:

/Applications/RenderPortfolio/1.0/Process/LoadDocuments

I have a PDF document, its location:

/Applications/RenderPortfolio/1.0/Assets/Energy_0511.pdf

The process is very simple, the first activity after the startpoint is to check that the document exists.

To do this I am using:

Foundation > FileUtilsService > Exists

Input (literal value): /Applications/RenderPortfolio/1.0/Assets/Energy_0511.pdf

Output (variable): blnDocumentExists

Each time I invoke and playback this process it retuns blnDocumentExists with a value of "false", when I expected it to return "true" as my document path is correct.

To test my fully qualified path, I replace the Foundation > FileUtilsService > Exists activity with Foundation > RepositoryService > Read Resource Content.

Then invoke, and playback, using the Read Resouce Content as expected the pdf document is located and can be opened.

What am I doing wrong with the Exists activity???

5 Replies

Avatar

Level 10

File Utilities Service cannot be used to search document within Adobe Repository.

Use Read Resource Content acitivity and check for NULL or Empty document. Thats the way you do it..

Nith

Avatar

Level 2

Hi $Nith$,

Thanks for the response.

Trouble is when I use Read Resource Content and the document is invalid the process throws an exception instead of continuing along to the next activity.  eg. /Applications/RenderPortfolio/1.0/Assets/Energy_05.pdf

(I've given an incorrect file name, it throws the exception as the file does not exist).

How can force the process to continue past Read Resource Content and instead of throwing an exception return NULL or Empty to my variable?

I'm guessing you do this via an xpath expression, have you got an example of how you implement it?

Avatar

Level 10

Yes, I found that the Exception is not catched by this activity. You can't use the OOB Repository Service.

Here is an alternate way:

You can directly invoke the Repository Service using SOAP (using Web Service activity).

The SOAP URL is http://YOUR_SERVER_NAME:8080/soap/services/RepositoryService?wsdl

There is an operation named resourcesExist

By passing the Resource URI to this web service you can make sure if its exists in the repository or not.

It return either true or false.

Hope that helps,

Nith

Avatar

Level 2

Nith,

I have not invoked a SOAP web service from directly within a LiveCycle Process before.

Thus far I have added the Foundation > WebService > Invoke Web Service Activity to my process.

Web Service Options: ???

Web Service Response (variable): blnDocumentExists

What should be inserted into the Web Service Options to correctly invoke the service and pass the file path?

Should  the file path still be passed in the same format? ie. /Applications/RenderPortfolio/1.0/Assets/Energy_0511.pdf

Thanks again for the assistance.

Avatar

Level 2

BUMP.

Can anyone else provide assistance.
Still very stuck.