As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
First of all there is the local or remote option. Initially I think focussing on local is good enough, but if someone disagrees, feel free to comment.
Secondly, there is the choice to just call an existing ejb with a predefined interface or to have it implement an activiti specific interface kind of like the java delegate. I prefere to initially focus on existing interfaces where context variables are passed on in the method call, but again, if someone disagrees…. So a method name is needed, a list of parameters (order is important)
Thirdly there is the return value. Should it be taken into account? It probably needs to be if it is about existing interfaces where you cannot add variables to the execution (if possible at all).
But most importantly, is it a new service task or is it an addition to the java service task. Personally I'm in favour of the latter … Using a 'type' like for the mail task is not what I'd do for ejb calls (I would for jms though)
… and it is probably even possible to use juel to resolve ejb's (high om my todo list, cdi?) and call the corresponding methods like in Seam.
So to summarize and propose element/attribute names- only local calls (attribute, activiti:jndi-name) - define a method name (attribute, activiti:method)- define parameters (extension element, activiti:arg, order is important, should be like the method signature and is comparable to the activiti:field)- define return value (extension element, optional: activiti:return) Thoughts?
it's important that you stick to the existing ejb interfaces. users should not implement JavaDelegate.
In terms of passing the parameters, compare it with method expressions passing in parameters. There's already a lot that you can do with that. And it is already possible somehow to invoke an ejb through a method expression. (maybe Joram can give pointers) Can you first evaluate when users should use method expressions with parameters and when they should be using the ejb activity? Once that is cleared out, then it also gives you better guidance for which features to develop first.
But most importantly, is it a new service task or is it an addition to the java service task. Personally I'm in favour of the latter … Using a 'type' like for the mail task is not what I'd do for ejb calls (I would for jms though)Tijs, is there a preferred way from the designer point of view? Maybe in context of the pluggability?
… and it is probably even possible to use juel to resolve ejb's (high om my todo list, cdi?) and call the corresponding methods like in Seam.first I explain that idea in detail and now you pretend that you had already thought about it before… tsssss
looks perfect to get started, but first evaluate how and where this is different from method expressions.it might also be early days for creating unit tests for this. i have high on my agenda to run the test suite in container on hudson (this release?). but i'm not there yet.
Regarding the 'pointer' refers to. A few months ago, I tried to wrap an EJB in a Spring bean anc call it through a method expression. That just worked as a charm, but you needed Spring obviously.
Or can the spring bean be generic
Isn't a resolver for juel another option?
Or can the spring bean be genericGood question, didnt try that yet. I'll give it a try tonight.
Isn't a resolver for juel another option?If you want method expression without a spring bean, probably yes.
protected ELResolver createElResolver(VariableScope variableScope) {<br> CompositeELResolver elResolver = new CompositeELResolver();<br> elResolver.add(new VariableScopeElResolver(variableScope));<br> elResolver.add(new ArrayELResolver());<br> elResolver.add(new ListELResolver());<br> elResolver.add(new MapELResolver());<br> elResolver.add(new DynamicBeanPropertyELResolver(ItemInstance.class, "getFieldValue", "setFieldValue")); //TODO: needs verification<br> elResolver.add(new BeanELResolver());<br> return elResolver;<br> }<br>
<br> private final boolean isResolvable(Object base, Object property) {<br> return base == null && property != null && property instanceof String;<br> }<br><br> @Override<br> public Object getValue(ELContext context, Object base, Object property) {<br> Object o = null;<br> if (isResolvable(base, property)) {<br> try {<br> // Properties currently read from jndi.properties<br> o = InitialContext.doLookup((String) property + "/remote");<br> } catch (NamingException e) {<br> // TODO logging…<br> e.printStackTrace();<br> }<br> context.setPropertyResolved(true);<br> return o;<br><br> }<br> return null;<br> }