Sensoria - concurrency and mobility group
Sensoria - concurrency and mobility group
Sensoria - concurrency and mobility group
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
<strong>Sensoria</strong><br />
016004<br />
Software Engineering for Service-Oriented<br />
Overlay Computers<br />
Credit Portal Implementation<br />
Finance Case Study<br />
Author(s): Jannis Elgner <strong>and</strong> Michel Aless<strong>and</strong>rini (S&N)<br />
Period covered: from August 31, 2007 to August 31, 2008<br />
Date of preparation: July 10, 2008<br />
Revision: Draft<br />
Contract start date: September 1, 2005 Duration: 48 months<br />
Project coordinator: Martin Wirsing (LMU)<br />
Partners: LMU, UNITN, ULEICES, UWARSAW, DTU,<br />
PISA, DSIUF, UNIBO, ISTI, FFCUL, UEDIN, ATX, TILab,<br />
FAST, BUTE, S&N, LSS-Imperial, LSS-UCL, MIP, ATXT<br />
Integrated Project funded by the<br />
European Community under the<br />
“Information Society Technologies”<br />
Programme (2002—2006)
Credit Portal Implementation (Draft) July 10, 2008<br />
Contents<br />
1 Introduction 3<br />
2 Global Scenario 3<br />
3 Runtime-Environment 4<br />
3.1 jBPM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4<br />
3.2 Drools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5<br />
4 Application Architecture 5<br />
4.1 Graphic-oriented Programming (GOP) . . . . . . . . . . . . . . . . . . . . . . . . . . . 5<br />
4.2 Model-View-Controller Pattern (MVC) . . . . . . . . . . . . . . . . . . . . . . . . . . 6<br />
5 Processdefinition 7<br />
5.1 nodetypedefinition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7<br />
5.2 processdefinition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9<br />
5.3 taskdefinition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11<br />
6 Conclusion <strong>and</strong> Oulook 11<br />
References 11<br />
016004 (<strong>Sensoria</strong>) 2
Credit Portal Implementation (Draft) July 10, 2008<br />
1 Introduction<br />
This technical report shows the circumstances of the finance case study from S&N AG. It represents<br />
the credit request scenario [Koc06, Dos07] implemented with new SOA technologies from JBOSS 1 .<br />
The report is structured in five main parts. Beginning with the Introduction to give an overview of this<br />
document. The section 2 Global Scenario describes the background, the process <strong>and</strong> some details of<br />
the scenario. The presentation of the runtime demonstrates the chapter 3 Runtime-Environment. The<br />
application structure of the credit portal builds the base for the part 4 Application Architecture. Finally<br />
the section 5 Processdefinition explains the details of the process definitions. In the end a conclusion <strong>and</strong><br />
an outlook to perspectives to the credit request scenario is given.<br />
The finance case study of S&N defines user-interation in a service orientated environment. Only<br />
by using the specification Business Process Execution Language (BPEL) [OAS06a] the realisation of<br />
the human-interaction cannot be done. Following not st<strong>and</strong>ardized BPEL extensions like BPEL4People<br />
[AE05] must be used or own solutions must be developed. In the first credit portal version we have<br />
integrated a self-developed TaskService that realises the user-interaction with the business process implemented<br />
in BPEL. That specification has some more limitations. Currently it is not possible to use<br />
WS*-extensions like WS-Security [OAS06b] or WS-ReliableMessaging [OAS04] directly in the BPEL<br />
implementation. All these facts lead to the conclusion to develop a second version of the credit portal<br />
with slightly different technologies based on partly alternative specifications.<br />
We come to the decision to use JBOSS technologies for the next version of the credit portal. That<br />
technology supports extensible web service-invocations, user-interaction <strong>and</strong> the integration of defined<br />
rulesets. The last capability enables the organise workflows by rules. In comparison to BPEL the decision<br />
h<strong>and</strong>ler defines the processdefinition external. That approach is very dynamic <strong>and</strong> important for changing<br />
environments <strong>and</strong> processes. The bridge between the process manager <strong>and</strong> the application developer<br />
shows a further advantage because of the permanent synchronous states of the process definition <strong>and</strong> the<br />
application workflow.<br />
2 Global Scenario<br />
The credit request scenario [Ale07] is a part of a credit portal. In that scenario three roles are defined to<br />
process the requests: customer, clerk <strong>and</strong> supervisor.<br />
A business customer has the desire to buy an office building. In most cases he will request for a credit<br />
at his bank, in our case by using the credit portal. After starting the credit request process he must insert<br />
the credit amount <strong>and</strong> the purpose of that credit. Having entered this data he has to enter his balance<br />
data <strong>and</strong> securities. Either the balance data can be uploaded within an XBRL-Uploaddialog 2 [Int03] or<br />
the key issues can be entered directly. Following the balance data will be validated by a validation web<br />
service which decides whether the balance data is valid or not. If the balances are validated correctly <strong>and</strong><br />
also the securities, then the credit request is send to the bank. A pre-decision chooses whether the credit<br />
request can be directly approved, declined or send to an employee for proofing. The decision is based<br />
on some defined rules which are based on the data typed in by the credit-requester/customer. In case of<br />
the direct decision, the customer will be informed about the result. In case of a manual decision, a bank<br />
clerk has to process the customer credit request. Then he decides whether the request will be approved<br />
or declined. Additionally he is able to inform the customer about the possibility to update his data,<br />
otherwise the credit request would be rejected. This might be necessary if there are insufficient securites<br />
available, for example. In case of an approvement, the credit request is forwarded to a supervisor who<br />
also has to accept the credit request. Only if both employees accept the customer request an offer will be<br />
made to the customer.<br />
1 http://www.jboss.org/<br />
2 eXtensible Business Reporting Language<br />
016004 (<strong>Sensoria</strong>) 3
Credit Portal Implementation (Draft) July 10, 2008<br />
3 Runtime-Environment<br />
The runtime-environment consists of five different frameworks from the JBoss JEMS 3 [jbo07], namlely:<br />
JBoss - Application Server, JBoss Business Process Management jBPM , jBPM Process Definition Language<br />
(jPDL) [jbo06c], Seam [jbo08] <strong>and</strong> Drools [jbo06a]. These frameworks <strong>and</strong> their link to each other<br />
is shown in figure 1. All involved frameworks are running in one instance of the JBoss Applicationserver.<br />
Figure 1: Runtime-Environment<br />
The application was realised with JBoss Seam, a powerful open source development platform for<br />
building rich Internet applications in Java. Seam already integrates some functions from jBPM <strong>and</strong><br />
drools for seamlessly interaction together. As shown in figure 1 the application integrates the jBPM- <strong>and</strong><br />
the Drools-Engine.<br />
3.1 jBPM<br />
JBoss jBPM is a Business Process Management System supporting two business process modeling languages.<br />
In particular BPEL <strong>and</strong> jPDL a derivation of the specification Process Definition Language<br />
(XPDL) [WfM07]. The possibility to use BPEL <strong>and</strong> jPDL in one environment solves the problem which<br />
3 JBoss Enterprise Middleware System<br />
016004 (<strong>Sensoria</strong>) 4
Credit Portal Implementation (Draft) July 10, 2008<br />
occured in a scenario where only BPEL could be used. jPDL focuses on user interaction. The central<br />
component of jPDL is the workinglist. This approach was invented in the 80ś known as action-orientated<br />
data h<strong>and</strong>ling [Gad08]. He descibes a way how different tasks are delegated to different actors with different<br />
roles <strong>and</strong> different rights in different <strong>group</strong>s. The approach differentiates between a workinglist of<br />
<strong>group</strong>s <strong>and</strong> users. The different tasks (see 5.3) are assigned to one special actor or one <strong>group</strong> of actors.<br />
If someone wants to start a task he has to assign the task to himself, if it wasn’t already assigned to him<br />
directly, see figure 2.<br />
Figure 2: Workinglist<br />
With this methodology the system prevents that two different actors are working on the same task.<br />
Ths workinglist is the central component where all work begins that has to be done by a human actor.<br />
The implementation of the workinglist <strong>and</strong> the different tasktypes of this case study are described in<br />
section 5.3.<br />
3.2 Drools<br />
Drools is a Business Rule Management System (BRMS) <strong>and</strong> an enhanced Rules Engine implementation,<br />
ReteOO, based on Charles Forgy’s Rete algorithm [wik07] tailored for the Java language. The objectorientated<br />
rete algorithm filters the incoming data depending on its objecttype which means that only<br />
rules that are based on the incoming datatypes are fired. With its external BRMS it is possible to extract<br />
some of the application logic to a repository. In other words it is possible to extract the logic from the<br />
code which makes it easier to administrate the code. Other possibilities of these rules are complex rule<br />
flows that depend on the involved objects <strong>and</strong> their values. Moreover it is possible to calculate complex<br />
mathamatical operations based on defined rules <strong>and</strong> much more. In this case study it is used to control<br />
the workflow based on the values of objects. Moreover it is used to calculate a rating point system.<br />
4 Application Architecture<br />
The application architecture in detail contains the global view on it <strong>and</strong> detailed descriptions of the<br />
process definition <strong>and</strong> the underlying Graph Orientated Programming (GOP) principle.<br />
4.1 Graphic-oriented Programming (GOP)<br />
The process definition is based on the paradigm of the Graph Orientated Programming [jbo06b]. The<br />
structure of the graph is represented with the classes Node <strong>and</strong> Transition. A transition has a direction so<br />
the nodes have leaving- <strong>and</strong> arriving transitions, see figure 3.<br />
All implementations of the node types described in section 5.1 are based on this node class. Moreover<br />
each process model uses a process execution which looks similar to a finite state maschines or to the<br />
UML state diagrams. An execution (also known as a token) is represented with a class called Execution<br />
as shown in figure 4. An execution has a reference to the current node.<br />
016004 (<strong>Sensoria</strong>) 5
Credit Portal Implementation (Draft) July 10, 2008<br />
Figure 3: Node <strong>and</strong> Transition<br />
Figure 4: Node <strong>and</strong> Execution<br />
Every instantiated process creates a new process execution/token that will start in a wait state until<br />
it gets a signal. With this signal it leaves its current node over a transition to the next node where the<br />
relevant <strong>and</strong> implemented methods are executed. Every transition- <strong>and</strong> node-classes have special events<br />
like onNodeEnter, onNodeLeaver, onTransitionEnter, . . . that trigger special controller-actions. These<br />
are implemented in the controller-classes. These actions are classes <strong>and</strong> methods implemented in java.<br />
Based on this fact every possible behaviour can be imlemented <strong>and</strong> invoked from the process definition<br />
<strong>and</strong> the jBPM. That is why extended web services can be used like in plain java. Figure 5 shows the<br />
behaviour of the process definition <strong>and</strong> its execution(-token).<br />
Figure 5: GOP Details<br />
4.2 Model-View-Controller Pattern (MVC)<br />
The application is based on the MVC-pattern to separate the model, view <strong>and</strong> controller. The view is<br />
responsible for all user interactions. The model represents the objects <strong>and</strong> persistence. One object could<br />
be i.e. a credit object with different attibutes or a person object to identify the different actors. Figure 6<br />
shows all involved classes <strong>and</strong> their relation.<br />
The workflow has some node types, called decision h<strong>and</strong>ler, which decide the way of the workflow.<br />
In this case study these decision h<strong>and</strong>lers are linked with the rule engine that decides which transition the<br />
process-execution will take. This decision is based on the defined rules, the involved objects <strong>and</strong> their<br />
entered values.<br />
The controller classes are responsible for the provided actions, which means that they are responsible<br />
for operations on the data. These actions are triggerd by the jBPM-Engine <strong>and</strong> are defined by the process<br />
016004 (<strong>Sensoria</strong>) 6
Credit Portal Implementation (Draft) July 10, 2008<br />
Figure 6: Credit Portal Class Diagram (extract)<br />
model. They are annotated with special annotations which express/define whether to start a new process<br />
instance or to start or end a special task. The data h<strong>and</strong>ling is managed by the jBPM-engine which makes<br />
it possible to have long running conversations for process instances even if the server has shut down since<br />
the data is persisted after every process-step. This kind of persistence is also useful for later business<br />
intelligence analysis. All relevant task/process-information is persistent including begin/end-timestamp,<br />
involved variables, actors <strong>and</strong> so on.<br />
5 Processdefinition<br />
The process definition consists of different nodes controlling the behaviour of the workflow. The different<br />
node types are described in table 1. It is possible to extend this nodetypedefinition by defining own<br />
nodetypes. Based on the JBoss jPDL documentation all predefined nodetypes are described in table 1.<br />
5.1 nodetypedefinition<br />
016004 (<strong>Sensoria</strong>) 7
Credit Portal Implementation (Draft) July 10, 2008<br />
Nodetype<br />
task-node<br />
state<br />
decision<br />
Description<br />
A task node represents one or more tasks that are to be performed<br />
by humans. So when execution arrives in a task node, task instances<br />
will be created in the task lists of the workflow participants.<br />
After that, the node will behave as a wait state. So when<br />
the users perform their task, the task completion will trigger the<br />
resuming of the execution. In other words, that leads to a new<br />
signal being called on the token.<br />
A state is a bare-bones wait state. The difference with a task node<br />
is that no task instances will be created in any task list. This can<br />
be usefull if the process should wait for an external system. E.g.<br />
upon entry of the node (via an action on the node-enter event),<br />
a message could be sent to the external system. After that, the<br />
process will go into a wait state. When the external system send a<br />
response message, this can lead to a token.signal(), which triggers<br />
resuming of the process execution.<br />
Actually there are 2 ways to model a decision. The distinction between<br />
the two is based on *who* is making the decision. Should<br />
the decision made by the process (specified in the process definition).<br />
Or should an external entity provide the result of the<br />
decision.<br />
When the decision is to be taken by the process, a decision node<br />
should be used. There are basically 2 ways to specify the decision<br />
criteria. Simplest is by adding condition elements on the transitions.<br />
Conditions are EL 4 expressions or beanshell scripts that<br />
return a boolean.<br />
At runtime the decision node will FIRST loop over its leaving<br />
transitions THAT HAVE a condition specified. It will evaluate<br />
those transitions first in the order as specified in the xml. The first<br />
transition for which the conditions resolves to true will be taken.<br />
If all transitions with a condition resolve to false, the default transition<br />
(the first in the XML) is taken.<br />
Another approach is to use an expression that returns the name<br />
of the transition to take. With the ’expression’ attribute, you can<br />
specify an expression on the decision that has to resolve to one of<br />
the leaving transitions of the decision node.<br />
Next aproach is the ’h<strong>and</strong>ler’ element on the decision, that element<br />
can be used to specify an implementation of the Decision-<br />
H<strong>and</strong>ler interface can be specified on the decision node. Then the<br />
decision is calculated in a java class <strong>and</strong> the selected leaving transition<br />
is returned by the decide-method of the DecisionH<strong>and</strong>ler<br />
implementation.<br />
When the decision is taken by an external party (meaning: not<br />
part of the process definition), you should use multiple transitions<br />
leaving a state or wait state node. Then the leaving transition can<br />
be provided in the external trigger that resumes execution after<br />
the wait state is finished.<br />
Table 1: nodetypedefinition (part 1)<br />
016004 (<strong>Sensoria</strong>) 8
Credit Portal Implementation (Draft) July 10, 2008<br />
Nodetype<br />
fork<br />
join<br />
node<br />
Description<br />
A fork splits one path of execution into multiple concurrent paths<br />
of execution. The default fork behaviour is to create a child token<br />
for each transition that leaves the fork, creating a parent-child<br />
relation between the token that arrives in the fork.<br />
The default join assumes that all tokens that arrive in the join are<br />
children of the same parent. This situation is created when using<br />
the fork as mentioned above <strong>and</strong> when all tokens created by a fork<br />
arrive in the same join. A join will end every token that enters the<br />
join. Then the join will examine the parent-child relation of the<br />
token that enters the join. When all sibling tokens have arrived<br />
in the join, the parent token will be propagated over the (unique!)<br />
leaving transition. When there are still sibling tokens active, the<br />
join will behave as a wait state.<br />
The type node serves the situation where you want to write your<br />
own code in a node. The nodetype node expects one subelement<br />
action. The action is executed when the execution arrives in the<br />
node. The code you write in the actionh<strong>and</strong>ler can do anything<br />
you want but it is also responsible for propagating the execution.<br />
This node can be used if you want to use a JavaAPI to implement<br />
some functional logic that is important for the business analyst.<br />
By using a node, the node is visible in the graphical representation<br />
of the process. For comparison, actions –covered next– will allow<br />
you to add code that is invisible in the graphical representation of<br />
the process, in case that logic is not important for the business<br />
analyst.<br />
Table 2: nodetypedefinition (part 2)<br />
5.2 processdefinition<br />
The credit request scenario uses these node types to implement the given workflow <strong>and</strong> delegate different<br />
tasks to different actor. The process definition is shown in figure 7. The description of the different task<br />
<strong>and</strong> the assigned actors is shown in table 3.<br />
016004 (<strong>Sensoria</strong>) 9
Credit Portal Implementation (Draft) July 10, 2008<br />
Figure 7: Credit Request Process<br />
016004 (<strong>Sensoria</strong>) 10
Credit Portal Implementation (Draft) July 10, 2008<br />
5.3 taskdefinition<br />
Tasktypes Desciption Actor<br />
creditAmount<br />
the actor is asked to enter his type of customer<br />
credit <strong>and</strong> his creditamount<br />
uploadBalances<br />
the actor is asked to enter or upload his customer<br />
balancedata<br />
uploadSecurities the actor is asked to enter his securitydata<br />
customer<br />
updateInformation the actor has to validate the entered clerk<br />
data <strong>and</strong> has to accept the futher work<br />
if he is able to decide the creditrequest.<br />
Otherwise he has the possibility to reject<br />
the task to the actor<strong>group</strong><br />
createOffer<br />
the actor is asked to approve, decline clerk<br />
or decline but update the creditrequest,<br />
which means that the customer has the<br />
possibility to update his data <strong>and</strong> add<br />
some securities for example to prevent<br />
the decline of the creditrequest<br />
superiorDecision the actor has the same task like the createOffer-task.<br />
supervisor<br />
The only difference is<br />
the <strong>group</strong>role of this task.<br />
changeData<br />
the actor is asked to choose which data customer<br />
he wants to change<br />
changeSecurities same as uploadSecurities except that customer<br />
the actor has to change his old data <strong>and</strong><br />
not to enter new data<br />
changeCreditAmount same as creditAmount except that the customer<br />
actor has to change his old data <strong>and</strong> not<br />
to enter new data<br />
changeBalances<br />
same as balances except that the actor customer<br />
has to change his old data <strong>and</strong> not to<br />
enter new data<br />
decideOffer<br />
actor has to accept or reject the creditoffer<br />
customer<br />
Table 3: taskdefinition<br />
6 Conclusion <strong>and</strong> Oulook<br />
The finance case study shows how it is possible to implement user interaction in a SOA environment.<br />
Further work will be to integrate some of the tools developed in the SENSORIA project. The next step<br />
is the integration of DINO [DS07a, DS07b] to demonstate the dynamic semantic service discovery. The<br />
definition of ontologies for service level agreements will be modeled with UML4SOA profile <strong>and</strong> then<br />
transformed by the VIATRA-Framework [oTB06] from BUTE.<br />
016004 (<strong>Sensoria</strong>) 11
Credit Portal Implementation (Draft) July 10, 2008<br />
References<br />
[AE05]<br />
[Ale07]<br />
[Ale08]<br />
[Dos07]<br />
BEA IBM Oracle-SAP AG Active Endpoints, Adobe. Ws-bpel extension for people, August<br />
2005. http://www.ibm.com/developerworks/webservices/library/<br />
specification/ws-bpel4people/.<br />
Michel Aless<strong>and</strong>rini. Finance case study scenario descriptions. Technical report, SENSO-<br />
RIA, Paderborn, April 2007.<br />
Jannis Elgner; Michel Aless<strong>and</strong>rini. Finance case study wiki, 2008. http://www.pst.<br />
ifi.lmu.de:8080/FinanceCaseStudy.<br />
Michel Aless<strong>and</strong>rini; Daniel Dost. Requirements modeling <strong>and</strong> analysis of selected scenarios.<br />
Deliverable, SENSORIA, Paderborn, Leicester, August 2007. No. D8.3.a.<br />
[DS07a] Arun Mukhija; David Rosenblum; Andrew Dingwall-Smith. Dino - dynamic <strong>and</strong> adaptive<br />
composition of autonomous services, June 2007. http://www.cs.ucl.ac.uk/<br />
staff/a.mukhija/dino/.<br />
[DS07b]<br />
Arun Mukhija; David Rosenblum; Andrew Dingwall-Smith. Qos-aware service composition<br />
in dino. In Proceedings of the 5th European Conference on Web Services (ECOWS 2007),<br />
pages 3–12, Halle, Germany, November 2007. University College London, IEEE.<br />
[Gad08] Andreas Gadatsch. Grundkurs Geschäftsprozess-Management. vieweg, 2008.<br />
[Int03] XBRL International. Xbrl specification, version 2.1, December 2003. http://www.<br />
xbrl.org/SpecRecommendations/.<br />
[jbo06a]<br />
jboss.org. Jboss drools, 2006. http://www.jboss.org/drools/.<br />
[jbo06b] jboss.org. jbpm jpdl user guide, version 3.2, February 2006. http://docs.jboss.<br />
com/jbpm/v3.2/userguide/html/graphorientedprogramming.html.<br />
[jbo06c] jboss.org. jbpm process definition language, 2006. http://www.jboss.org/<br />
jbossjbpm/jpdl/.<br />
[jbo07]<br />
[jbo08]<br />
jboss.com. Jboss enterprise middleware, 2007. http://www.jboss.com/products/<br />
index.<br />
jboss.org. Jboss seam, 2008. http://www.seamframework.org/.<br />
[Koc06] Stefania Gnesi; Michel Aless<strong>and</strong>rini; Corrada Moiso; Nora Koch. Case studies scenario<br />
description. Deliverable, SENSORIA, Pisa, Paderborn, München, Florenz, August 2006.<br />
No. D8.0.<br />
[OAS04]<br />
Organization for the Advancement of Structured Information St<strong>and</strong>ards OASIS. Oasis web<br />
services reliable messaging (wsrm) tc, version 1.1, 2004. http://www.oasis-open.<br />
org/committees/tc_home.php?wg_abbrev=wsrm.<br />
[OAS06a] Organization for the Advancement of Structured Information St<strong>and</strong>ards OASIS. Web services<br />
business process execution language (wsbpel) tc, 2006. http://www.oasis-open.<br />
org/committees/tc_home.php?wg_abbrev=wsbpel.<br />
[OAS06b] Organization for the Advancement of Structured Information St<strong>and</strong>ards OASIS. Web services<br />
security (wss) tc, version 1.1, 2006. http://www.oasis-open.org/committees/<br />
tc_home.php?wg_abbrev=wss.<br />
016004 (<strong>Sensoria</strong>) 12
Credit Portal Implementation (Draft) July 10, 2008<br />
[oTB06]<br />
[WfM07]<br />
Budapest University of Technology <strong>and</strong> Economics (BME). The viatra2 transformation language<br />
specification, 2006. http://viatra.inf.mit.bme.hu/.<br />
Workflow Management Coalition WfMC. Process definition language (xpdl), 2007. http:<br />
//www.wfmc.org/st<strong>and</strong>ards/xpdl.htm.<br />
[wik07] wikipedia.org. Rete algorithm, 2007. http://en.wikipedia.org/wiki/Rete_<br />
algorithm/.<br />
016004 (<strong>Sensoria</strong>) 13