[Design of JBoss jBPM] - Re: statefull vs stateless delegation classes
by cvl
"alex.guizar(a)jboss.com" wrote : Won't caching make expression evaluation in delegation properties unfeasible?
|
| <delegation class="org.example.Taco">
| | <sauce>${actor.sauce.preference}</sauce>
| | </delegation>
|
| If the above is not a requirement (I have wished for it more than once, and not just me, see JBPM-1752) then we can have a single object per process definition. Otherwise we need a pool.
Well, how we solved this, is that we added the layer for all handlers, which injects the properties:
| <action class="com.xxx.jbpm.proxy.JbpmHandlerProxy">
| <handlerName>myHandler</handlerName>
| <propertyMap key-type='java.lang.String' value-type='java.lang.String'>
| <entry><key>myProperty</key><value>#{myVar}</value></entry>
| <entry><key>myProperty2</key><value>#{myVar2}</value></entry>
| </propertyMap>
| </action>
Not too nice, but usable.
cvl
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4211622#4211622
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4211622
15 years, 11 months
[Design of JBoss jBPM] - Re: statefull vs stateless delegation classes
by cvl
This sounds somewhat like deciding for the user how to use the system.
Why not add some flexibility - e.g. as with spring, you could point out the scope of the handler (like singleton).
Pool is good for non singleton handlers (like jsf works).
About the state in the action handler - we use that to autowire spring dependencies (@Autowire annotation)
For now we are using only singleton scope, so that's not a problem (if you don't reload spring container), but what if you want to add some custom scope, let's say @ProcessInstance.
Anyways, it's just an example, the idea is, why add some restrictions, where flexibility is wanted.
I'm for configurable option, and not globally of course, but for each handler (with sensible default).
cvl
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4211621#4211621
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4211621
15 years, 11 months