cancel
Showing results for 
Search instead for 
Did you mean: 

Automatically start approval workflow after doc import and afterwards move to archive

sandorv
Champ in-the-making
Champ in-the-making
Hey guys,

The case:

I'm using Ephesoft with CMIS export to upload my documents into Alfresco which I got working just fine. But I want to add an extra step in our invoice-approval workflow.

It's actually very simple but I can't get it to work entirely.

The GROUP (which is called Approvers) should be able to approve a invoice, this approval workflow should start right after it is imported into Alfresco repository and after approval this document should be moved from Inbox to Archive so that the end-user in the company knows which invoice can be payed etc…

So far I'm able to get the document to start approval for 1 user (sander), but not a group, using this script:

var workflow = actions.create("start-workflow");
workflow.parameters.workflowName = "activiti$activitiReview";
workflow.parameters["bpm:workflowDescription"] = "Please assign approver for "+ document.name;
workflow.parameters['bpm:assignee']=people.getPerson("Sander");
workflow.parameters["sendEMailNotifications"] = false;
workflow.execute(document);

But that's all i got to work, I also have an aspect in my content model called "approve" which I maybe can use to start archive-rule (something I was randomly thinking should be used).

Fingers crossed if there's anybody who can help me! (ps my scripting skill = zero Smiley Sad)
1 REPLY 1

rahulmackdani
Champ in-the-making
Champ in-the-making
Hi SandorV

Current code which you have used is for assigning workflow to a user.To assign it to a group use following

workflow.parameters["bpm:groupAssignee"] = people.getGroup("GROUP_MyGroupName");

However make sure that the workflow which you are trigerring is a group workflow. OOTB group review workflows is"activitiParallelGroupReview" for parallel review and for pooled review [seen in Start Workflow screen  as "Parallel Group Review And Approve Activiti Process"]

Regards