AnsweredAssumed Answered

Alfresco Community - Document management use case - How to

Question asked by etafuro on Oct 1, 2018
Latest reply on Dec 22, 2018 by sanjaybandhniya

Hi all.


I'm a newbie and I'm struggling around a use case with Alfresco Community (we would implement the scenario requirements without write any code -or with limited coding effort):


A) In a "team site" a user upload a draft-document within a working repository folder;
B) An approver receives a notification email askying to approve the document uploaded;
C) the approved document is moved to a separate folder inside a secondary publishing site where other users (i.e. readers) can explore for published documents;


I have already tried to built all the necessary things in two ways:
- using a rule-based action which move the document on upload event; the limitation I faced comes from standard workflows engaged by rules which cannot assign approvals and send them notification emails;
- using webscript (see attachment), I was able to assign the approvers and trigger out approval email but I wasn't able to move the approved document to publish folder on the approval event - for this last step it seems a custom workflow implementation is required;


Which are the correct standard building blocks to satisfy this use case ?


The standard resources seems very limited and potential combinations with these building blocks appear poor.


function startWorkflow(assigneeGroup)
var workflow = actions.create("start-workflow");
workflow.parameters.workflowName = "activiti$activitiReviewPooled";
workflow.parameters["bpm:workflowDescription"] = "Please review " +;
workflow.parameters["bpm:groupAssignee"] = assigneeGroup;
workflow.parameters["bpm:approveDestination"] = "Sites/ProgettiIT/documentLibrary/Requisiti";
workflow.parameters["bpm:rejectDestination"] = "Sites/approvazioneprogettiit/documentLibrary/Reject";
workflow.parameters["bpm:sendEMailNotifications"] = true;

var futureDate = new Date();
futureDate.setDate(futureDate.getDate() + 7);
workflow.parameters["bpm:workflowDueDate"] = futureDate;
return workflow.execute(document);

function main()
var name =;
var siteName = document.siteShortName;
if (siteName == null)
if (logger.isLoggingEnabled())
logger.log("Did not start workflow as the document named " + name + " is not located within a site.");

var reviewGroup = "GROUP_ApprovalsGroup";

var group = people.getGroup(reviewGroup);

if (group != null)
if (logger.isLoggingEnabled())
logger.log("Starting pooled review and approve workflow for document named " + name + " assigned to group " + reviewGroup);


if (logger.isLoggingEnabled())
logger.log("Started pooled review and approve workflow for document named " + name + " assigned to group " + reviewGroup);

else if (logger.isLoggingEnabled())

logger.log("Did not start workflow as the group " + reviewGroup + " could not be found.");