cancel
Showing results for 
Search instead for 
Did you mean: 

Automation of pooled review workflow.

soumyakarmakar
Champ in-the-making
Champ in-the-making
Hi ,

I have created two spaces pending approval and publish.
Requirement is to automated pooled review where ever a document is upload in pending approval.
So, I am using a sample script and using in applying rule in the pending approval space.
But as required the pooled review workflow is not triggered when document is uploaded in the pending approval.

Below I have mentioned sample script been used as rule in pending approval space.
#####################################################

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"] =people.getGroup( assigneeGroup );;
   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;
  
  
  
   var reviewGroup = "GROUP_test" + siteName;

   // make sure the group exists
   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(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.");
   }
}

main();

###################################

Thanks,
Som.
1 REPLY 1

soumyakarmakar
Champ in-the-making
Champ in-the-making
Hi,
     Have been able automate the pooled review by the editing the existing script parameter (var reviewGroup = "GROUP_test" + siteName)

to ( var reviewGroup = "GROUP_test"Smiley Wink

Solved.
Enjoy

Som