as an event-based state machine [Bremer et al., 2012]. In this type of software architecture business logic is concentrated in a workflow, that needs to be defined ...
Derivation of Event-Based State Machines from Business Processes Marat Abilov1 , Jorge Marx G´omez1 Carl von Ossietzky University of Oldenburg, Oldenburg, Germany {marat.abilov, jorge.marx.gomez}@uni-oldenburg.de Abstract The specification of requirements in the form of business processes models and internal representation of workflow engine in the form of state machine models possess similar features, yet contains some differences in internal and external representation. In order to reduce intermediate step in the process of converting former models to later ones, the model transformation process as a part of Model Driven Architecture is proposed.
1
Introduction
The central part of the IT-For-Green project is the workflow management system, that works as an event-based state machine [Bremer et al., 2012]. In this type of software architecture business logic is concentrated in a workflow, that needs to be defined by stakeholders. However, state machine notation might be considered as very formal and hard to be specified by business users, therefore there is a need in a workflow engineer, who will describe business requirements in a form of a state-machine. From the other hand, business users are familiar with process modelling languages, that they use to describe business processes. The logic that is captured inside workflow can be easily defined by means of business process language. Therefore the business requirements to a system can be specified in the form of a model that can be translated to another model used in a workflow engine for enactment. This translation process, if done manually, might bring the problem in keeping two separate models up-to-date and synchronizing changes between them. Model Driven Architecture (MDA) proposed by Object Management Group targets this kind of problem very well [Miller and Mukerji, 2003]. Speaking in terms of MDA, a Platform Independent Model in our case is a business process model described using Business Process Model and Notation (BPMN) language, and a Platform Specific Model is an event-based state-machine model described using State-Chart XML (SCXML) language. The question now is in providing the transformation in automatic way from the former to the later models. Query-View-Transformation operational language, that is now a part of MDA, provides means in automation of this process.
2
Extensions in the Models
In order to provide some flexibility to workflow management system, SCXML has been extended to support custom actions. Custom action is a special type of action that is executed by the system, for instance a service call or a display of a form. These types of actions are not a part of the executable content of SCXML. Therefore different XML namespace has been introduced to provide such possibility. The executable part of the custom action needs to be implemented as a JAVA class. From the other hand, the BPMN also doesn’t provide direct means in exploiting of user interfaces in user or manual tasks. Moreover, there are some problems in the web-service extension that can be specified in a service task. Therefore it has been decided to develop 1
Figure 1: Extension of BPMN an extension for BPMN model to solve these issues. The extension has been implemented as a plugin for the Eclipse BPMN modeller. The extension point is a task with special type: IT-For-Green task. The meta-model of the extension is presented on the figure 1.
3
Transformation Rules
The transformation between two models is defined as a set of rules, which are as follows: 1. Direct one-to-one mapping is performed from document root of the BPMN to a document root of SCXML. In the definitions part of the BPMN a process needs to be find. This process is mapped to a root container of SCXML. In the process the first node needs to be found, that is the one that has no incoming flows to it. In this case we need to make some restrictions to a business process model to have only one start event that has no incoming flows or messages. The first node is mapped to a state in SCXML. 2. If state with the same id exists in the current container, the rule is not applied. Depending on the type of the node there is different type of mapping that needs to be performed (see sub-rules). But any mapping from a node results in a state. Each outgoing sequence flow is transformed to a transition from the state (rule 3). For an exclusive diverging gateway a default sequence flow from it need to be mapped as the last.
(a) If the node is an activity then id of a new state is made equal to id of the activity. The activity needs to be checked whether it is a task. If it is a case, information from the task need to be mapped to an ”on-entry” section of the state. Depending on the task type there will be different on-entry sections (sub-rules 2(a)i, 2(a)ii, 2(a)iii). If the activity contains boundary events, sub-rule 2(a)iv is applied. If the activity possesses loop characteristics, sub-rule 2(a)v is applied. i. If the task is a script task then script part is added to the on-entry section with source equals to script part of the task. ii. If the task is a form task, the form section of the task is copied to a form section of the on-entry section. iii. If the task is a service call task, the service call section of the task is mapped to a service call section of the on-entry section. iv. For each boundary event a transition is created and added to the state. Additionally, a special state is created to which the transition targets. All outgoing sequence flows of the boundary event needs to be mapped to transitions from this state. v. Loop characteristics are mapped to a transition that targets the same state. A condition is added to the transition. If the characteristics are standard then the loop condition is copied to the transition condition. If the characteristics are multi-instance then negation of the completion condition is added to the transition condition. (b) If the node is a sub-process, id of the produced state is made equal to id of the process. The first node needs to be found in the sub-process and rule 2 is applied recurrently with new state as a container. The rules 2(a)iv and 2(a)v are applied for the business process if it has boundary events and loop characteristics respectively. (c) If the node is an intermediate throw event, id of the state is made equal to id of the event, In the on-entry section of the state raise expression with an event name equals to the state id is added. (d) If the node is a parallel diverging gateway then id of the state is made equal to id of the gateway. All outgoing sequence flows are mapped to parallel sub-states of the state (sub-rule 2(d)i) i. Id of the parallel state is made equal to id of the sequence flow. New sub-state is added to the parallel state with id equal to sequence flow id plus 1. New transition is added from this state. The target node of the sequence flow is mapped to a sub-state of the parallel state (rule 2). The transition targets the new sub-state. (e) If the node is an intermediate catch event, then id of the event is added to the event section of the transition pointed to this state. (f) Other node types are mapped to a state with id equal to node id 3. Each sequence flow that does not target a parallel converging gateway is mapped to a transition in the state specified by the previous mapping. If the flow contains a condition, this condition is mapped to a condition of the transition. If the sequence flow targets a parallel converging gateway then a container parallel state need to be founded by climbing up the state tree. After the parallel state is found, the transition is added to this state instead. The targeted node is mapped to new state. (rule 2). The transition targets the new state.
Figure 2: Sustainability Reporting Process
4
Case Study
Sustainability Report Processing [Solsbach et al., 2011] has been considered as a case study for validation of the model transformation. (cite here). The process describes high-level procedure to produce a sustainability report in an organization. In order to be translated to executable state-chart machine, it needs to be completed with formal executable information, for instance, data objects that are required and produced by activities and conditions of sequence flows. The process also needs to be validated against not having any deadlocks or live-locks. The Figure 2 specifies the process with required additions and modifications. This process has been transformed to a state machine depicted on Figure 3.
5
Implementation in EMF
BPMN model from the modeller with this extension was taken as source model, and in MDA terms, the Platform-Independent Model. Meta-model of event-based state machine has been derived from XML schema specification of the SCXML language. Plugin code has been generated from the meta-model, that brings EMF the support of SCXML, the target model, or in MDA terms, the Platform Specific Model. The transformation rules have been described on the Eclipse implementation of the QVTo language standard.
Figure 3: Sustainability Reporting State-Chart
6
Related Works
Communication Analysis approach [Espa˜ na et al., 2011] deals with derivation of object-oriented state machines from communication-oriented business process models. This approach stresses the communication as a driver for requirements engineering process. The resulting models are then used as an input to OO-Method [Pastor et al., 1997]. Although the result models are not well-suited for workflow management system, the resulted finding might be applicable in the broader context of current research.
7
Conclusion
State machine can be considered as more close to software design specification than business process models. Though the transformation from BPMN to SCXML is the first step in the process of deriving software design from software requirement specification, which is the goal of our ongoing research [Abilov, 2013]. Approaches and technologies for more iterative and formal way of software derivation from model-based requirements will make software development activities more precise and formal and therefore lead to a better quality software.
References [Abilov, 2013] Abilov, M. (2013). Bridging the gap between requirements and object-oriented models. In INFORMATIK 2013 Informatik angepasst an Mensch, Organisation und Umwelt, pages 18–29. Gesellschaft f¨ ur Informatik. [Bremer et al., 2012] Bremer, J., Mahmoud, T., and Rapp, B. (2012). Implementing CEMIS Workflows with State Chart XML. In EnviroInfo 2012 - Part 2: Open Data and Industrial Ecological Management. [Espa˜ na et al., 2011] Espa˜ na, S., Ruiz, M., Pastor, O., and Gonzalez, A. (2011). Systematic derivation of state machines from communication-oriented business process models. In 2011 Fifth International Conference on Research Challenges in Information Science (RCIS), pages 1–12. [Miller and Mukerji, 2003] Miller, J. and Mukerji, J. (2003). MDA guide version 1.0.1. [Pastor et al., 1997] Pastor, O., Insfr´ an, E., Pelechano, V., Romero, J., and Merseguer, J. (1997). OOMethod: an OO software production environment combining conventional and formal methods. In Oliv´e, A. and Pastor, J. A., editors, Advanced Information Systems Engineering, number 1250 in Lecture Notes in Computer Science, pages 145–158. Springer Berlin Heidelberg. [Solsbach et al., 2011] Solsbach, A., S¨ upke, D., vom Berg, B. W., and G´ omez, J. M. (2011). Sustainable online reporting model: A web based sustainability reporting software. In Information Technologies in Environmental Engineering, pages 165–177. Springer.