save in folder process

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Member II

save in folder process

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

2 Replies
Highlighted
Active Member II

Re: save in folder process

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

Highlighted
Moderator
Moderator

Re: save in folder process

Hi Ivan,

This can be achieved by doing following steps:

  •     Setup a folder with read permission:
  •      Create a folder, make sure you determine the space based on your use base. By default, all users get "EVERYONE" group access which gives read only permission to browse the files and folders. If you want to provide read only access to a limited set of users, you need to setup a custom group and add those users to that group. 
  •       Go to manage permissions and break the inheritance on the newly created folder. 
  •       Add the group to the folder and select role as "Consumer" 

 

  •      Create a task listener which can listen to “Complete” event. As soon as your document gets approved. You can execute a script from the listener and call an Action class (run asynchronously) which will move the node to the read only folder which you recently setup.

 

  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>

~Abhinav
(ACSCE, AWS SAA-C02, GAIQ)