Rule with condition "match a single term in a pdf ducument"

cancel
Showing results for 
Search instead for 
Did you mean: 
Stefan79
Member II

Rule with condition "match a single term in a pdf ducument"

After I was spending so many hours without findig a solution, I ask you for help:

I have a folder where I upload new searchable pdf-files. Now I want create a folder rule, which runs if "If all criteria are met:" match find the word "test" in (an already searchable) pdf-file.

If I use alfresco-search-bar and search for keyword:test or text:test these files are listet successfully in the results.

I want the rule runs and move the file to folder "moved" if it finds the word "test" in the pdf-file (same like the alfresco-search-bar finds these files correctly)

Thank you for your ideas!

Best regards 

Stefan     

 

2020-04-05 08_29_51-Alfresco » Folder Rules.png

2 Replies
angelborroy
Alfresco Employee

Re: Rule with condition "match a single term in a pdf ducument"

The problem with this approach is that searching the content of an already uploaded document is not available. This is an asynchronous process that can take some seconds to complete.

You could try to force the transformation to check if the text is inside the document.

var trans = doc.transformDocument('text/plain', companyhome);
if (trans.content.includes("test"))
{
   // Move or whatever
}

Or to execute the rule from time to time in that folder.

Hyland Developer Evangelist
Stefan79
Member II

Re: Rule with condition "match a single term in a pdf ducument"

Thank you very much for your quickly response.

For the moment a changed the system to ecoDMS, because I won't take care filenames and folders in general more.

If I change back to Alfresco I will try your solution.