cancel
Showing results for 
Search instead for 
Did you mean: 

Which 3.4 REST method to create workflow and/or task ?

groberts
Champ on-the-rise
Champ on-the-rise
We are considering whether to move to Alfresco 3.4 to take advantage of the improved workflow API.  We're not using Share,  instead using a client talking to Alfresco using the REST interface.  

I know that Workflow is work in progress in 3.4  but oddly I cannot find a method to assign a task or create a workflow.

There is a way to end a task,  POST /alfresco/service/api/workflow/task/end/{taskId} and other ways to find out about existing tasks but not to start them.

I found that the slingshot Web Scripts from 3.3 still work in 3.4 but there must be a better way.

Is there a way already to assign a task in 3.4 and if not is it planned ?

Thanks,

Guy.
7 REPLIES 7

mrogers
Star Contributor
Star Contributor
Does this page help ?   Although once web scripts are developed you should use the on-line index.

http://wiki.alfresco.com/wiki/Workflow_REST_API

mikeh
Star Contributor
Star Contributor
Just to clarify: all workflow APIs are via the Forms Service in v3.4

Thanks,
Mike

groberts
Champ on-the-rise
Champ on-the-rise
Mike,

Thanks for taking the time to reply. 

The Forms Service is new to me.  I can see the point of it but its not very RESTful in that the resources, ie spaces, files, tasks are embellished with GUI information.   The 'view' of these resources should be the concern of the client code. 

My application is completely outside Alfresco and Share,  its written in Ruby on Rails and all I want is CRUD access to the building blocks, yet I can't see how to start a workflow or task in the 3.4 Web Script API without resorting to old slingshot services.

Maybe I should read the documentation some more.

While I am on my soap box,  CMIS is like an old Remote Procedure Call service, but the complicated arguments are wrapped up in hundreds of lines of XML inside the envelope.  Its promoted as REST but is tricky to compose and parse.

Hope this does not sound ungrateful,  I don't mean it to be !

Best wishes,

Guy.

gavinc
Champ in-the-making
Champ in-the-making
Hi Guy,

You're right, there is a lack of a way to start a workflow via the workflow REST API.

The REST API wiki page Mark pointed to you to is the design for the workflow REST API, however, in 3.4 we only implemented the read-only APIs, with the exception of the PUT /api/task-instances/{task-id} (although I just noticed the wiki page incorrectly says this is not implemented, i have fixed that). Share uses this API to re-assign a task, you simply call the API and set the "cmSmiley Surprisedwner" property to the username of the new assignee.

As Mike also pointed out to start a workflow we use the Form Service, the intention in the future is to use http://wiki.alfresco.com/wiki/Workflow_REST_API#Post_Workflow_Instance to start a workflow but as indicated it's not implemented yet. For the time being you can still use the Form Service to start a workflow from Ruby on Rails, it's just a POST to /api/workflow/{workflow-def-name}/formprocessor.

The POST /alfresco/service/api/workflow/task/end/{taskId} API you mention will also eventually be replaced with http://wiki.alfresco.com/wiki/Workflow_REST_API#Post_Task_Instance

Hope this all helps!

flopez
Champ in-the-making
Champ in-the-making
Hi there,

in 3.4 we only implemented the read-only APIs… …it's not implemented yet.

Is there a timeline for this to be implemented? we are willing to use the existing alfresco API trought REST, that is, using all the alfresco functionality trough webscripts-"javascript" api, and not much "java"-"soap" api, are there actually plans to complete this? since the rest wiki isn't that complete yet.

I also have one question, I may be completely off here, since i don't know much about it, is the Surf platform a development environment where one could "write code" for webscript-based applications on top alfresco, where one could use the rest api as you would use a java api in say, eclipse, to do things such as, tap ctrl+tab to see what methods are avavilable on certain "rest service" to be used in a .js hehe. that'd be great. Smiley Happy

Thanks.

gavinc
Champ in-the-making
Champ in-the-making
Is there a timeline for this to be implemented?

Unfortunately not, the intention was to implement it in the next release, but the the list of features for the next release is still being discussed and has no definite timeline, it's currently due summer 2011, but that's subject to change too.

Surf is a web framework that builds on Spring MVC and integrates web scripts so yes, you can use it to build webscript-based applications but it's not a development environment. There is however, a project part of Surf that provides some developer tools, one of which is some very basic code assistance for writing FreeMarker templates i.e. shows root model objects available.

rajarshi
Champ in-the-making
Champ in-the-making
Hi,

can someone help me in giving a solution to my problem below?
my problem is that i need to create a workflow in alfresco share from outside alfresco. That is i have to create a workflow from outside alfresco share(from drupal) by some means, like calling a web script or any other means. If i create a workflow in drupal that should be reflected in alfresco.
I need an urgent help on this along with the piece of code if possible. Can anyone please help me on this?
If not an exact solution at least can someone let me know how to create a workflow in alfresco share from outside alfresco?

Thanks in advance!!!