Executing Service Task from UI

Hi,
I have made a process using flowable-modeler as shown in image
Capture

I have wired the 2 service tasks with 2 spring beans FirstServiceTask and SecondServiceTask, so when I start and run the process from java code like below, it works fine:

Code from Controller:

@PostMapping("/start-service")
public String postRequest(@RequestBody String var) {
	Integer num = Integer.parseInt(var);
	Map<String, Object> variables = new HashMap<String, Object>();
	variables.put("enternumber", num);
	
	ProcessInstance instance = mRuntimeService.startProcessInstanceByKey("testmodel", variables);
	Task userTask = mTaskService.createTaskQuery().processInstanceId(instance.getId()).taskDefinitionKey("getinput").singleResult();
	System.err.println("obtained "+mTaskService.getVariables(userTask.getId()).get("enternumber"));
	
	mTaskService.complete(userTask.getId());
	return "ProcessInstance id is "+instance.getProcessInstanceId();
}

FirstServiceTask.java:

public class FirstServiceTask implements JavaDelegate{

	@Override
	public void execute(DelegateExecution execution) {
		System.err.println("FIRST SERVICE TASK");
	}

}

Same goes for SecondServiceTask, so typically, when I make a POST call to API: /start-service with any number in the body, based on the value FirstServiceTask or SecondServiceTask is executed.

So, everything works fine when I’m doing like this, but when I try to do it from UI side, it gives me exception of unknown expression, the reason is UI is not aware of this FirstServiceTask and SecondServiceTask classes and I’m not sure how to make them aware of it.

Please find some images attached, which might help to understand the question:


If I would have given number greater than 100 like 127, error would have shown firstServiceTask in place of secondServiceTask.

Let me know if any other information is required from my side. Thanks in advance

In order for your JavaDelegates to be referenced this way, they have to be registered as beans. I’m assuming that, since your POST mapping works, you’ve created an auto-configuring spring jar and added it to the class path (example). If that is the case, you can add an @Component on the class or create the beans manually.

Will

Yes actually it is a spring boot project and I have specified them as beans in the main method class…and it works fine from spring boot side…but when I am starting process from flowable-task api and try to complete the user task, it gives me the error

It works from your Spring Boot app because you have registered these beans either manually or with component scanning. Flowable-Task and Flowable-Rest are also Spring Boot applications with their own list of Spring beans. If you want to reference your delegates by name you have to get them configured. The way you do that is by creating a .jar with auto-configuration setup and copying it into the webapp’s classpath. (See Custom Bean Deployment)

Okay
So, I created a configuration class like this:

ServiceTasksConfiguration.java:

package org.example.basicflowable.config;

@Configuration
@AutoConfigureOrder(Ordered.LOWEST_PRECEDENCE)
public class ServiceTasksConfiguration {
	
	@Bean
	public FirstServiceTask firstServiceTask() {
		return new FirstServiceTask();
	}
	
	@Bean
	public SecondServiceTask secondServiceTask() {
		return new SecondServiceTask();
	}

}

Set below property in properties file:
org.springframework.boot.autoconfigure.EnableAutoConfiguration=org.example.basicflowable.config.ServiceTasksConfiguration

In my pom.xml, I have added <packaging>jar</packaging>, so after mvn clean install, I get the basic-flowable-0.0.1.jar in target folder of workspace.

For getting it to work, for now, I copied this jar to WEB-INF/lib folder of all flowable-apps deployed: flowable-admin, flowable-idm, flowable-modeler, flowable-rest and flowable-task.

After a restart, I gave it a try but I still got the same error, below is the stack trace:

2019-08-14 11:39:17.598 ERROR 12896 --- [nio-8080-exec-1] o.s.b.w.s.s.ErrorPageFilter              : Forwarding to error page from request [/app/rest/task-forms/0860b3c0-be5a-11e9-80c7-525349d6ad33] due to exception [couldn't instantiate class FirstServiceTask]

org.flowable.common.engine.api.FlowableException: couldn't instantiate class FirstServiceTask
        at org.flowable.common.engine.impl.util.ReflectUtil.instantiate(ReflectUtil.java:140) ~[flowable-engine-common-6.4.1.jar:6.4.1]
        at org.flowable.engine.impl.bpmn.helper.AbstractClassDelegate.defaultInstantiateDelegate(AbstractClassDelegate.java:64) ~[flowable-engine-6.4.1.jar:6.4.1]
        at org.flowable.engine.impl.bpmn.helper.AbstractClassDelegate.defaultInstantiateDelegate(AbstractClassDelegate.java:75) ~[flowable-engine-6.4.1.jar:6.4.1]
        at org.flowable.engine.impl.bpmn.helper.AbstractClassDelegate.instantiateDelegate(AbstractClassDelegate.java:49) ~[flowable-engine-6.4.1.jar:6.4.1]
        at org.flowable.engine.impl.bpmn.helper.ClassDelegate.getActivityBehaviorInstance(ClassDelegate.java:258) ~[flowable-engine-6.4.1.jar:6.4.1]
        at org.flowable.engine.impl.bpmn.helper.ClassDelegate.execute(ClassDelegate.java:199) ~[flowable-engine-6.4.1.jar:6.4.1]
        at org.flowable.engine.impl.agenda.ContinueProcessOperation.executeActivityBehavior(ContinueProcessOperation.java:264) ~[flowable-engine-6.4.1.jar:6.4.1]
        at org.flowable.engine.impl.agenda.ContinueProcessOperation.executeSynchronous(ContinueProcessOperation.java:158) ~[flowable-engine-6.4.1.jar:6.4.1]
        at org.flowable.engine.impl.agenda.ContinueProcessOperation.continueThroughFlowNode(ContinueProcessOperation.java:113) ~[flowable-engine-6.4.1.jar:6.4.1]
        at org.flowable.engine.impl.agenda.ContinueProcessOperation.continueThroughSequenceFlow(ContinueProcessOperation.java:312) ~[flowable-engine-6.4.1.jar:6.4.1]
        at org.flowable.engine.impl.agenda.ContinueProcessOperation.run(ContinueProcessOperation.java:79) ~[flowable-engine-6.4.1.jar:6.4.1]
        at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperation(CommandInvoker.java:88) ~[flowable-engine-6.4.1.jar:6.4.1]
        at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperations(CommandInvoker.java:72) ~[flowable-engine-6.4.1.jar:6.4.1]
        at org.flowable.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:56) ~[flowable-engine-6.4.1.jar:6.4.1]
        at org.flowable.engine.impl.interceptor.BpmnOverrideContextInterceptor.execute(BpmnOverrideContextInterceptor.java:25) ~[flowable-engine-6.4.1.jar:6.4.1]
        at org.flowable.common.engine.impl.interceptor.TransactionContextInterceptor.execute(TransactionContextInterceptor.java:53) ~[flowable-engine-common-6.4.1.jar:6.4.1]
        at org.flowable.common.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:71) ~[flowable-engine-common-6.4.1.jar:6.4.1]
        at org.flowable.common.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:49) ~[flowable-spring-common-6.4.1.jar:6.4.1]
        at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140) ~[spring-tx-5.0.12.RELEASE.jar:5.0.12.RELEASE]
        at org.flowable.common.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:46) ~[flowable-spring-common-6.4.1.jar:6.4.1]
        at org.flowable.common.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:30) ~[flowable-engine-common-6.4.1.jar:6.4.1]
        at org.flowable.common.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:56) ~[flowable-engine-common-6.4.1.jar:6.4.1]
        at org.flowable.common.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:51) ~[flowable-engine-common-6.4.1.jar:6.4.1]
        at org.flowable.engine.impl.TaskServiceImpl.completeTaskWithForm(TaskServiceImpl.java:228) ~[flowable-engine-6.4.1.jar:6.4.1]
        at org.flowable.ui.task.service.runtime.FlowableTaskFormService.completeTaskForm(FlowableTaskFormService.java:119) ~[flowable-ui-task-logic-6.4.1.jar:6.4.1]
        at org.flowable.ui.task.service.runtime.FlowableTaskFormService$$FastClassBySpringCGLIB$$fe30218a.invoke(<generated>) ~[flowable-ui-task-logic-6.4.1.jar:6.4.1]
        at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) ~[spring-core-5.0.12.RELEASE.jar:5.0.12.RELEASE]
        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:746) ~[spring-aop-5.0.12.RELEASE.jar:5.0.12.RELEASE]
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.0.12.RELEASE.jar:5.0.12.RELEASE]
        at org.springframework.transaction.interceptor.TransactionInterceptor$$Lambda$2579/308164198.proceedWithInvocation(Unknown Source) ~[?:?]
        at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:294) ~[spring-tx-5.0.12.RELEASE.jar:5.0.12.RELEASE]
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98) ~[spring-tx-5.0.12.RELEASE.jar:5.0.12.RELEASE]
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185) ~[spring-aop-5.0.12.RELEASE.jar:5.0.12.RELEASE]
        at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688) ~[spring-aop-5.0.12.RELEASE.jar:5.0.12.RELEASE]
        at org.flowable.ui.task.service.runtime.FlowableTaskFormService$$EnhancerBySpringCGLIB$$c5bf077.completeTaskForm(<generated>) ~[flowable-ui-task-logic-6.4.1.jar:6.4.1]
        at org.flowable.ui.task.rest.runtime.TaskFormResource.completeTaskForm(TaskFormResource.java:50) ~[flowable-ui-task-rest-6.4.1.jar:6.4.1]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_05]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_05]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_05]
        at java.lang.reflect.Method.invoke(Method.java:483) ~[?:1.8.0_05]
        at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:209) ~[spring-web-5.0.12.RELEASE.jar:5.0.12.RELEASE]
        at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136) ~[spring-web-5.0.12.RELEASE.jar:5.0.12.RELEASE]
        at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102) ~[spring-webmvc-5.0.12.RELEASE.jar:5.0.12.RELEASE]
        at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:891) ~[spring-webmvc-5.0.12.RELEASE.jar:5.0.12.RELEASE]
        at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:797) ~[spring-webmvc-5.0.12.RELEASE.jar:5.0.12.RELEASE]
        at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.0.12.RELEASE.jar:5.0.12.RELEASE]
        at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:991) ~[spring-webmvc-5.0.12.RELEASE.jar:5.0.12.RELEASE]
        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:925) ~[spring-webmvc-5.0.12.RELEASE.jar:5.0.12.RELEASE]
        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:981) ~[spring-webmvc-5.0.12.RELEASE.jar:5.0.12.RELEASE]
        at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:884) ~[spring-webmvc-5.0.12.RELEASE.jar:5.0.12.RELEASE]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:660) ~[servlet-api.jar:?]
        at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:858) ~[spring-webmvc-5.0.12.RELEASE.jar:5.0.12.RELEASE]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) ~[servlet-api.jar:?]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) ~[catalina.jar:9.0.21]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[catalina.jar:9.0.21]
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) ~[tomcat-websocket.jar:9.0.21]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[catalina.jar:9.0.21]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[catalina.jar:9.0.21]
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:101) ~[spring-web-5.0.12.RELEASE.jar:5.0.12.RELEASE]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[catalina.jar:9.0.21]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[catalina.jar:9.0.21]
        at org.springframework.boot.actuate.web.trace.servlet.HttpTraceFilter.doFilterInternal(HttpTraceFilter.java:90) ~[spring-boot-actuator-2.0.8.RELEASE.jar:2.0.8.RELEASE]
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.0.12.RELEASE.jar:5.0.12.RELEASE]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[catalina.jar:9.0.21]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[catalina.jar:9.0.21]
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:320) ~[spring-security-web-5.0.11.RELEASE.jar:5.0.11.RELEASE]
        at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127) ~[spring-security-web-5.0.11.RELEASE.jar:5.0.11.RELEASE]
        at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91) ~[spring-security-web-5.0.11.RELEASE.jar:5.0.11.RELEASE]
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.0.11.RELEASE.jar:5.0.11.RELEASE]
        at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:119) ~[spring-security-web-5.0.11.RELEASE.jar:5.0.11.RELEASE]
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.0.11.RELEASE.jar:5.0.11.RELEASE]
        at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137) ~[spring-security-web-5.0.11.RELEASE.jar:5.0.11.RELEASE]
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.0.11.RELEASE.jar:5.0.11.RELEASE]
        at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111) ~[spring-security-web-5.0.11.RELEASE.jar:5.0.11.RELEASE]
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.0.11.RELEASE.jar:5.0.11.RELEASE]
        at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:170) ~[spring-security-web-5.0.11.RELEASE.jar:5.0.11.RELEASE]
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.0.11.RELEASE.jar:5.0.11.RELEASE]
        at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63) ~[spring-security-web-5.0.11.RELEASE.jar:5.0.11.RELEASE]
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.0.11.RELEASE.jar:5.0.11.RELEASE]
        at org.flowable.ui.common.filter.FlowableCookieFilter.doFilterInternal(FlowableCookieFilter.java:169) ~[flowable-ui-common-6.4.1.jar:6.4.1]
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.0.12.RELEASE.jar:5.0.12.RELEASE]
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.0.11.RELEASE.jar:5.0.11.RELEASE]
        at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116) ~[spring-security-web-5.0.11.RELEASE.jar:5.0.11.RELEASE]
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.0.11.RELEASE.jar:5.0.11.RELEASE]
        at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:74) ~[spring-security-web-5.0.11.RELEASE.jar:5.0.11.RELEASE]
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.0.12.RELEASE.jar:5.0.12.RELEASE]
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.0.11.RELEASE.jar:5.0.11.RELEASE]
        at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105) ~[spring-security-web-5.0.11.RELEASE.jar:5.0.11.RELEASE]
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.0.11.RELEASE.jar:5.0.11.RELEASE]
        at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56) ~[spring-security-web-5.0.11.RELEASE.jar:5.0.11.RELEASE]
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.0.12.RELEASE.jar:5.0.12.RELEASE]
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.0.11.RELEASE.jar:5.0.11.RELEASE]
        at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:215) ~[spring-security-web-5.0.11.RELEASE.jar:5.0.11.RELEASE]
        at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:178) ~[spring-security-web-5.0.11.RELEASE.jar:5.0.11.RELEASE]
        at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:357) ~[spring-web-5.0.12.RELEASE.jar:5.0.12.RELEASE]
        at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:270) ~[spring-web-5.0.12.RELEASE.jar:5.0.12.RELEASE]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[catalina.jar:9.0.21]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[catalina.jar:9.0.21]
        at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) ~[spring-web-5.0.12.RELEASE.jar:5.0.12.RELEASE]
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.0.12.RELEASE.jar:5.0.12.RELEASE]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[catalina.jar:9.0.21]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[catalina.jar:9.0.21]
        at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:109) ~[spring-web-5.0.12.RELEASE.jar:5.0.12.RELEASE]
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.0.12.RELEASE.jar:5.0.12.RELEASE]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[catalina.jar:9.0.21]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[catalina.jar:9.0.21]
        at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93) ~[spring-web-5.0.12.RELEASE.jar:5.0.12.RELEASE]
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.0.12.RELEASE.jar:5.0.12.RELEASE]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[catalina.jar:9.0.21]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[catalina.jar:9.0.21]
        at org.springframework.boot.web.servlet.support.ErrorPageFilter.doFilter(ErrorPageFilter.java:130) [spring-boot-2.0.8.RELEASE.jar:2.0.8.RELEASE]
        at org.springframework.boot.web.servlet.support.ErrorPageFilter.access$000(ErrorPageFilter.java:66) [spring-boot-2.0.8.RELEASE.jar:2.0.8.RELEASE]
        at org.springframework.boot.web.servlet.support.ErrorPageFilter$1.doFilterInternal(ErrorPageFilter.java:105) [spring-boot-2.0.8.RELEASE.jar:2.0.8.RELEASE]
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.0.12.RELEASE.jar:5.0.12.RELEASE]
        at org.springframework.boot.web.servlet.support.ErrorPageFilter.doFilter(ErrorPageFilter.java:123) [spring-boot-2.0.8.RELEASE.jar:2.0.8.RELEASE]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [catalina.jar:9.0.21]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:9.0.21]
        at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.filterAndRecordMetrics(WebMvcMetricsFilter.java:117) [spring-boot-actuator-2.0.8.RELEASE.jar:2.0.8.RELEASE]
        at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:106) [spring-boot-actuator-2.0.8.RELEASE.jar:2.0.8.RELEASE]
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.0.12.RELEASE.jar:5.0.12.RELEASE]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [catalina.jar:9.0.21]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:9.0.21]
        at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200) [spring-web-5.0.12.RELEASE.jar:5.0.12.RELEASE]
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.0.12.RELEASE.jar:5.0.12.RELEASE]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [catalina.jar:9.0.21]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:9.0.21]
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) [catalina.jar:9.0.21]
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [catalina.jar:9.0.21]
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490) [catalina.jar:9.0.21]
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) [catalina.jar:9.0.21]
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) [catalina.jar:9.0.21]
        at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:678) [catalina.jar:9.0.21]
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) [catalina.jar:9.0.21]
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) [catalina.jar:9.0.21]
        at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) [tomcat-coyote.jar:9.0.21]
        at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-coyote.jar:9.0.21]
        at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:853) [tomcat-coyote.jar:9.0.21]
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1587) [tomcat-coyote.jar:9.0.21]
        at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-coyote.jar:9.0.21]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_05]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_05]
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-util.jar:9.0.21]
        at java.lang.Thread.run(Thread.java:745) [?:1.8.0_05]
Caused by: org.flowable.common.engine.api.FlowableClassLoadingException: Class not found: FirstServiceTask
        at org.flowable.common.engine.impl.util.ReflectUtil.loadClass(ReflectUtil.java:90) ~[flowable-engine-common-6.4.1.jar:6.4.1]
        at org.flowable.common.engine.impl.util.ReflectUtil.instantiate(ReflectUtil.java:137) ~[flowable-engine-common-6.4.1.jar:6.4.1]
        ... 142 more
Caused by: java.lang.ClassNotFoundException: FirstServiceTask
        at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1365) ~[catalina.jar:9.0.21]
        at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1188) ~[catalina.jar:9.0.21]
        at java.lang.Class.forName0(Native Method) ~[?:1.8.0_05]
        at java.lang.Class.forName(Class.java:340) ~[?:1.8.0_05]
        at org.flowable.common.engine.impl.util.ReflectUtil.loadClass(ReflectUtil.java:338) ~[flowable-engine-common-6.4.1.jar:6.4.1]
        at org.flowable.common.engine.impl.util.ReflectUtil.loadClass(ReflectUtil.java:71) ~[flowable-engine-common-6.4.1.jar:6.4.1]
        at org.flowable.common.engine.impl.util.ReflectUtil.instantiate(ReflectUtil.java:137) ~[flowable-engine-common-6.4.1.jar:6.4.1]
        ... 142 more

org.springframework.boot.autoconfigure.EnableAutoConfiguration=org.example.basicflowable.config.ServiceTasksConfiguration needs to go in resources/META-INF/spring.factories instead of your application config.

It then only needs to be deployed into the apps that will executing processes (Flowable-Task and Flowable-Rest). Adding it to the others is unnecessary and may cause issues.

Will