如何通过脚本和EL集成jBPM和Spring
我正在使用/预期以下技术堆栈:
- JSF
- Seam
- jBPM
- Spring
当然,我希望 Seam 能够直接访问 Spring beans,并且已经做到了这一点。 我现在想进入 jBPM 并开发一个概念验证流程定义,该流程定义访问 Spring bean 来执行操作并做出决策。
为了促进关注点分离并确保进程可以在类路径中没有 Seam 的情况下运行,我想要一个不允许访问所有 Seam 托管组件的解决方案。
我知道 Seam 使用定制的 EL 解析器,但除此之外,我该从哪里开始呢?
I'm using/anticipating the following technology stack:
- JSF
- Seam
- jBPM
- Spring
Of course, I'd like Seam to access Spring beans directly and have got this much to work fine. I'd now like to move down into jBPM and develop a proof of concept process definition that accesses Spring beans to perform actions and make decisions.
To promote separation of concerns and ensure the processes can run without Seam in the class path I'd like a solution that DOES NOT permit access to all of the Seam managed components.
I know Seam uses a bespoke EL resolver but other than that, where do I start?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
可以对 VariableResolver 进行子类型化并在 jbpm.cfg.xml 文件中指定您的子类型。 这可以允许 #{myBean} 解析为您的 bean。
但对于从脚本和操作进行访问,方法是注入 瞬态变量 进入流程实例,请记住您可能需要解决错误 JBPM-304 ,例如通过子键入脚本并调整关联的休眠映射文件。 在向每个流程实例发出每个信号之前,必须重复此注入。
这些技术可用于确保您能够访问您想要访问的 bean,但并不能真正为您提供自定义 EL。 这需要对 JbpmExpressionEvaluator 类进行一些认真的修改。
Its possible to subtype VariableResolver and specify your subtype in your jbpm.cfg.xml file. This can allow #{myBean} to resolve to your bean.
but for access from scripts and actions the way is to inject transient variables into the process instance, keeping in mind you may need to work around bug JBPM-304, by e.g. sub typing Script and adjusting the associated hibernate mapping files. This injection has to be repeated before each signal to each process instance.
These techniques can be used to ensure you have access to the beans you want access to, but don't really give you a custom EL. That would take some serious hacking of the JbpmExpressionEvaluator class.