-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to add Spring beans into custom functions like Juel #922
Comments
@zxuanhong thank you for raising this. Please provide more context to your use case. Do you have a concrete example? |
@zxuanhong thank you for providing more context. I assume that you're using Camunda 7, right? Invoking a Spring bean in a FEEL expression doesn't work. The Camunda engine doesn't provide the Spring beans in the expression context. So, the FEEL engine can't resolve them. To support Spring beans, we would need to adjust the integration of the FEEL engine in Camunda 7. |
@saig0 I am wondering if Zeebe can support it so that we can extend it through Spring beans. Because some methods require processing within the Spring context (such as querying databases through dao ).Or can you provide relevant examples of integrating spring beans with feel |
Camunda 8 (Zeebe) has a different architecture and runtime model than Camunda 7. In Camunda 8, the engine has no direct access to the process application but communicates via job API (i.e. similar to external jobs in Camunda 7). So, neither the FEEL nor the BPMN engine can access Spring beans of the process application. In Camunda 8, your Spring application would implement a job worker that is invoked in a service task or an execution listener. |
@saig0 I need to use it in zeebe jobwork. I have defined some feed expression content in the header and used myself in the job worker to parse these expressions(It can also be defined as other expressions, but do not want the job worker system to embed too many expression engines) At the same time, in self-management deployment, it is meaningful to extend the feel function through Spring beans |
@zxuanhong sounds like a valid approach for Camunda 8. The Spring bean is part of your process application. You define a start execution listener on the user task to invoke the Spring bean and pass the leader as a variable (i.e. In general:
That was possible with Camunda 7 but for Camunda 8 this is not possible by design. The process application with the Spring bean doesn't run in the same JVM as the Camunda engine. |
@saig0 Because this expression is a method of a Spring bean. Obviously, the zeebe engine cannot have this bean. I just used a header to define a job worker business expression, which facilitates the zeebe job to be passed to the worker server. That's why I asked how to integrate the Spring Bean method into the feel |
It should be possible to invoke the Spring bean function in the FEEL expression if you pass the bean in the variable context. |
@saig0 I really don't understand how to pass parameters to the Spring Bean method. Can you provide a simple example. Thank you. |
@zxuanhong sorry. I can't help you here. The integration from Spring and FEEL is not our focus. However, feel free to come back if you have very concrete questions or an example. |
@saig0 I'm sorry to hear that. It is a bad choice to separate the feel expression from spring in the job work system. I'll stick with juel😔 |
Is your feature request related to a problem? Please describe.
How to add Spring beans into custom functions like Juel
Describe the solution you'd like
The text was updated successfully, but these errors were encountered: