AnsweredAssumed Answered

Can I have acces to custom beans without Spring?

Question asked by gsvano on Nov 9, 2012
Latest reply on Nov 9, 2012 by gsvano
Hi everyone!
I tried get access to my service to set dueDate in UserTask but.. fail
<userTask id="bidSelection" activiti:dueDate="${dateService.getDueDate()}" …

I tried set beans
Map<Object, Object> beans = new HashMap<Object, Object>();
beans.put("dateService", dateService);
((ProcessEngineConfigurationImpl) configuration).setBeans(beans);
but got same exception
Caused by: org.activiti.engine.impl.javax.el.PropertyNotFoundException: Cannot resolve identifier 'dateService'
   at org.activiti.engine.impl.juel.AstIdentifier.eval(AstIdentifier.java:83)
   at org.activiti.engine.impl.juel.AstMethod.invoke(AstMethod.java:79)
   at org.activiti.engine.impl.juel.AstMethod.eval(AstMethod.java:75)
   at org.activiti.engine.impl.juel.AstEval.eval(AstEval.java:50)
   at org.activiti.engine.impl.juel.AstNode.getValue(AstNode.java:26)
   at org.activiti.engine.impl.juel.TreeValueExpression.getValue(TreeValueExpression.java:114)
   at org.activiti.engine.impl.delegate.ExpressionGetInvocation.invoke(ExpressionGetInvocation.java:33)
   at org.activiti.engine.impl.delegate.DelegateInvocation.proceed(DelegateInvocation.java:37)
   at org.activiti.engine.impl.delegate.DefaultDelegateInterceptor.handleInvocation(DefaultDelegateInterceptor.java:25)
   at org.activiti.engine.impl.el.JuelExpression.getValue(JuelExpression.java:50)

As far I understand I should use Spring for it but my project not use Spring (I use EJB and CDI).
Are there any way to get my services beans in this case?
Maybe I do something wrong?
Thanks!

Outcomes