Many modern Java Enterprise applications are challenged with uses cases that need implementation of work flow patterns to achieve business goals. These use cases entail series of activities that needs to be executed in particular sequence with inter dependencies and/or dependencies on external services. However, many of these application do not have the luxury of using high cost SOA or BPM infrastructure to choreograph work flows. For such applications, this challenge can be met by employing “Spring Integration” which is part of the Spring family of Open Source projects.
Work flow applications typically coordinate multiple tasks to complete long running automated business processes such as Order processing, Event Management, Fleet management and Automated Scheduling, to name a few. Automated workflow is used to manage multiple activities such as sequencing, routing, adapting to external services, transformation, augmentation, parallel processing, and synchronization. Currently work flow applications are managed using sophisticated software which also fulfills requirements such as human interaction, dynamic business rule and periodic reporting.
Spring framework that provides comprehensive programming model for Web applications and which has been adopted industry wide, has added “Spring Integration” to it family of Spring Open Source projects. Spring Integration provides support for work flow implementation following the Enterprise Application Integration (EAI) pattern. It meets most of the automated work flow requirements especially where human interaction is not involved. It is implemented using messaging pattern and provides support for both synchronous and asynchronous communication.
This blog “Implementing Work Flow using Spring Integration” will use a work flow use case to cover the following
- Design a work flow application using Rational Software Architect (RSA)
- Identify Work flow elements, sequence, parallel tasks and synchronization.
- Develop work flow activities using Spring Integration framework
- Define work flow elements as POJOs using classes provided by Spring integration
- Implement business and routing logic within work flow elements