cancel
Showing results for 
Search instead for 
Did you mean: 

Initiating automated workflow for pooled review

soumyakarmakar
Champ in-the-making
Champ in-the-making
Hi,
     I have created a workspace test.
     Defined two subgroups under test 1) pending approval 2) publish.
     Group user Linux has been added as contributor for pending approval space.
     Group sysadmin has been added as coordinator and contributor for pending approval and publish respectively.

     An approval rule has been written to move contents from pending approval to publish.

     How an automated work flow for pool review could be initiated for sysadmin group whenever an content is added to pending approval group.

Regards,
Som.
2 REPLIES 2

amandaluniz_z
Champ on-the-rise
Champ on-the-rise
You would need to create an action, or a script and then define a content rule in that space to trigger the action or the script that will kick off the workflow using the WorkflowService

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

I have tried using the following script as rule in the pending approval space but its not triggering the work flow.
Please suggest if any changes are required .

#########################################
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