AnsweredAssumed Answered

Using workflow dashlet 'Approve' in a business rule/js.

Question asked by rbkprod on Jun 1, 2010
Latest reply on Jul 22, 2010 by thestorm
Hi

I have a small .js script implemented with a business rule in a space, say "space1", that adds a review workflow to a specific user when a file is uploaded in space1.


var workflow = actions.create("start-workflow");
var user = people.getPerson("user1");
workflow.parameters.workflowName = "jbpm$wf:review";
workflow.parameters["bpm:workflowDescription"] = document.name;
workflow.parameters["bpm:assignee"] = user;
workflow.execute(document);

This works fine, and the document name shows up when 'user1' logs on, in his default My Alfresco -> My tasks dashlet. I was wondering if it's possible to use the "Approve" or "Reject" buttons on the dashlet though? Say if user1 clicks on "Approve" on the dashlet the document gets moved to a different location, same for "Rejeted". I don't quite have any thoughts on how to approach this, any help is much appreciated.

Thanks

Outcomes