Usage of service tasks

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

Usage of service tasks

Hello everyone,

I have a bunch of questions about usage of service tasks.

First, I need to request external services via rest calls. My project is built using Spring Boot, so I use Spring RestTemplate. Is web service task more suitable for that purpose?

Second, now for each process I have at least one class that implements JavaDelegate. Maybe, there are any best practices to minimize code and make it more readable and reusable? Is there any possibility to call rest service from the process definition?

I would appreciate any code examples or github links.

1 Reply
Alfresco Employee

Re: Usage of service tasks

1) Webservice Task isn't designed to do REST calls.

2) You can reuse you JavaDelegate classes using expression and call your service like

activiti:expression="#{myService.doSomething()}"

If you are using APS, there is a REST call task that you can use to do REST calls. If you are in Activiti community then you'll have to implement a REST service and call it from service tasks.