How to create a rule in Alfresco to move content one folder to another?

痞子三分冷 提交于 2019-12-06 18:33:25

There are some properties which you need to set while credating rule.Explanation of those properties are as below.

1.When the rules will be triggered:
- Items are created or enter this folder
- Items are update
- Items are deleted or leave this folder

2.criteria for the rule to be fired.

3.Define the action you want performed. Here you need to select custom javascript.

When you select this option it will load script from the script folder of Data Dictionary.

In that script you need to write below code.

if(document.properties.prop1=="yourvalues")
{
    document.move(folderA);//Where FolderA will be a destination node and not a string
}else{
    document.move(folderB);//Where FolderB will be a destination node and not a string

}

object document referes to current object, on which rule is executed.Refer below image.

Below is the script which i have tested and executed.

if(document.properties.title=="demo")
{
    document.move(companyHome);
}else{
    document.move(userhome);

}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!