cancel
Showing results for 
Search instead for 
Did you mean: 

Workflow JavaScript API Examples

rdifrango
Champ in-the-making
Champ in-the-making
Are there any example of using the Workflow JavaScript API for things like:

    Getting a list of the tasks assigned to a particular user
    Allowing a particular user to submit their tasks via the standard WCM process.
    Approve/Reject actions?
I am currently evaluating the 3.0 series so I was using the following as a starting point:

http://wiki.alfresco.com/wiki/Workflow_JavaScript_API

Thanks!
4 REPLIES 4

stevereiner
Champ in-the-making
Champ in-the-making
http://forge.alfresco.com/projects/flexspaces/  in the XML Data WebScripts  webscripts-only.zip download has some workflow/task javascript webscripts in integratedsemantics/tasks/*.*
endTask (approve/reject), startWorkflow, taskAttachments, taskList (gets list of tasks for current user), taskTransitions

there are some wcm specific JavaScript webscripts in integratedsemantics/wcm/*.*, (for wcm/avm folderlist, tree, copy, move, list avm stores) and some of the other webscripts work in avm/wcm "mode" based on the arguments passed (upload, createspace, delete)
Note: More wcm apis need to be added to the alfresco Javascript api.  I did see something in the wiki where Peter Monks was working on this.

Steve Reiner
http://www.integratedsemantics.org
http://www.integratedsemantics.com

rdifrango
Champ in-the-making
Champ in-the-making
Steve,

That is a great start.  And I can nearly use this as is.  The only catch I have is, our user will not be directly logged in because they are coming from a portal.  And when I looked at the code it is nearly magic because there is no JS file that backs it.  So it is unclear to me how the task lists gets populated on the backend.

Thanks!

Ron

rdifrango
Champ in-the-making
Champ in-the-making
Steve,

Just to give you a little more color, we already have an impersonate service that we use in all of our WebScripts.  So for all of the calls, we have an additional parameter of the user and the first thing [and last thing] we do is impersonate.  I looked over the template and it looks like you just do a workflow.assignedTasks  I am presuming that when you login, the workflow object automatically gets all its tasks.  Now the question is, if I add a JS file that does the impersonate will the assigned tasks automatically appear.

Thanks,

Ron

rdifrango
Champ in-the-making
Champ in-the-making
Steve,

It got this working!  All my java script now does is the impersonation and deletegates to the templates and everything is present.

Ron