Home
Deployment of the Contract Compliant Checker: (User's Guide)
Contents
1. BusinessEvent originator buyer responder store type BUYPAY status succ ess etaeta Begin Response from CCC service lt xml version 1 0 encoding UTF 8 standalone yes gt lt result gt lt contractCompliant gt true lt contractCompliant gt lt result gt Sears End Response from CCC service folder Users ncmj2 CCCParser nccTestSeq xml correctchoreExecSeq1 filename event4 xml Sra Begin Request to CCC service BusinessEvent originator reset responder reset type reset status reset aeinn g End Request to CCC service AE Begin Response from CCC service lt xml version 1 0 encoding UTF 8 standalone yes gt lt result gt lt contractCompliant gt true lt contractCompliant gt lt result gt meaa e End Response from CCC service folder Users ncmj2 CCCParser nccTestSeq xml correctchoreExecSeq12 filename event1 xml oa Begin Request to CCC service BusinessEvent originator buyer responder store type BUYREQ status succ ess Deployment of the CCC 21 Beemer Begin Response from CCC service lt xml version 1 0 encoding UTF 8 standalone yes gt lt result gt lt contractCompliant gt true lt contractCompliant gt lt result gt Sars rass End Response from CCC service folder Users ncmj2 CCCParser nccTestSeq xml correctchoreExecSeq12 filename event2 xml Sane Begin Request to CCC servi
2. contract compliant and a response produced responder setContractCompliant true end rule Buy Payment deals with BuyPay events removes buyer s obligation to pay or cncel rule Buy Payment when e Event type BUYPAY originator buyer responder store status success eval ropBuyer matchesObligations payment then buyer s obligation to pay is satiasfied remove it ropBuyer removeObligation payment seller ropBuyer removeRight cancelation seller System out println Payment rule triggered The event is declared contract compliant and a response produced responder setContractCompliant true end rule Buy Cancellation deals with BuyCanc events removes buyer s obligation to pay or cancel rule Buy Cancellation when e Event type BUYCANC originator buyer responder store status success eval ropBuyer matchesRights cancelation then buyer s Obligation is satiasfied remove it ropBuyer removeRight cancelation seller ropBuyer removeObligation payment seller System out println matches right cancellation ropBuyer toString System out println Buy cancellation rule triggered The event is declared contract compliant and a response produced responder setContractCompliant true end rule Reset deals with reset events sent by the contractual application to signal the end of a contract run execution path In our example the contractual applic
3. in Test gt BAJBoss 7 1 Runtime Bos Y m2 Maven Build gt asr m2 CCCRest ear gt target m2 CCCRestClient pom xml 2 9 28 12 4 m2 New_configuration Liha boiia Fig 8 Specification of sequence location The structure of the nccTestSeq mal folder is similar to the of ccTestSeq mal except that this time the subfolder correctchoreExecSeq12 contains in ac cordance with Fig 4 a non contract compliant sequence namely BuyReq gt BuyPay gt reset Users ncmj2 pwd Users ncmj2 CCCParser nccTestSeq xml Users ncmj2 Users ncmj2 1s 1R total 0 drwxr xr x 6 ncmj2 staff 204 Nov 16 17 correctchoreExecSeq1 drwxr xr x 5 ncmj2 staff 170 8 Nov 16 19 correctchoreExecSeqi2 foe correctchoreExecSeq1 total 32 rw r r 1 ncmj2 staff 130 8 Nov 16 17 eventi xml rw r r 1 ncmj2 staff 131 8 Nov 16 17 event2 xml rw r r 1 ncmj2 staff 130 8 Nov 16 17 event3 xml rw r r 1 ncmj2 staff 127 8 Nov 16 17 event4 xml correctchoreExecSeq12 total 24 rw r r 1 ncmj2 staff 130 8 Nov 16 17 eventi xml rw r r 1 ncmj2 staff 130 8 Nov 16 19 event2 xml rw r r 1 ncmj2 staff 127 8 Nov 16 17 event3 xml Users ncmj2 cat Users ncmj2 CCCParser nccTestSeq xml correctchore ExecSeqi event1 xml lt event gt lt originator gt buyer lt originator gt lt responder gt store lt responder gt lt type gt BUYREQ lt type gt lt status gt success lt status gt lt event gt Deployment of the CCC 19 U
4. CCC Web Service To ease the task of managing the CCC dependecies and its deployment into the AS we use Maven facilities 5 The pom aml file that maven requires is provided in the CCC bundle see Fig 5 We have configured it with all the needed dependencies such as Drools resteasy hornet and mysql The following lines show how we launched the CCC Web service we assume that the database and the AS are already running Users ncmj2 pwd Users ncmj2 eclipse workspace CCCRest ear Users ncmj2 Users ncmj2 mvn clean package jboss as deploy INFO Scanning for projects INFO Reactor Build Order INFO CCCRest ear INFO CCCRest EAR Commons Module INFO CCCRest EAR EJB Module INFO CCCRest EAR WAR Module INFO CCCRest EAR EAR Module INFO Reactor Summary INFO INFO CCCRest ear cerro SUCCESS 1 127s INFO CCCRest EAR Commons Module SUCCESS 3 924s INFO CCCRest EAR WAR Module SUCCESS 4 628s INFO CCCRest EAR EAR Module SUCCESS 27 995s INFO BUILD SUCCESS INFO CCCRest EAR EJB Module SUCCESS 3 595s INFO Total time 42 724s INFO Finished at Thu Jan 24 18 04 45 GMT 2013 INFO Final Memory 25M 254M Users ncmj2 The deployment of the CCC Web service within the AS is acknowleged by the AS which produces the following messages on its screen 18 04 43 258 INFO org jboss weld deployer MSC service thread 1 3 J BASO16008 Starting weld se
5. Deployment of the Contract Compliant Checker User s Guide Carlos Molina Jimenez and Ioannis Sfyrakis 1 School of Computing Science Newcastle University UK carlos molina ncl ac uk 2 Graduated MSc student School of Computing Science Newcastle University UK giannisfyrakis gmail com Abstract This document is a walkthrough description of the deploy ment of version 1 1 of Contract Compliant Checker CCC The CCC is a software tool implemented at Newcastle Univeristy UK in Java and Jboss Drools It can be used for monitoring and enforcing of contract regulated interactions Examples of such interactions are contractual agreements signed between buyers and sellers of goods and contractual agreements signed between providers of computing services and their consumers The CCC is loaded with the set of ECA rules that represent the con tractual clauses of the contract under monitoring and deployed as a web service for example withing a trusted third party or within one of the business partners As a web service i the CCC listens to events REST ful messages produced by the application under monitoring ii processes them using its ECA rules and iii produces a response a RESTful mes sage indicating that the event was found to be either contract compliant or non contract compliant This document is aimed at potential users interested in downloading the CCC for example from the GitHub repository deploying it locally and t
6. M ni T CCCRestClient Fig 5 CCC eclipse project Deployment of the CCC 11 4 Launch of Components 4 1 Launch of the AS To launch the AS you need to execute the run sh shell script bin sh run standalone Jboss 7 1 1 exec JBOSS_HOME bin standalone sh server config standalone full ha xml This script is provided within the CCCRest ear bundle see Fig 5 To launch the AS go your working folder to Users ncemj2 eclipse workspace CCCRest ear in iour example and type run sh see the following text Users ncmj2 pwd Users ncmj2 eclipse workspace CCCRest ear sh Users ncmj2 run JBoss Bootstrap Environment JBOSS_HOME Users ncmj2 JAVA LIBRARIES jboss as 7 1 1 Final JAVA java JAVA_OPTS d32 client Xms64m Xmx512m XX MaxPermSize 256m Djava net preferIPv4Stack true Dorg jboss resolver warning true Dsun rmi dg c client gcInterval 3600000 Dsun rmi dgc server gcInterval 3600000 Dj boss modules system pkgs org jboss byteman Djava awt headless true Dj boss server default config standalone xml 17 06 46 332 INFO org jboss modules JBoss Modules version 1 1 1 GA 17 06 46 599 INFO org jboss msc JBoss MSC version 1 0 2 GA 17 06 46 653 INFO org jboss as JBASO015899 JBoss AS 7 1 1 Final Bro 17 06 58 668 IN ice thread 1 4 17 06 58 668 IN ice thread 1 4 17 06 58 670 IN Tj 0 FO HHHOOO108 Foreign keys HHHOO0126 org hibernate tool hbm2dd1 TableMet
7. The event is declared contract compliant and a response produced responder setContractCompliant true end rule Buy Reject deals with BuyRej events removes store s obligation to react to buy request rule Buy Reject when e Event type BUYREJ originator store responder buyer status success eval ropSeller matchesObligations React To Buy Request then System out println Buy Rejection Buyer s obligation is satisfied remove it ropSeller removeObligation React To Buy Request buyer System out println Buy Rejection System out println Buy Request Rejected rule triggered The event is declared contract compliant and a response produced responder setContractCompliant true end rule Buy Confirmation deals with BuyConf events removes store s obligation to react to buy request and imposes buyer s obligation to pay rule Buy Confirmation when e Event type BUYCONF originator store responder buyer status success eval ropSeller matchesObligations React To Buy Request then buyer s obligation is satisfied remove it ropSeller removeObligation React To Buy Request buyer Deployment of the CCC 9 impose buyer s obligation to pay within 60 seconds 2 min 1 hour ropBuyer addObligation payment seller 60 2 1 ropBuyer addRight cancelation seller 60 2 1 System out println Buy Request Confirmation rule triggered The event is declared
8. adata MSC serv org hibernate tool hbm2ddl TableMetadata MSC serv Indexes primary org hibernate tool hbm2dd1l SchemaUpdate MSC servi ce thread 1 4 HHH000232 Schema update complete 17 06 58 696 IN BASO16008 Starting 17 06 59 566 IN vice thread 1 1 17 06 59 843 IN MSC service thread FO FO FO 7 1401 for context 17 07 01 587 IN FO org jboss weld deployer MSC service thread 1 4 J weld service for deployment CCCRest ear ear org jboss resteasy cdi CdiInjectorFactory MSC ser Found BeanManager at java comp BeanManager javax enterprise resource webcontainer jsf config 1 1 Initializing Mojarra 2 1 7 jbossorg 1 2012022 CCCRest ear web org jboss web MSC service thread 1 1 JBAS018210 Registering web context CCCRest ear web 17 07 01 603 IN 18559 Deployed 17 07 01 612 IN Admin 17 07 JBoss 01 613 IN AS 7 1 1 FO Tj 0 FO org jboss as server Controller Boot Thread JBASO CCCRest ear ear org jboss as Controller Boot Thread JBAS015951 console listening on http 127 0 0 1 9990 Final org jboss as Controller Boot Thread JBAS015874 Brontes started in 15580ms Started 535 of 671 services 134 services are passive or on demand 12 Carlos Molina Jimenez and Ioannis Sfyrakis At this stage the instance of the JBoss AS is ready to accept deployments of the CCC for example Type ctrl c to stop the AS 4 2 Launch of the
9. ation sends a reset event after sending BuyRej BuyPay and BuyCanc The rule grants the buyer a right to submit a BuyReq so that a new contract run can be started rule Reset when e Event type reset eval ropBuyer matchesRights cancelation then System out println reset when ropBuyer reset ropSeller reset clear business failures flag for each business operation buyRequest setBusinessFailure false payment setBusinessFailure false buyConfirm setBusinessFailure false buyRe ject setBusinessFailure false cancelation setBusinessFailure false grant buyer s right to submit a BuyReq ropBuyer addRight buyRequest seller String null System out println Reset rule triggered The event is declared contract compliant and a response produced responder setContractCompliant true end 10 Carlos Molina Jimenez and Ioannis Sfyrakis We use the symbol to denote the happened before relation thus a b denotes that a happened before b Them in accordance with Fig 4 an example of a legal sequence of events would be BuyReq BuyConf BuyPay gt reset that would trigger the execution of four without counting the initialization rule rules namely rule Buy Request rule Buy Confirmation rule Buy Payment rule Reset Another valid sequence of events would be BuyReq BuyRej reset which would trigger the execution of three rules only namely rule Buy Request r
10. ce BusinessEvent originator buyer responder store type BUYPAY status succ ess ee arid Begin Response from CCC service lt xml version 1 0 encoding UTF 8 standalone yes gt lt result gt lt contractCompliant gt false lt contractCompliant gt lt result gt eons End Response from CCC service folder Users ncmj2 CCCParser nccTestSeq xml correctchoreExecSeq12 filename event3 xml Satine Begin Request to CCC service BusinessEvent originator reset responder reset type reset status reset rapa aa co Begin Response from CCC service lt xml version 1 0 encoding UTF 8 standalone yes gt lt result gt lt contractCompliant gt true lt contractCompliant gt lt result gt Soo 5 End Response from CCC service 7 Implementation Details about the technologies used in the implementaqtion of the CCC and the client can be found in Chapter 6 of the MSC dissertation that originated this work 6 UML class diagrams are also available 8 Licence The CCC is released under the Apache License Version 2 0 which is available from Apache s web pages Also you can find a tzt copy from our home page 7 9 Implementation History References 1 Corporation O Mysql data base http www mysql com 2012 JBoss Drools http www jboss org drools 3 OMG Documents associated with business process model and notation bpmn version 2 0 http ww
11. client is launched it looks for events stored in a local folder of your choice and enqueues them in the eventqueue In our examples we use the eclipse Run Configurations menu to indicate the client the location of the events 14 Carlos Molina Jimenez and Ioannis Sfyrakis 6 1 Run with Contract Compliant Events As shown in Fig 7 for this experiment we store the events in the Users nemj2 CCCParser cc TestSeq mal eno Run Configurations fie Hr 0 q Create manage and run configurations es Run a Java application Package Explorer 53 bpmn2promela Name RESTClient eater Spe liner sex Main 60 Arguments gt JRE gt Classpath jy Source BB Environment Common CCCRest ear ff Apache Tomcat Program arguments Y KY CCCRestClient ncmj2 CccR Eclipse Application jUsers ncmj2 CCCParser ccTestSeq xml Y Gi src main java amp Eclipse Data Tools auk f Generic Server Fuk ac E Generic Server External Launct fiuk ac ncl B Hibernate Console Configurati Y fi uk ac ncl client B HTTP Preview gt BusinessEvent java fh J2EE Preview gt CCCResponse java Java Applet gt R EventDTO java 2 9 Y D Java Application VM arguments gt R RESTClient java 2 ea RESTClient G src test java JuJUnit gt B JRE System Library J25E J JUnit Plug in Test m2 Maven Build m2 CCCRest ear gt m Maven Dependencies gt BAJBoss 7 1 Runtime JBoss m2 CCCRestClient gt S
12. e if the event is contract compliant CC or non contract compliant NCC The results re sponse CC NCC is sent to interested in parties such as the business partners Deployment of the CCC 3 1 2 Enforcement Example Imagine service providers providers for short that offers services to clients under the stipulation of a contract As a more specific example let us think of a provider that sells pre paid cards to clients that grant access to its service N for example five times Naturally such a provider would need to deploy a mechanism to allow legal request reach its service and reject ilegal ones those that exceed the agreed number An potential solution to this problem is shown in Fig 2 where the client and provider represent the business partners client red provider req gateway CCC res openlclose t Req service Fig 2 The CCC deployed as an enforcer In this scenario the the CCC is deployed as an enforcer it opens or closes the gateway that grants access to the service 1 The client sends a request req to the gateway 2 The gateway intercepts req and forwards it to the CCC which is loaded with the ECA rules that represent the contract between the client and provider 3 The CCC processes req and determines if the client has not exceeded yet his prepaid access five requests in this example 4 If req is declared legal by the CCC it responds with ope
13. ghtly 8 Carlos Molina Jimenez and Ioannis Sfyrakis global ROPSet ropSeller global TimingMonitor timingMonitor global BusinessOperation buyRequest global BusinessOperation payment global BusinessOperation buyConfirm global BusinessOperation buyReject global BusinessOperation cancelation global Responder responder rule Initialization initialize the ROP sets for buyer and seller This rule is launched only when the contract is set up Initialy the buyer has the right to submit a buy request rule Initialization when e Event type init then System out println Initialization when grant buyer s right to submit a buy request ropBuyer addRight buyRequest seller String null System out println Initialization rule triggered end rule Buy Request deals with BuyReq events removes buyer s right to submit buy request and imposes an obligation on the store to either reject or confirm the request rule Buy Request when e Event type BUYREQ originator buyer responder store status success eval ropBuyer matchesRights buyRequest then Remove buyer s right to place BuyReq ropBuyer removeRight buyRequest seller impose seller s obligation to either accept or reject the request BusinessOperation bos buyConfirm buyReject ropSeller addObligation React To Buy Request bos buyer 60 2 System out println Buy Request Received rule triggered
14. he figure involves five events BuyReq BuyRej BuyConf BuyPay Buy Canc that correspond to the five business operations buy request buy reject buy confirmation buy payment buy cancellation included in the English text of the contract We assume that the executions of all the five operations complete in success therefore we do not need fules for handling events that notify of ex ecutions that complete in failure In this order the BuyerStoreContract drl file includes only five contract related rules rule Buy Request rule Buy Reject rule Buy Confirmation rule Buy Payment rule Buy Cancellation In addition it includes an initialization rule rule Initialization and a reset rule Rule Reset The reset rule deals with reset event sent by the contractual application to signal the end of a contract run execution path In our example the contractual ap plication sends a reset event after sending BuyRej BuyPay and BuyCanc The main job of the reset rule is to grant the buyer a right to submit a BuyReq so that a new contract run can be started package BuyerStoreContractEx Import Java classes for EROP support import uk ac ncl erop Global variables persistent objects passed from outside global RelevanceEngine engine global EventLogger logger global RolePlayer buyer global RolePlayer seller global ROPSet ropBuyer 3 The rule names in the BuyerStoreContract drl file provided in the software bundle might very sli
15. hus the client application mimics the behaviour of the buyer store interac tion of Fig 1 in the sense that it produces the events involved in Fig 4 6 Launch of a Monitoring Example To lunch the client you need to run the RestClient java as a Java application see Fig 6 te OG G G gt HO bpmn2promela bpmn2promelagui i bpmnverifier D CCCRest ear Y fru CCCRestClient ncmj2 CCCRestClient Y f src main java Fuk Fhukac fiuk ac nel Y ff uk ac ncl client gt Jj BusinessEvent java 2 9 28 12 4 22 PM nd gt Bj CcCResponse java 2 9 28 12 4 22 PM nd gt Jj EventDTO java 2 9 28 12 4 22 PM ncmj2 ef RESTClient java 29 28 12 4 22 PM_ncmij GB src test java gt B JRE System Library J2SE 1 5 gt BA Maven Dependencies gt BAJBoss 7 1 Runtime JBoss 7 1 Runtime gt Gasre gt Grarget M pom xml 2 9 28 12 4 22 PM ncmj2 purchasing i synchroniser BO 224 re Run QFIL Debug F11 EI Debug E Team Synchr Run History oi 1 Run on Server XXR Run Configurations 2 Java Application 38x J Debug History gt Debug As gt Debug Configurations Toggle Breakpoint Toggle Line Breakpoint Toggle Method Breakpoint Toggle Watchpoint X Skip All Breakpoints Remove All Breakpoints 49 Add Java Exception Breakpoint Add Class Load Breakpoint a All References gt All Instances Instance Count Watch Inspect Nisnlav Fig 6 Client launch as a Java application Once the
16. in Response from CCC service lt xml version 1 0 encoding UTF 8 standalone yes gt lt result gt lt contractCompliant gt true lt contractCompliant gt lt result gt Sere a End Response from CCC service folder Users ncmj2 CCCParser ccTestSeq xml correctchoreExecSeq1 filename event2 xml SSanra t Begin Request to CCC service BusinessEvent originator store responder buyer type BUYCONF statu s success at RA BES End Request to CCC service T Begin Response from CCC service lt xml version 1 0 encoding UTF 8 standalone yes gt lt result gt lt contractCompliant gt true lt contractCompliant gt lt result gt A End Response from CCC service folder Users ncmj2 CCCParser ccTestSeq xml correctchoreExecSeq1 filename event3 xml SATEET Begin Request to CCC service BusinessEvent originator buyer responder store type BUYPAY status success eini End Request to CCC service Sore sass Begin Response from CCC service lt xml version 1 0 encoding UTF 8 standalone yes gt lt result gt lt contractCompliant gt true lt contractCompliant gt lt result gt See Sarg End Response from CCC service folder Users ncmj2 CCCParser ccTestSeq xml correctchoreExecSeq1 filename event4 xml Deployment of the CCC 17 Seas aces Begin Request to CCC service BusinessEvent originator rese
17. inessEvent originator reset responder reset type reset status reset pjes ia Begin Response from CCC service lt xml version 1 0 encoding UTF 8 standalone yes gt lt result gt lt contractCompliant gt true lt contractCompliant gt lt result gt DER End Response from CCC service 18 Carlos Molina Jimenez and Ioannis Sfyrakis 6 2 Run with Non Contract Compliant Events As shown in Fig 8 for this experiment we store the events in the Users ncemj2 CCCParser ncc TestSeq mal 4 Run Configurations tir O Create manage and run configurations i Package Explorer 52 Run a Java application bpmn2promela bpmn2promelagui D bpmnverifier Name RESTClient E CCCRest ear Main 65 Arguments JRE Classpath f gt Source BG Environment Common Y fray CCCRestClient ncmj2 CCG E Apache Tomcat Program arguments Y g src main java Eclipse Application JUsers ncmj2 CCCParser nccTestSeq xml Hauk Eclipse Data Tools Fhukac E Generic Server Eaukac nc Generic Server External Launct Y GR uk ac ncl client B Hibernate Console Configurati ey gt Rj BusinessEventjay HTTP Preview Vartablessx gt ACCCResponse javi J2EE Preview gt Jj EventDTO java 2 Eil Java Applet VM arguments E LARESTClient java 2 Y 7 Java Application GH src test java E RESTClient P AIRE System Library 2SE JuJUnit gt m Maven Dependencies J JUnit Plug
18. lt status gt lt event gt Users ncmj2 cat Users ncmj2 CCCParser ccTestSeq xml correctchore ExecSeq12 event2 xml lt event gt lt originator gt store lt originator gt lt responder gt buyer lt responder gt lt type gt BUYREJ lt type gt lt status gt success lt status gt lt event gt Users ncmj2 cat Users ncmj2 CCCParser ccTestSeq xml correctchore ExecSeq12 event3 xml lt event gt lt originator gt reset lt originator gt lt responder gt reset lt responder gt lt type gt reset lt type gt lt status gt reset lt status gt 16 Carlos Molina Jimenez and Ioannis Sfyrakis lt event gt As we can see from the lines shown above the events are XML tagged The correctchoreExecSeq1 folder contains the contract run that includes BuyReq gt BuyConf BuyPay reset similarly the correctchoreExecSeq12 folder con tains the contract run that includes BuyReq BuyRej reset In accordance with Fig 4 both contrac runs include only contract compliant events As shown in the lines below a run of the client confirm our expectations the events from both execution runs are declared contract compliant by the CCC log4j folder Users ncmj2 CCCParser ccTestSeq xml correctchoreExecSeq1 filename event1 xml ical rd Begin Request to CCC service BusinessEvent originator buyer responder store type BUYREQ status success Eiet aS End Request to CCC service rie ak eae ie Beg
19. ly storing records about the contractul interaction The current version uses a MySQL data base Free versions of MySQL data base servers can be downloaded from 1 We use version 5 x Once the MySQL Server is deployed you need to create a database and initialise it with the following table 3 2 Deployment of JBoss Drools The current version of the CCC uses Drools version 5 4 0 the latest version of Drools which can be dowloaded for free from 2 As explained in their documen tations the drools library are copied into a local working folder In our works we use 3 3 The drl Rule File By default the CCC is deployed with a dri rule file that containts the contract example between a buyer and seller discussed in Section 1 1 The file is called BuyerStoreContract drl is stored in JBOSS_HOME standalone Drools upload To support the explanation of the rules we will use a graphical representation of the contract written in BPMN choreography language 3 see Fig 4 Deployment of the CCC 7 BuyRej Store Store rej BuyPay Buyer _ _ Buyer e Buyer BuyReq BuyConf pay Buyer Store Store OH Buyer Store req conf startEv gi G2 BuyCanc 3 EndEv Buyer Buyer _ canc Store Fig 4 Graphical view of the buyer store contract T
20. n otherwise it produces close 5 The gateway forwards the request to the service only when the CCC responds with open 2 Abstract Architecture of the CCC We have implemented the CCC as a RESTful web service Fig 3 shows an ab stract view of its architecture In this section we will present and overview of the functionality of its components Details about their implementations de ployments and configurations will be presented in subsequent sections 4 Carlos Molina Jimenez and Ioannis Sfyrakis rbupdate OZ maan rule editor URI file upload l rule browser method POST base eventqueue q ccc URI queues jms queue events create _ logic database Lt DB method POST decoupler rs contractual application TESPQUCUC Se ae tae URI queues jms queue resp read pale i method POST is ngu ee client presentation layer logic layer DB access layer data layer Fig 3 Abstract architecture of the CCC As shown in the figure conceptually the CCC consists of four layers pre sentation logic DB access and data layers and is expected to interact with external entities that are represented by a client tier Client The client represents the external entity to the CCC and consists of a rule editor for example a browser and a contractual application The rule editor is used by rule administrators for updating the rule base of the CCC It offers editi
21. ncmj2 CCCParser nccTestSeq xml correctchore ExecSeq12 event3 xml lt event gt lt originator gt reset lt originator gt lt responder gt reset lt responder gt lt type gt reset lt type gt lt status gt reset lt status gt lt event gt As we expected see results below a run of this experiement shows that the CCC declares the event BuyPay non contract compliant log4j folder Users ncmj2 CCCParser nccTestSeq xml correctchoreExecSeq1 filename event1 xml 20 Carlos Molina Jimenez and Ioannis Sfyrakis Scars Begin Request to CCC service BusinessEvent originator buyer responder store type BUYREQ status success n as End Request to CCC service ia viata Begin Response from CCC service No messages left in queue al a oc End Response from CCC service folder Users ncmj2 CCCParser nccTestSeq xml correctchoreExecSeq1 filename event2 xml Sa Begin Request to CCC service BusinessEvent originator store responder buyer type BUYCONF statu s success Seas End Request to CCC service Te a Begin Response from CCC service lt xml version 1 0 encoding UTF 8 standalone yes gt lt result gt lt contractCompliant gt true lt contractCompliant gt lt result gt Fese End Response from CCC service folder Users ncmj2 CCCParser nccTestSeq xml correctchoreExecSeq1 filename event3 xml igre ae Begin Request to CCC service
22. ng facilities and means for sending the edited file to the CCC as a conventional HTTP POST request The contratual application represents the contractual application under monitoring or enforcement For instance in Figs 1 the contractual application corresponds to buyer and store Similarly regarding Fig 2 the contractual application corresponds to the client Presentation layer The CCC interacts with external entities through its presentation layer which we have implemented as three RESTful endpoints A rbupdate rule base update point that accepts POST request sent by administrator to update the current rule base of the CCC An eventqueue that accepts and stores events produced by the contractual application and sent as RESTful POST requests Examples of events pro duced by the buyer store contract example would be BuyReq BuyConf and BuyPay that correspond respectively to the execution of buy request buy confirmation and payment operations To support portability of events the eventqueue accepts events tagged with XML tags For example the BuyConf and BuyPay events are expected to be formatted as follows lt event gt lt originator gt store lt originator gt lt responder gt buyer lt responder gt lt type gt BuyConf lt type gt lt status gt success lt status gt lt event gt lt event gt lt originator gt buyer lt originator gt lt responder gt store lt responder gt lt type gt BuyPay lt type gt lt
23. rvice for deployment CCCRest ear ear 18 04 43 467 INFO org jboss resteasy cdi CdiInjectorFactory MSC ser vice thread 1 2 Found BeanManager at java comp BeanManager 18 04 43 759 INFO javax enterprise resource webcontainer jsf config MSC service thread 1 2 Initializing Mojarra 2 1 7 jbossorg 1 2012022 7 1401 for context CCCRest ear web 18 04 44 985 INFO org jboss web MSC service thread 1 2 JBAS018210 Registering web context CCCRest ear web 18 04 45 030 INFO org jboss as server management handler thread 2 JBASO018562 Redeployed CCCRest ear ear 18 04 45 031 INFO org jboss as server management handler thread 2 JBASO18565 Replaced deployment CCCRest ear ear with deployment CC CRest ear ear Deployment of the CCC 13 At this stage the CCC is Web service ready for work It is waiting for the arrival of events to the eventqueue 5 Deployment of the Client To test the functionality of the CCC Web service we have implemented a client application that can play the role of the contractual application shown in the client tier of Fig 3 The client application can be conveniently deployed as an eclipse project as shown in Fig 5 where it appears as CC CRestClient The client produces and enqueues events in the eventqueue and retrieves events from the respqueue We use it to demonstrate the use of the CCC in the monitoring of the contract example between the buyer and store discussed in Section 1 1 T
24. rw r r 1 ncmj2 staff 130 8 Nov 15 46 event2 xml rw r r 1 ncmj2 staff 127 8 Nov 15 46 event3 xml Users ncmj2 cat Users ncmj2 CCCParser ccTestSeq xml correctchore ExecSeqi event1 xml lt event gt lt originator gt buyer lt originator gt lt responder gt store lt responder gt lt type gt BUYREQ lt type gt lt status gt success lt status gt lt event gt Users ncmj2 cat Users ncmj2 CCCParser ccTestSeq xml correctchore ExecSeqi event2 xml lt event gt lt originator gt store lt originator gt lt responder gt buyer lt responder gt lt type gt BUYCONF lt type gt lt status gt success lt status gt lt event gt Users ncmj2 cat Users ncmj2 CCCParser ccTestSeq xml correctchore ExecSeq1 event3 xml lt event gt lt originator gt buyer lt originator gt lt responder gt store lt responder gt lt type gt BUYPAY lt type gt lt status gt success lt status gt lt event gt Users ncmj2 cat Users ncmj2 CCCParser ccTestSeq xml correctchore ExecSeq1 event4 xml lt event gt lt originator gt reset lt originator gt lt responder gt reset lt responder gt lt type gt reset lt type gt lt status gt reset lt status gt lt event gt Users ncmj2 Users ncmj2 cat Users ncmj2 CCCParser ccTestSeq xml correctchore ExecSeq12 event1 xml lt event gt lt originator gt buyer lt originator gt lt responder gt store lt responder gt lt type gt BUYREQ lt type gt lt status gt success
25. rying it by means of running the provided examples It covers the deployment on Windows Mac and Linux platforms 1 Introduction The CCC is a software tool that we have implemented at Newcastle Univeristy UK in Java and Jboss Drools It can be deployed as a contract monitor or alternatively as a contract enforcer By monitor we mean that the CCC acts as a passive observer of the interaction whereas by enforcer we mean that the CCC actively interfears with the interaction to prevent business partner to execute contractually ilegal actions In both deployments the CCC is provided with the set of Event Condition Action rules ECA rules that represent the contractual clauses of the contract of interest and deployed as a web service It can be physically deployed withing a trusted third party or within one of the business partners Its job is to listen to and process events and determine if the business partners are observing their contract clauses We will use two examples to explain the operation of the CCC 2 Carlos Molina Jimenez and Ioannis Sfyrakis 1 1 Monitoring Example Let us assume that a buyer and store have agreed to trade under the following contract This contract example is oversimplified and uncomplete yet it it good enough for explaining our ideas 1 The buyer can place a buy request with the store to buy an item 2 The store is obliged to respond with either buy confirmation or buy re jection within 3 days of receiving
26. sers ncmj2 cat Users ncmj2 CCCParser nccTestSeq xml correctchore ExecSeqi event2 xml lt event gt lt originator gt store lt originator gt lt responder gt buyer lt responder gt lt type gt BUYCONF lt type gt lt status gt success lt status gt lt event gt Users ncmj2 cat Users ncmj2 CCCParser nccTestSeq xml correctchore ExecSeq1 event3 xml lt event gt lt originator gt buyer lt originator gt lt responder gt store lt responder gt lt type gt BUYPAY lt type gt lt status gt success lt status gt lt event gt Users ncmj2 cat Users ncmj2 CCCParser nccTestSeq xml correctchore ExecSeqi event4 xml lt event gt lt originator gt reset lt originator gt lt responder gt reset lt responder gt lt type gt reset lt type gt lt status gt reset lt status gt lt event gt Users ncmj2 pwd Users ncmj2 CCCParser nccTestSeq xml Users ncmj2 cat Users ncmj2 CCCParser nccTestSeq xml correctchore ExecSeq12 event1 xml lt event gt lt originator gt buyer lt originator gt lt responder gt store lt responder gt lt type gt BUYREQ lt type gt lt status gt success lt status gt lt event gt Users ncmj2 cat Users ncmj2 CCCParser nccTestSeq xml correctchore ExecSeq12 event2 xml lt event gt lt originator gt store lt originator gt lt responder gt buyer lt responder gt lt type gt BUYPAY lt type gt lt status gt success lt status gt lt event gt Users ncmj2 cat Users
27. status gt success lt status gt lt event gt Deployment of the CCC 5 The originator specifies the business partner that initiated the execution of the operation likewise reponder specifies the business partner that re sponded to the operation finally status specifiess the outcome of the oper ation we will elaborate on this parameter later Thus the BuyConf event notifies that the execution of a buy request operation was originated by the store responded by the buyer and completed in success Similarly the Buy Pay event notifies that the execution of a payment operation completed in sucess and was originated by the buyer responded by the store An respqueue response queue where the CCC stores the results contract compliant or non contract compliant of the evaluation of the events To support portability of results the CCC produces results tagged with XML tags like in the following two examples lt result gt lt contractcompliance gt true lt contractcompliance gt lt result gt lt result gt lt contractcompliance gt false lt contractcompliance gt lt result gt The first example is the response to an event that was declared contract compliant true by the CCC In contrast the second example is the response to an event declared non contract compliant false by the CCC Logic layer The Logic layer is represented by the CCC logic which consist of a rule base rule engine and ancillary Java classes not sho
28. t responder reset type reset status reset primi ea Begin Response from CCC service lt xml version 1 0 encoding UTF 8 standalone yes gt lt result gt lt contractCompliant gt true lt contractCompliant gt lt result gt seat aaa End Response from CCC service folder Users ncmj2 CCCParser ccTestSeq xml correctchoreExecSeq12 filename event1 xml iat Begin Request to CCC service BusinessEvent originator buyer responder store type BUYREQ status success R sss End Request to CCC service PRs ss Begin Response from CCC service lt xml version 1 0 encoding UTF 8 standalone yes gt lt result gt lt contractCompliant gt true lt contractCompliant gt lt result gt Segre End Response from CCC service folder Users ncmj2 CCCParser ccTestSeq xml correctchoreExecSeq12 filename event2 xml ara ad Begin Request to CCC service BusinessEvent originator store responder buyer type BUYREJ status success Reem oe End Request to CCC service rT Begin Response from CCC service lt xml version 1 0 encoding UTF 8 standalone yes gt lt result gt lt contractCompliant gt true lt contractCompliant gt lt result gt ra aS End Response from CCC service folder Users ncmj2 CCCParser ccTestSeq xml correctchoreExecSeq12 filename event3 xml N ERN Begin Request to CCC service Bus
29. the buy request a No response from the store within 3 days will be treated as a buy rejection 3 The buyer can either pay or cancel the buy request within 7 days of receiving a confirmation a No response from the buyer within 7 days will be treated as a cancellation Imagine that the two business partners decide to monitor their contractual interaction A typical deployment of the CCC for addressing this question is shown in Fig 1 gt buyer S 5 trusted third party Oo ge lt o ow t Ss ro S events ccc 2 z2 S a g 8 1 response CC NCC i store Fig 1 The CCC deployed as a contract monitor In the figure buyer and store represent the two parties involved in the con tract The trusted third party is a third party that operates the CCC which is assumed to be loaded with the ECA rules that represent the contractual clauses As shown in the figure the business partners use a communication channel com munication chan for exchanging their business messages In addition they use a monitoring channel monitoring chan for notifying events of interest to the CCC Examples of events are events that notify of the execution of a contractual business operation such as the execution of a buy resquest operation by buyer or the execution of a confirmation operation by the store Upon receiving an event for example BuyRequest the CCC processes it to determin
30. ule Buy Reject rule Reset 3 4 Deployment of JBoss Application Server The current version of the CCC runs within a Jboss Application Server AS In our experiments we used AS version 7 1 0 which is freely available from 4 As explained in its documentation you can copy the AS software into a folder of your choice For example we copied it into Users ncemj2 JAVA LIBRA RIES jboss as 7 1 1 Final More importantly you need to set a JBOSS_HOME environment variable in your Linux shell For example since we used a bash shell we included the following line in its bash_profile file export JBOSS_HOME Users ncmj2 JAVA LIBRARIES jboss as 7 1 1 Final 3 5 Deployment of CCC Eclipse Project For developement purposes it is convenient to deploy the CCC in a development environment In our work we use eclipse Indigo Service Release 2 The structure of the eclipse proyect called CCCRest ear is shown in Fig 5 AOO Java Eclipse Users ncmj2 eclipse workspace civ 0 Q Ee o n R Sow or er Geo ele Package Explorer 53 H S ml bpmn2promela bpmn2promelagui bpmnverifier Em CCCRest ear ncmj2 CCCRest ear gt Ga CCCRest ear commons gt Gy CCCRest ear ear gt G CCCRest ear ejb gt G CCCRest ear web gt Fy EarContent gt hJBoss 7 1 1 Configuration gt Gyparsers M pom xml 4 9 28 12 4 31 PM ncmj2 readme txt 4 9 28 12 4 31 PM ncmj2 Eg run sh 4 9 28 12 4 31 PM ncmj2 sample contract clauses txt 4 9 28 12 4 31 P
31. use Working directory gt target m2 New_configuration OSGi Framework Default S workspace_loc CCCRestClient M pom xml 2 9 28 12 4 24 Fig 7 Specification of sequence location The current implementation of the client expects the events folder to contain one or more subfolders one for each potential contract run Consequently each subfolder contains one or more rmi files where each of them represents an event The following lines show the structure of the ccTestSeq mal folder that we use in one of our experiments The ccTestSeq mal folder contains two subfolders correctchoreExecSeq1 and correctchoreExecSeq12 The correctchoreExecSeq1 subfolder contains four events eventl xml event2 aml event3 aml and event4 aml Similarly tthe correctchore ExecSeq12 subfolder contains only three events event1 cml event2 cml and event3 zml Users ncmj2 pwd Users ncmj2 CCCParser ccTestSeq xml Users ncmj2 Users ncmj2 1s 1R total 0 drwxr xr x 6 ncmj2 staff 204 8 Nov 15 46 correctchoreExecSeqi drwxr xr x 5 ncmj2 staff 170 8 Nov 15 46 correctchoreExecSeqi2 correctchoreExecSeq1 total 32 rw r r 1 ncmj2 staff 130 8 Nov 15 46 eventi xml rw r r 1 ncmj2 staff 131 8 Nov 15 46 event2 xml rw r r 1 ncmj2 staff 130 8 Nov 15 46 event3 xml rw r r 1 ncmj2 staff 127 8 Nov 15 46 event4 xml correctchoreExecSeq12 total 24 Deployment of the CCC 15 rw r r 1 ncmj2 staff 130 8 Nov 15 46 eventi xml
32. w omg org spec BPMN 2 0 Jan 2011 22 Carlos Molina Jimenez and Ioannis Sfyrakis Table 1 BPMN verifier implementation history Version Date Contributors Key features 1 1 Aug 2012 Ioannis Sfykaris Implementation of presentation and data access layer Implementation of a client module for testing pur poses 1 0 Oct 2010 Massimo Strano CCC logic implemented 4 Community J Jboss application server f http www jboss org jbossas downloads 2013 5 Foundation T A S Apache maven project http maven apache org 2013 6 Sfyrakis I Implementing a contract compliance checker for monitoring con tracts http homepages cs ncl ac uk carlos molina home formal visited in Nov 2012 2012 MSc Dissertation Project Aug 2012
33. wn in the figure The rule base represents the ECA rules that encode the contractual clauses The rule engine represents the rule engine for example Drools engine that upon arriving of events triggers the execution of the corresponding rules DB layer The DB layer represents a data base that is used by the CCC for storing permanent records for example events notified to the CCC about the development of the contractual interaction DB access layer The DB access layer is represented by a database decoupler Its job is to hide from the designer the details of the communication between the CCC and the particular database technology used The functionality of the CCC as a web service can be summarised as follows 1 The CCC retrieve and event from the eventqueue sent by the contractual application 2 The rule engine of the CCC processes the event with the help of the rules in the rulebase 3 The CCC produces a response RESTful message that indicates if the event is contract compliant or not and enqueues in the respqueue 6 Carlos Molina Jimenez and Ioannis Sfyrakis 3 Deployment of Components The deployment of the CCC is platform independent The functionality of the current version has been tested in a Mac platform namely in a MacBook Pro with Mac OS X Version 10 6 8 2 4 GHz Intel Core 2 Duo and 4GB of memory We will use this settings in our discussions 3 1 Database Deployment The CCC needs a data base for permanent
Download Pdf Manuals
Related Search
Related Contents
046 hd manual de instrucciones Samsung Gear 2 User Manual SC-500 MANUAL DE INSTRUCCIONES (ESPANOL) MEDER TourGuide Bedienungsanleitung P214KWT Samsung SBD-455S User Manual ATHENA USER`S MANUAL Instructions for using the ATHENA Foremost GAEA6022D Instructions / Assembly Télécharger 研 究 成 果 報 告 書 Copyright © All rights reserved.
Failed to retrieve file