Alfresco Community - Document management use case - How to

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

Alfresco Community - Document management use case - How to

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 " + document.name;
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 = document.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.");
return;
}


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);

startWorkflow(group);

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.");
}
}




main();
2 Replies
etafuro
Member II

Re: Alfresco Community - Document management use case - How to

I've found similarities with this post 

Enrico.

sanjaybandhniya
Intermediate

Re: Alfresco Community - Document management use case - How to

It is not going to work with out of box workflow.

You need to create custom workflow for that.

How to develop custom workflow: 

Creating Custom Advanced Workflows in Alfresco | ECMArchitect | Alfresco Developer Tutorials 

Thanks,

Contcentric