script that distributes files in different folders from workflow

We tried to make LogicalDOC as intuitive as possible, but an advice is always welcome.

Moderator: car031

jeyhber
Posts: 3
Joined: Mon Apr 02, 2018 6:28 am

script that distributes files in different folders from workflow

Wed Jul 04, 2018 4:25 am

You can help me with a script that distributes files to me in different folders, called files with an attribute assigned with the name "type" in the template and that moves them to different folders when a transition is executed in the workflow.
Attachments
image.png
image.png (17.75 KiB) Viewed 350 times
agaspa
Posts: 601
Joined: Tue Apr 20, 2010 8:24 am

Re: script that distributes files in different folders from workflow

Mon Jul 16, 2018 3:55 pm

Hi Jeyhber,
using the foreach instruction in a script you can cycle throu the documents involved in a task/transition, then using the move tool you can move them in a different fodler

examples:

Code: Select all

#foreach( $doc in $documents )
  $DocTool.move($doc, "InApprovazione")
#end

#foreach( $doc in $documents )
  $DocTool.move($doc, "/LogicalDOC Mobile/demo/Approvati")
#end
The getValue can be use to get the vale of a field, then yous can use it combined with the if and set instructions

Code: Select all

$doc.getValue("type")
See also the Javadoc documentation of AbstractDocument and ExtensibleObject classes

For a custom consulting however I suggest you to contact the sales service of LogicalDOC, since the Workflow is an Enterprise feature

bR.
aLEX

Return to “Usage”

Who is online

Users browsing this forum: No registered users and 1 guest