06-26-2019 01:45 PM
Dear All,
I need to launch the revision process of a document, and once it has been completed by all revisor, I need to store such an aproved document into a specific folder. Nobody has write permision to this folder except the system. The purpose is to avoid any overwrite, delete, etc. of the documents already revised and aproved. Users can only read documents from this folder.
Has anybody had this issue before?
Thank you very much for your time.
Ivan
06-28-2019 01:43 AM
Hi,
You can do something like this. After document approved by revision process you can put document to specific folder and change the permission to 'Role Consumer' on that.
Thanks,
Prachi
06-28-2019 08:55 AM
Hi Ivan,
This can be achieved by doing following steps:
Example:
<userTask id="reviseDocUsertask" name="Revise Document"
activiti:assignee="${initiator.properties.userName}" activiti:formKey="cmsWorkflow:activitiRevise">
<extensionElements>
<activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
<activiti:field name="script">
<activiti:string>
<![CDATA[
var initiatorUser = initiator.properties.userName;
logger.log("Workflow approved for: "+initiatorUser);
var moveAction = actions.create("move-doc");
moveAction.parameters["initiatorUser"] = initiatorUser;
for (var eachItem = 0; eachItem < bpm_package.children.length; eachItem++) {
var eachNode = bpm_package.children[eachItem];
var nodeReference = eachNode.nodeRef;
logger.log("Moving node: " + nodeReference+", initiatorUser: "+initiatorUser);
moveAction.execute(eachNode);
]]>
</activiti:string>
</activiti:field>
</activiti:taskListener>
</extensionElements>
</userTask>
Explore our Alfresco products with the links below. Use labels to filter content by product module.