# Flowable Springboot application deployment in Flowable Task app

**URL:** https://forum.flowable.org/t/flowable-springboot-application-deployment-in-flowable-task-app/4196
**Category:** Flowable Engine
**Created:** [July 16, 2019, 1:47pm UTC](https://forum.flowable.org/t/flowable-springboot-application-deployment-in-flowable-task-app/4196 "2019-07-16T13:47:38Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![subbubv](https://avatars.discourse-cdn.com/v4/letter/s/ce73a5/32.png) [@subbubv](https://forum.flowable.org/u/subbubv)
#### Post date: [July 16, 2019, 1:47pm UTC](https://forum.flowable.org/t/flowable-springboot-application-deployment-in-flowable-task-app/4196/1 "2019-07-16T13:47:39Z")

</div>

Hi,  
I have created a spring boot application which has some Java Delegates and Using the Autowired feature of Springboot to get the runtimeService. Here is the code for the same.

@Component(“checkEMail”)  
public class CheckEMailAddress implements JavaDelegate {

```
private static final Logger LOGGER = LoggerFactory.getLogger(CheckEMailAddress.class);

@Autowired
private RuntimeService runtimeService;

@Autowired
private TaskService taskService;

@Override
public void execute(DelegateExecution execution) {

	LOGGER.info("Checking the e-mail Address");
	runtimeService.setVariable(execution.getProcessInstanceId(), "isEmailExists", false);
	
}

```

}

I did a maven clean install and Used the jar file (Not the fat jar). Copied the jar file into the WEB-INF/lib folder of flowable-task app running in a tomcat. While running the process from task App I am getting null pointer for runtimeService.  
Please suggest.

---

<div class="post-metadata">

### Author: ![wwitt](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/wwitt/32/706_2.png) [@wwitt](https://forum.flowable.org/u/wwitt)
#### Post date: [July 16, 2019, 2:45pm UTC](https://forum.flowable.org/t/flowable-springboot-application-deployment-in-flowable-task-app/4196/2 "2019-07-16T14:45:23Z")

</div>

My guess is that you are using the “class” attribute on your service task instead of “delegateExpression”. Class will instantiate the delegate class without being Spring aware. I’m also guessing that your approach to extending the Flowable UI apps is insufficient to get your beans registered. [[https://flowable.org/docs/userguide/index.html#custom-bean-deployment](https://flowable.org/docs/userguide/index.html#custom-bean-deployment)]

Major requirements:

- A `META-INF/spring.factories` file to enable auto configuration
- An `@Configuration` that adds your components

Here’s a project demonstrating how to do it:

> **[unamanic/FlowableDelegateDemo](https://github.com/unamanic/FlowableDelegateDemo)**
>
> Contribute to unamanic/FlowableDelegateDemo development by creating an account on GitHub.

---

<div class="post-metadata">

### Author: ![wwitt](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/wwitt/32/706_2.png) [@wwitt](https://forum.flowable.org/u/wwitt)
#### Post date: [July 16, 2019, 6:12pm UTC](https://forum.flowable.org/t/flowable-springboot-application-deployment-in-flowable-task-app/4196/3 "2019-07-16T18:12:51Z")

</div>

Also, `DelegateExecution` has a setVariable method so you don’t need the runtime service for that purpose. If you needed other beans for some reason, you’d still need to work through getting them injected correctly.

Will

---

<div class="post-metadata">

### Author: ![subbubv](https://avatars.discourse-cdn.com/v4/letter/s/ce73a5/32.png) [@subbubv](https://forum.flowable.org/u/subbubv)
#### Post date: [July 18, 2019, 1:18am UTC](https://forum.flowable.org/t/flowable-springboot-application-deployment-in-flowable-task-app/4196/4 "2019-07-18T01:18:37Z")

</div>

> [@wwitt](#):
>
> ject demonstrating how to

Thank you very much for the quick response. Will try to implement the same and will update.

Regards,  
Subbu

---

<div class="post-metadata">

### Author: ![cirux88](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/cirux88/32/2421_2.png) [@cirux88](https://forum.flowable.org/u/cirux88)
#### Post date: [August 3, 2021, 1:13pm UTC](https://forum.flowable.org/t/flowable-springboot-application-deployment-in-flowable-task-app/4196/5 "2021-08-03T13:13:11Z")

</div>

Hi,  
I’m having the same problem: other beans are not injected into my JavaDelegate class.  
I followed the link to the Demo app, but this delegate is not injecting anythig:

```auto
@Component
public class DemoDelegate implements JavaDelegate {

    public void execute(DelegateExecution execution) {
        execution.setVariable("mmmbop", "It's Gone!");
    }
}

```

Is it possible to inject/autowire other beans inside a JavaDelegate?  
My autowired beans are always null.
