What is the better integration way between jBPM5 and EJB services? - ejb-3.0

I spend last week learning about jBPM 5.3 and how to integrate to my JEE6 web app to execute a workflow with human task. My web app its a standard 3-tier web app (JSF + EJB3 + Hibernate) and i think I can invoke jbpm core services from ejb and ejb services from jBPM ProcessEngine, but I want to know what is the better way to do the integration? Is it advisable to enter a new integration layer? How can a WorkItem get access to EJB services (JNDI only?)?. Thanks for your time!

You can do a jNDI lookup inside the workitem handler. You can do whatever you want inside the workItemHandler implementation.
Cheers

Related

OSGi to SpringBoot

Currently we use OSGi framework for modular application development. But we are now planning to migrate it to springboot . Any relevant articles / tutorials / success stories on this ?
Any help would be greatly appreciated
Thanks
Niyas
I don`t think the is a simple migration path. Moving to spring boot will require changes all over the place in your application.
If you are looking into scaling in the form of microservices then this can also be done in OSGi. The enroute microservice tutorial shows how to leverage JAX-RS for REST communication and how to package your microservice into a runnable jar. This can then be easily deployed to kubernetes. See here for the code.

Creating a jbpm+spring ws

I'm trying to create a contract first spring web service using maven which is supposed to start a jbpm process by its id. I managed to create a simple spring ws using maven but i don't know how to relate it to my jbpm workflow, some guidance will be really appreciated.
If you have a web service already working now you only need to setup jbpm inside your project so you can start processes just calling the APIs.
Take a look at this blog post for more information about jBPM6 and Spring:
http://mswiderski.blogspot.co.uk/2014/01/jbpm-6-with-spring.html

Protocol Switching, Remote call to an EJB from presentation to Business using Spring

I have been using Spring DI and IOC extensively in my earlier projects. As per a new project requirement, we have to setup our projects as follows :
Business project (Java project)
Common project ( Java project)
Presentation project (Web project)
Business and presentation communicates/uses the common layer. However, the business and presentation are to be deployed in different app servers, and the communication between business and presentation is not http based. Presentation invokes the business through iiop protocol. That means, the protocol switching happens, while calling business (Java project) from presentation (web project).
In order to setup different application layers, I did something as follows :
In Business project, I encapsulated all business logic methods, and DAO methods in a facade object, using SPRING dependency Injection feature and normal OOPS technique.
Now I want to expose facade object using EJB, and from the presentation layer, I want to invoke the ejb jndi and get the facade object by making an EJB call.
I need to know :
How can I create an EJB (a simple stateless session bean EJB 2.1) and expose it using Spring ?
How can I access an EJB using spring ? (does not matter if the same has been exposed using spring or not)
I did not find any proper/complete example (even in spring ref), for doing the same configuration in spring.
Any help in this topic is highly appreciated.
Thanks and Regards,
Jitendriya Dash
Java/J2EE developer, Mumbai, India.
You don't expose it using Spring. You expose it by deploying it in your app server as a remote EJB. That's not Spring's responsibility.
You access a remote EJB by following the instructions in the reference documentation : http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/htmlsingle/spring-framework-reference.html#ejb.

How to integrate a SpringSource dm Server into another OSGi-based application server?

I would really like to use SpringSource dm Server, but our customer requires us to run our apps on their application server (Websphere). Is there a way to integrate SpringSource dm Server with other application servers? At least dm Server is build on OSGi, and many other application servers (including Websphere) are based on OSGi as well. Is it possible to run a SpringSource dm Server as a websphere component?
SpringSource dm Server is based on the Eclipse Equinox OSGi framework (and should not be confused with the Spring DM technology, included in dm Server, which can run on Equinox, Apache Felix, and Knopflerfish).
However, embedding dm Server in another application server, such as WebSphere Application Server, based on Equinox would be a non-trivial piece of work. It would be necessary to get both products to use the same version of Equinox, which they currently do not, then modify dm Server to support embedding in the server (e.g. to integrate with the host server's application invocation mechanism, thread pools, and class loading scheme).
If you think this support is important, please raise a requirement (which requires a simple registration) against dm Server.
Spring DM is deployed on a Knoplerfish OSGi implementation.
Websphere is deployed on an Equinox OSGi implmentation.
So the question becomes - are the two interchangeable? They both support R4, so I would say, yes, they are.
The next question would be to check dependencies, particularly with respect to things like HttpServices.
I would say this would be ok, but I think the final proof would be try deploying it. Easiest would be to drop the bundles into a Websphere deployment. You'll need your bundles and whatever spring bundles you're using.
I'm also interested in this topic. Another way of looking at this problem is that you want an application depoyable in both Spring dm server and a traditional app server (Websphere, weblogic, JBoss, ...).
The OSGi containers are embeddable inside non-OSGi applications, so it is theoretically possible to deploy an app to both Spring dm server and the same app + OSGi container to a traditional app server.
Now, as usual, the devil's in the details, including such topics of web development and bridging servlets between the outer app server and the OSGi container.
I do not think that this is really the case ...
see the following link for this: http://apsblog.burtongroup.com/2008/11/websphere-7-osgi.html
But it seems on the other side, that the trend is clear ... there will be a time when OSGI based application can be deployed on Java EE application servers

App Servers or Web Server for Spring Framework

first of all: that might be a newbie question. However after few searches I cannot find anything that would bring me further.
Basically what would be the reasons to choose an app server over a Spring framework to develop a medium complex web application? I am fairly new to Spring, did some hard core WebSphere for few years. While reading about Spring I see that it comes with a good bunch of features (transactions, persistence, messaging, connectors etc). Is Spring hard to scale or manage in a clustered environment?
Any comments welcome.
Thanks
Spring is awesome.
Your terminology is way off though. Spring is a Framework. It's a library that you use to write a web application.
An app Server is what your application runs in. You need both. For example, use the Spring Framework to create an app that runs in the Tomcat app server.
EAR files aren't a requirement for doing Java EE development.
It's not either/or: if you deploy a Java EE application you need a container of some kind.
I've deployed Spring apps on Tomcat and WebLogic. I think WebLogic is the best Java EE app server on the market. My decision about whether to deploy to it or not would be based strictly on availability.
You've seen that Spring has their own Java EE container now. It forks Tomcat and marries it with OSGi and Spring. I haven't tried it yet, but if the quality is similar to their framework it will be very promising indeed.
Are you really asking "When would I write an application using Spring? When should I choose EJB3?"
My preference these days is Spring. I can do persistence, transactions, messaging, web services, and everything else I need.
Bpapa,
you got me there, yes the terminology is wrong. I meant Spring + web container vs. App Servers. Surely the web app has to be deployed somewhere. I guess that shifts the question to the server side features as per my first post.
Topology example: Spring + Tomcat vs. WebSphere.
As a side note: people argue if Tomcat is an app server, many consider it rather a web container. You could not deploy an EAR file to Tomcat, can you? All it takes is a WAR, am I right? But that gets too academic.
Thanks a lot
Rod Johnson's "Expert 1:1 Java EE Development Without EJBs" is the basis for Spring. It's an excellent book, but I'd say it's a bit out of date now. The book was written with EJB2 in mind. It was published before Spring became an open source project. The framework is up to version 3.0 now, so I'd say that the book is of historical interest only. I'd recommend a more modern take on the question that takes Spring 3.0 and EJB3 into account.
%

Resources