AnsweredAssumed Answered

move function doesn't trigger update rule

Question asked by savoirfaire on Apr 8, 2009
Latest reply on Apr 9, 2009 by savoirfaire
Hello,

In our workflow, we use the following structure :

Approved
\_ tmp

and the following script :

var sourceFile = document;
var sourceFolder = document.parent;
var targetFolder = space.parent;
var targetFile = targetFolder.childByNamePath(document.name);

if(targetFile == null)
{
        sourceFile.move(targetFolder);
}
else
{
        var targetFileWorkingCopy = targetFile.checkout();
   var content = sourceFile.properties['content'];
   targetFileWorkingCopy.properties['content'].write(content);
        targetFileWorkingCopy.checkin("",false);
        sourceFile.remove();
}

to either move or add a new version to a file in the 'Approved' directory. This script is triggered when a file entered the 'tmp' directory.

In the 'Approved' directory, we have 2 rules :
  • For all items not matching '*.pdf' in the file name, convert to pdf in 'Approved', on Update.

  • For all items matching '*.pdf' in the file name, send email to a group of users, on Update.
When the file 'toto.odt' is approved and doesn't exist in 'Approved', my first rule is not triggered.

If I use the 'Add content' link to add the same file in 'Approved', my first rule is triggered and triggers the second one.

I am using Alfresco Version :Labs - v3.0.0 (e dev @build-number@)

Thank you for your help.

Maxime

Outcomes