Example for a Workflow creating a path and move a file

LogicalDOC has many interesting features, but requires some configuration process to show its full potential.

Moderator: car031

teamSas
Posts: 3
Joined: Thu Jan 04, 2018 4:10 pm

Example for a Workflow creating a path and move a file

Thu Jan 04, 2018 4:40 pm

Hi there,
does anybody have an idea how the Folder createPath works?
The description on the workflow-automation website is not that useful.
https://docs.logicaldoc.com/en/workflow ... automation

The documentation give the hint:

DocTool Categorie Folder createPath(Document doc, String targetPath)

Does this mean

Code: Select all

$DocTool.Folder.createPath(Document doc, String targetPath)
or is this "Folder" information wrong in the documentation and is should be:

Code: Select all

 $DocTool.createPath(Document doc, String targetPath)
And my is the doc needed in this call ?

After that I would like to move the file in the folder via the workflow.
This should work via

Code: Select all

$DocTool.move($doc, "/TargetFolder") 
right?
shatzing
Posts: 80
Joined: Tue Jan 21, 2014 9:46 am

Re: Example for a Workflow creating a path and move a file

Tue Jan 09, 2018 3:47 pm

Hi teamSas,
you don need to use $DocTool.createPath nor $DocTool.Folder.createPath (this one doesn't work at all)

it is enough that you use $DocTool.move($doc, "TargetFolder")

and the script processor will create a relative subfolder TargetFolder (starting from the path where the doc is stored), then it will move the document inside

this is a script example

Code: Select all

#foreach( $doc in $documents )
  $DocTool.move($doc, "TargetFolder") 
#end
if instead you need to move the documents to an absolute path you can use this:

Code: Select all

#foreach( $doc in $documents )
  $DocTool.move($doc, "/Default/processed/MyFolder") 
#end
teamSas
Posts: 3
Joined: Thu Jan 04, 2018 4:10 pm

Re: Example for a Workflow creating a path and move a file

Fri Jan 19, 2018 8:56 am

Thanks shatzing, its working like a charm

Return to “Configuration”

Who is online

Users browsing this forum: No registered users and 11 guests