# Suggestion for CDI documentation improvement

**URL:** <https://forum.flowable.org/t/suggestion-for-cdi-documentation-improvement/12258>\
**Category:** Site Feedback\
**Created:** [May 15, 2025, 8:05am UTC](https://forum.flowable.org/t/suggestion-for-cdi-documentation-improvement/12258 "2025-05-15T08:05:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rofogo](https://avatars.discourse-cdn.com/v4/letter/r/c5a1d2/32.png) [@rofogo](https://forum.flowable.org/u/rofogo)\
**Post date:** [May 15, 2025, 8:05am UTC](https://forum.flowable.org/t/suggestion-for-cdi-documentation-improvement/12258/1 "2025-05-15T08:05:27Z")

</div>

Hi,

I recently ran into the problem of trying to integrate `Flowable` into an application that uses `CDI`/`JavaEE` via `WildFly` and `Weld` rather than `Spring` as its injection framework. While there is some (sparse) information about how the `flowable-cdi` extension works, I still bashed my head against a wall for a long time trying to get injection of `JavaDelegate` beans to work via EL. `Flowable` would always tell me that `"${myDelegate}"` was an unknown identifier, i.e. that bean resolution didn’t work. This was especially puzzling because normal injection of `JavaDelegate` beans via `@Inject` worked perfectly.

When I stumbled upon the solution by accident, namely that you have to use the named `@Named` annotation **in addition to** a `CDI` scope annotation like `@Dependent` for the bean name to become visible to the EL, I felt quite frustrated that there was no example on the [`flowable-cdi documentation page`](https://www.flowable.com/open-source/docs/bpmn/ch16-Cdi) that highlights this issue, and the `Spring` documentation is of no help either because it does not have this idiosyncrasy.

While I understand that this is a quirk of `CDI` and the EL, which is documented deep inside the [`CDI` specification](https://jakarta.ee/specifications/cdi/4.0/jakarta-cdi-spec-4.0.pdf) (section 10.2. “EL name resolution”), and not one of `Flowable` itself, I think you would do people a big favor adding a simple example of a `JavaDelegate` implementation that can be looked up in a BPMN `flowable:delegateExpression` statement, like the following one, and telling them that resolution definitely needs the `@Named` annotation:

```auto
@Dependent
@Named("myDelegateNameInEl") // won't be resolved in Expression Language without this
public class MyDelegate implements JavaDelegate
{
    @Override
    public void execute(DelegateExecution execution)
    {
        System.out.println("Running!");
    }
}

```

I hope this helps someone in the future, and thanks for your hard work maintaining `Flowable`!
