Start Alfresco Workflow from Java

cancel
Showing results for 
Search instead for 
Did you mean: 
eramesh
Active Member

Start Alfresco Workflow from Java

Jump to solution

Hi,

We have created custom review workflow and deployed to Alfresco repository and wanted to start this workflow outside Alfresco using java, couldn't find right REST service or any other method to do this. Can you please help me on how I can achieve this? We are using Alfresco 5.0

Thanks!

1 Solution

Accepted Solutions
douglascrp
Advanced II

Re: Start Alfresco Workflow from Java

Jump to solution

Judging by the available documentation for 5.0 version here Workflow | Alfresco Documentation , I think there is no way to start a new instance the way you want to do.

Maybe you should take a look on how webscripts are implemented, and then create your own.

The following project introduced a new start workflow webscript, but be carefull, as the project is not being maintained anymore

GitHub - douglascrp/alfresco-workflow-webscripts: Project implementing the missing workflows webscri... 

View solution in original post

5 Replies
douglascrp
Advanced II

Re: Start Alfresco Workflow from Java

Jump to solution

Judging by the available documentation for 5.0 version here Workflow | Alfresco Documentation , I think there is no way to start a new instance the way you want to do.

Maybe you should take a look on how webscripts are implemented, and then create your own.

The following project introduced a new start workflow webscript, but be carefull, as the project is not being maintained anymore

GitHub - douglascrp/alfresco-workflow-webscripts: Project implementing the missing workflows webscri... 

eramesh
Active Member

Re: Start Alfresco Workflow from Java

Jump to solution

Excellent! Thank you so much!

eramesh
Active Member

Re: Start Alfresco Workflow from Java

Jump to solution

Hi Douglas,

One follow-up question I got to add two documents to the workflow when I start how can I add it? Please let me know.

Thanks!

douglascrp
Advanced II

Re: Start Alfresco Workflow from Java

Jump to solution

You have to do something like this:

community-edition-old/ActivitiWorkflowServiceIntegrationTest.java at master · Alfresco/community-edi... 

Basically what you need is to create the "package" object, add the documents and it is done.

Follow the sample code and you will be able to achieve what you need.

eramesh
Active Member

Re: Start Alfresco Workflow from Java

Jump to solution

Thanks Douglas...I will follow that method.