Evie – A Developers Toolkit for Encoding Service Interaction Patterns Anthony M.J. O’Hagan1, Shazia Sadiq1, and Wasim Sadiq2 1
School of Information Technology and Electrical Engineering The University of Queensland, St Lucia, QLD 4072 Brisbane, Australia {tohagan, shazia}@itee.uq.edu.au 2 SAP Research Centre 133 Mary Street, QLD 4000 Brisbane, Australia
[email protected]
Abstract. Facilitation of collaborative business processes across organizational and infrastructural boundaries continues to present challenges to enterprise software developers. One of the greatest difficulties in this respect is achieving a streamlined pipeline from business modeling to execution infrastructures. In this paper we present Evie - an approach for rapid design and deployment of event driven collaborative processes based on significant language extensions to Java that are characterized by abstract and succinct constructs. The focus of this paper is to provide proof of concept of Evie through encoding examples that are inspired by service interaction patterns. Where as the patterns provide business semantics, the Evie language provides a rapid means of encoding them at an abstract level, and subsequently compiling them to create a fully fledged Javabased execution environment. Keywords: Service Interaction, Harmonized Messaging, Event Brokering.
1 Introduction Process enactment systems traditionally rely on the control flow defined within the process model to drive the process. This approach has been successful in the past. However, it becomes arguable for Collaborative Business Processes (CBPs) that are characterized by asynchronous and highly dynamic business activity. In collaborative processes, it is expected that independent specialized application components both within and across organizational boundaries will be capable of detecting and responding to the events that dictate subsequent process flow. These events can be many, can arise at any time during the overall process and their (time of) occurrence cannot be anticipated by dependent components. Modeling a collaborative process through the exchange of event data rather than through a rigid control flow between its activities is a significantly different albeit more natural way of capturing the logic behind collaborative processes. Thus, A. ter Hofstede, B. Benatallah, and H.-Y. Paik (Eds.): BPM 2007 Workshops, LNCS 4928, pp. 281–293, 2008.
© Springer-Verlag Berlin Heidelberg 2008
282
A.M.J. O’Hagan, S. Sadiq, and W. Sadiq
business activity takes place within application components, however the context for the business activity is provided by the event data. How the business activity deals with the data is not the question, instead capturing which business activity may need to be informed about a particular event, and when, is the question at hand. The critical factor is that the process enforcement system be empowered with sufficient intelligence so that the appropriate action can be taken when a particular event notification arrives. This action basically consists of communicating the relevant data to the right process participant such as, an application component, a business activity performer, or a workflow management system, at the right time. There have been several developments in this regard to assist in the modeling of business requirements that govern these interactions ([3], [4], [10]). However, it is the translation of business models into executable environments that remain a big bottleneck in the wider adoption of CBP related technologies. This is the basic premise of our work, that is, CBP are mostly designed by technical teams often software engineers, where high level models of limited or tedious functionality may prove unproductive. Following on this premise, we argue that there is a need to provide developer tools to facilitate the deployment of event driven CBPs. In this paper, we present an approach that attempts to capture the dynamics of CBPs and the underlying event dependencies through a scripting language - Evie. Without compromising on the importance of a model-driven approach, the Java language extensions are intended to provide the power of a programming style language, but at a sufficiently high level of abstraction. The developed program is intended to serve two objectives: to serve as a source for setting up an execution environment; and to serve as a target for a high level model (if available). We use the work achieved by [3] on service interaction patterns (SIP) as a source of business requirements in the context of event driven CBPs. Although there are a large number of service interaction patterns, we will only use some selected ones in this paper due to space limitations (for further examples see [14]). The purpose of these encodings is to provide proof of concept for Evie as a developers toolkit for rapid development of an executable environment for CBPs based on high level models such as the SIP patterns on one hand, and Java components on the other. In the remaining paper, we first present the proposed approach based on Evie, and the basic features of the Evie language1. The next section presents related work in this area in order to establish the position of this work. Section 4 presents proof of concept encodings of selected SIP patterns. Conclusions and main contributions are summarized in the section 5.
2 Background During the past several years, there has been extensive research on enterprise architectures in pursuit of the evasive business-IT alignment. The most significant technology development in the recent past impacting on enterprise architectures has been service oriented architectures or SOA [2]. Even though an essential stepping 1
A more detailed coverage of Evie’s syntax and semantics is covered in [14].
Evie – A Developers Toolkit for Encoding Service Interaction Patterns
283
stone for service enablement of enterprise applications, web services standards do not provide the complete solution for CBPs. Achieving communication between disparate enterprise applications through messaging is well established in message oriented middleware2, with recent trends towards solutions that can scale beyond the traditional hub-and-spoke message broker. The extended functionality of the Enterprise Service Bus (ESB) [6] is currently a dominant approach in this respect, providing the ability to store messages and establishing streamlined service communication. Recent developments from business software vendors have identified the need for solutions that go beyond service enablement and communication capability. These provide tools that allow multiple services both within and across enterprise systems to be collated into value added composite applications (see ESA & CAF from sap.com). We observe that a critical aspect of current enterprise architectures based on the above approaches is the management of the rules for service interaction (serviceinterationpatterns.com). This functionality would naturally reside in middleware components and is the main driver for the approach presented in this paper. While there have been significant developments within the first two phases of service enablement and communication, the last phase of managing service interaction still holds many challenges. CPBs are typically orchestrated by tools based on control flow such as BPEL. Difficulties in modeling service interactions through typical control flow constructs as found in workflow modeling languages are known to be ineffective in the CBP scenario due to the scale of options. Instead, approaches that utilize event processing have emerged as a more promising alternative [13]. Some operators and related event algebras can be found in: HiPAC [8], Compose [10], Snoop [5], RAPIDE [13], TriGS [16] and [7]. The Evie language is motivated by the need for rapid but reliable development of services that act as message brokers or gateways providing routing, transport and encoding mappings between disparate legacy and business partner servers. There is significant evidence that such infrastructures are featuring prominently in current enterprise systems (see SAP Exchange Infrastructure, IBM WebSphere, BEA AquaLogic, Oracle Integration and Microsoft Biztalk). Consequently, the need to provide tools for rapid development, testing and deployment for broker and gateway services has increased manifold. The Evie language targets this aspect by delivering an abstract and succinct means of expressing broker business logic. Compiled Evie programs are deployed within an execution framework API and user interface tools that support rapid systems integration development and simulation testing. The overall process for design and deployment of Evie applications can be summarized as: (1) A high level collaboration process is prepared by a business analyst using a model design tool that creates a set of graphical design artifacts. (2) A model compiler translates these into a skeleton Evie rule script that is augmented by a software engineer into a complete set of executable rules. (3) Finally, an Evie compiler translates Evie rules into Java components to be deployed and executed inside an Evie Framework server that exposes a set of broker services. 2
See middleware.org
284
A.M.J. O’Hagan, S. Sadiq, and W. Sadiq
2.1 Evie Language The Evie language defines a notation for event processing. It leverages existing technology investment by extending the Java language with additional constructs that describe dynamically ECA rules that implement service event behavior. An Evie event is a CBP state change communicated between partner services that is observable at a given point in time. Events provide the impetus for process progression in CBPs. Event types identify primitive CBP events. An event condition is a rule precondition that defines when a rule action executes. It may use event operators to express conditions requiring multiple events occurring over a period of time. Conditions may reference attributes of the event type (Payment) or event sender’s service type (Customer): receive Payment p from Customer c where c.status == "approved" && p.amount quote.bidPrice) { C.10 bestQuote = quote; C.11 } // if C.12 } // when C.13 } then when (delay(rfq.deadline)) { // Phase II C.14 if (bestQuote != null) { C.15 send new QuoteSuccess(bestQuote) C.16 to requester, bestQuote.sender; C.17 } else { C.18 send new QuoteFailure("No Quotes received") to requester; C.19 } C.20 repeat when (receive Quote quote from Supplier) { C.21 send new QuoteFailure("Not received before deadline") to quote.sender correlate quote; C.22 } // repeat when C.23 }then when (delay(days(30)){ // Phase III C.24 } C.25 } C.26 } C.27 } C.28 }
Example 5. Request for quote – RFQ Manager Rules
Pattern 8: Multi-responses. Synonyms. Streamed responses, message stream Description. A party X sends a request to another party Y. Subsequently, X receives any number of responses from Y until no further responses are required. The trigger of no further responses can arise from a temporal condition or message content, and can arise from either X or Y’s side. Responses are no longer expected from Y after one or a combination of the following events: (i) X sends a notification to stop; (ii) a relative or absolute deadline indicated by X; (iii) an interval of inactivity during which X does not receive any response from Y; (iv) a message from Y indicating to X that no further responses will follow. From this point on, no further messages from Y will be accepted by X.
Evie – A Developers Toolkit for Encoding Service Interaction Patterns
291
when (receive StartConversation from Role partner) { // ... activate other partner rules ... repeat exclusive { // Detect partner inactivity when (delay (mins(10)) { send Terminate to self; } when (receive Message from partner) { } // Observes all Message types. } } then when (receive Terminate from self) { send StopConversation to partner; }
Discussion. Evie rules can receive a stream of events of uniform or mixed type and respond to them until an event condition occurs. Evie event conditions and phases directly implement termination of behavior for all except (iii). This special case can be implemented by introducing a rule that detects when the inactivity period is occurs and sending an internal event type that can then be employed in termination event conditions. To detect inactivity we employ a repeat exclusive that will reset a time delay each time a message is received from a given partner. Pattern 10: Atomic multicast notification. Synonyms. Transactional Notification Description. A party sends notifications to several parties such that a certain number of parties are required to accept the notification within a certain timeframe. For example, all parties or just one party are required to accept the notification. In general, the constraint for successful notification applies over a range between a minimum and maximum number. send new Request(…) to Recipient; repeat when (receive Reply reply into List replies from Recipient where count(replies) = mimimum) { // ... success } }
Support for dynamic lists of service references within events allows Evie to fulfill many routing patterns. However, space does not permit us to cover all these in depth.
4 Summary and Conclusions Achieving streamlined support for Collaborative Business Processes is one of the key objectives of enterprise systems, since they offer new business opportunities, benefits of maximizing operational productivity, improved business resource utilization, and supports businesses in gaining competitive advantages. However, overcoming the complexity that surrounds the interoperation between partners in a CBP is by no means an easy task. Following on two basic intuitions: (1) there needs to be an explicit interconnect between high level business models and underlying execution infrastructures and (2) CBP setups are mostly undertaken by technical teams often software engineers, where high level models of limited or tedious functionality may prove unproductive; we have proposed Evie, as a high level language to form the pipeline between business analysts and software development teams both working towards the common goal of facilitating event driven CBPs.
292
A.M.J. O’Hagan, S. Sadiq, and W. Sadiq
The Evie approach is well aligned with current trends towards event based architectures for large scale integration systems. However, the proposed approach is distinguished in three respects: − Providing simple and uniform language constructs that allow the specification of diverse service interaction patterns − Ability to provide a level of abstraction from the execution details due to the compilation phase that generates the requisite objects and code for execution − Utilization of an execution model based on event subscription, that provides the ability to cater for high volume and long duration processes with minimal impact on system performance and response latency An important aspect of this approach is the ability to generate an Evie program from a high level modeling tool. This has not been considered in this paper, but is part of our future work. Further evaluation of Evie’s usability in the context of SIP as well as other encodings relating to various business scenarios and examples is anticipated.
References 1. van der Aalst, W., et al.: Workflow Patterns. Distributed and Parallel Databases 14(1), 5– 51 (2003), http://www.workflowpatterns.com 2. Alonso, G., et al.: Web Services Concepts. In: Architectures and Applications, Springer, Heidelberg (2004) 3. Barros, A., Dumas, M., ter Hofstede, A.H.M.: Service Interaction Patterns. In: van der Aalst, W.M.P., et al. (eds.) BPM 2005. LNCS, vol. 3649, pp. 302–318. Springer, Heidelberg (2005) 4. Barros, A., Dumas, M., ter Hofstede, A.H.M.: Service Interaction Patterns: Towards a Reference Framework for Service-Based Business Process Interconnection, tech. report FIT-TR-2005-02, Queensland Univ. of Technology (March 2005) 5. Chakravarthy, S., et al.: Composite Events for Active Databases: Semantics, Contexts and Detection. In: VLDB 1994. Paper presented at the Proceedings of 20th International Conference on Very Large Data Bases, Santiago, Chile (1994) 6. Chappell, D.A.: Enterprise Service Bus, 1st edn. O’Reilly Media, Inc., Sebastopol, California (2004) 7. Cao, D., Orlowska, M.E., Sadiq, S.W.: Formal Considerations of Rule-Based Messaging for Business Process Integration. Special Issue of Cybernetics and Systems: An International Journal 37(2) (February/March 2006) 8. Dayal, U., et al.: The HiPAC Project: Combining Active Databases and Timing Constraints. ACM’s Special Interest Group on Management Of Data (SIGMOD) 17(1), 51–70 (1988) 9. Decker, G., Puhlmann, F., Weske, M.: Formalizing Service Interactions. Business Process Management, 414–419 (2006) 10. Gehani, N.H., Jagadish, H.V., Shmueli, O.: Event specification in an active object-oriented database. In: SIGMOD 1992. Proceedings of the 1992 ACM Special Interest Group on Management Of Data international conference on Management of Data, San Diego, California, United States (1992) 11. Hohpe, G., Woolf, B.: Enterprise integration patterns: Designing, building, and deploying messaging solutions. Addison-Wesley, Reading (2004), http://eaipatterns.com
Evie – A Developers Toolkit for Encoding Service Interaction Patterns
293
12. Kilgore, R., Chase, C.: Testing Distributed Programs Containing Racing Messages. Computer Journal 40(8), 489–498 (1997) 13. Luckham, D.C.: The power of events: an introduction to complex event processing in distributed enterprise systems. Addison-Wesley, Boston (2002) 14. O’Hagan, A., Sadiq, S., Sadiq, W., Orlowska, M.E., Evie.: A Language to Implement Harmonized Messaging to facilitate Collaborative Business Processes. The University of Queensland, School of Information Technology and Electrical Engineering, Technical Report No. 467 (March 2007) 15. Shavit, N., Touitou, D.: Software Transactional Memory. In: Proceedings of the 14th ACM Symposium on Principles of Distributed Computing, pp. 204–213 (August 1995) 16. Retschitzegger, W.: Composite Event Management in TriGS - Concepts and Implementation. In: Quirchmayr, G., Bench-Capon, T.J.M., Schweighofer, E. (eds.) DEXA 1998. LNCS, vol. 1460, Springer, Heidelberg (1998) 17. Snir, M., Gropp, W.: MPI: The Complete Reference, 2nd edn. MIT Press, Cambridge (1998)