I am thinking to create a rule, possibly a javascript script, which will move documents one folder to another depending on its properties. In the other words, I will always upload documents to folderA
. Alfresco will extract document's property, for example prop1
, and the rule that I define will move this document to folderB
if it has property prop1
, otherwise it will move the document to folderC
. I know how to extract properties but I don't know how to create this rule. I have no idea since I never used javascript. Any help will be appreciated.
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- void before promise syntax
- Keeping track of variable instances
- Can php detect if javascript is on or not?
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.
object document referes to current object, on which rule is executed.Refer below image.
Below is the script which i have tested and executed.