Using a @BusinessProcessScoped Bean

Hi all,

I am struggling to use a @BusinessProcessScoped annotaded bean.
After testing with @ApplicationScope all works fine.
But what I do not get is how the process instance is associated with the businessScoped bean.

I changed the starter according to the CDI documentation to:

ProcessInstance instance = businessProcess.startProcessByKey(“TopicApproval”, “1-1”, variables);
return instance.getRootProcessInstanceId();

And in my bpmn I am trying to reference the bean annotated with BusinessProcessScoped as before when it was annotaed with ApplicationScoped
But I get:

Unknown property used in expression: #{sendMailNotification.loop}

Somehow it does not know how to resolve the BusinessProcessScoped Bean.

So my question is: how is the processInstance associated with the BusinessProcess scoped bean?

Thank you for your help.

Wolfgang

It’s been a while since I’ve looked at CDI, so not sure how much this helps …
How did you define your bean? I’m assuming your sendMailNotification is a bean? Is loop a property or a method?

(I’m assuming you’ve checked https://flowable.com/open-source/docs/bpmn/ch16-Cdi/#working-with-businessprocessscoped-beans)