cancel
Showing results for 
Search instead for 
Did you mean: 

Moving files to an arbitrary folder

kerkira67
Champ in-the-making
Champ in-the-making
I am writing a process in which the files belonging to the workflow package are automatically copied or moved to particular folders during transitions.

At the moment I am able to move files to folders which reside under the initiator's home. Here is the code I use to move files to the "ComunicazioniPerUffPresidente" folder under the initiator's home:

<script>
  var userhome = initiator.properties['cm:homeFolder'];
  var dest = userhome.childByNamePath("ComunicazioniPerUffPresidente");
  for (var i = 0; i &lt; bpm_package.children.length; i++)
     {
          bpm_package.children.move(dest);
      }
</script>

I would like to do the same for a user called "uff-presidente", but I haven't find any help within the documentation. In particular, I would like to copy files to the "ComunicazioniDaiDirigenti" folder under uff-presidente's home. The people API is not available in the Community Edition, so I am not able to get the reference to the home folder of the "uff-presidente" user.

Can you help me please?

Thanks
Roberto
3 REPLIES 3

davidc
Star Contributor
Star Contributor
Fixes went into the enterprise code line to provide people access, search and companyhome access - these will make it into the community at some point.

In the mean-time, if you start your workflow with javascript, you can pass the reference to either the person or home folder as a parameter.

kerkira67
Champ in-the-making
Champ in-the-making
Currently I do not start the workflow with a javascript because I encountered some problems, which I decided to address later.

Is there anyway I could retrieve the reference to a person or a home folder within a process definition?

Thanks

Roberto

davidc
Star Contributor
Star Contributor
Unfortunately, not with the current community release.  However, fixes have been made in the enterprise code line and these will be applied to the community source line at some point (don't know when exactly).