How using Ejbs (3.0) in Service-Tasks
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-23-2012 04:50 PM
4 REPLIES 4

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-24-2012 04:35 AM
+1
it would be nice if we could use EJB in Activiti.
it would be nice if we could use EJB in Activiti.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-24-2012 05:34 AM
Hi Guys,
if you have Java EE 6, you can use the activiti-cdi extension to call EJBs using Expression Language.
If you do not have CDI, you can use plain JavaDelegate Objects and lookup an instance of your EJB from JNDI.
You could even write a generic EJB resolver that can be parameterized with things like
* JNDI name,
* Interface name,
* method name,
* parameters
…
The reason we do not provide such "resolvers" in activiti is that there are just too many ways to do this and the way you will eventually do it will be specific to your environment and individual requirements (security, classloading, transctions etc…)
if you have Java EE 6, you can use the activiti-cdi extension to call EJBs using Expression Language.
If you do not have CDI, you can use plain JavaDelegate Objects and lookup an instance of your EJB from JNDI.
You could even write a generic EJB resolver that can be parameterized with things like
* JNDI name,
* Interface name,
* method name,
* parameters
…
The reason we do not provide such "resolvers" in activiti is that there are just too many ways to do this and the way you will eventually do it will be specific to your environment and individual requirements (security, classloading, transctions etc…)
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-25-2012 08:42 AM
Hello meyerd,
i think using a JavaDelegate-Object would be a possible way.
And what do you think about triggering a running process (or waiting in activiti for an event) from a bean?
Would you recommend using a rest-ws from inside the ejb or is there something more smoother?
regards
Matthias
i think using a JavaDelegate-Object would be a possible way.
And what do you think about triggering a running process (or waiting in activiti for an event) from a bean?
Would you recommend using a rest-ws from inside the ejb or is there something more smoother?
regards
Matthias
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-26-2012 04:14 PM
I would always use the java API RuntimeService, RepositoryService etc… unless there is a very good reason not to do it. (Depends on you deployment setting, of course).
So if you have an EJB and want to start a new process instance, you can simply do a runtimeService.startProcessInstanceByKey(…)
Now, the tricky part is of course, where is the runtimeService instance coming from
So if you have an EJB and want to start a new process instance, you can simply do a runtimeService.startProcessInstanceByKey(…)
Now, the tricky part is of course, where is the runtimeService instance coming from

