Adaptive Transaction Compensations

intranet.cs.aau.dk
  • No tags were found...

Adaptive Transaction Compensations

Feature Based Design of Web ServiceTransaction CompensationsPeter Dologdolog@cs.aau.dkCS DepartmentIntelligent Web Information Systemshttp://www.cs.aau.dk, http://iwis.cs.aau.dk


Web Engineering Lecture7, Adaptive Compansations2OutlineGeneral problemBusiness transactionsMiddleware for advanced compensationsService provider and client feature modellingMatchmaking and restriction modelFurther Challenges


Web Engineering Lecture7, Adaptive Compansations3Adaptation/Customization• Customization by humans (designers)• Dynamic adaptation by a system itself• Adaptation is about decision on which information resource orfunction variant to provide or recommend access to,• We need a knowledge to decide about appropriate informationor service configuration in a certain processing step (user orother):• Resource and information access environment• Application domain• User/Context• And their configuration – variants and their meaningful combinations forcertain purposes


Web Engineering Lecture7, Adaptive Compansations4OutlineGeneral problemBusiness transactionsMiddleware for advanced compensationsService provider and client feature modellingMatchmaking and restriction modelFurther Challenges


Web Engineering Lecture7, Adaptive Compansations5Open Web Service EnvironmentService Providers• A number of autonomous service providers exist• They can provide similar functionality• They can dis-/appear any time• Each wants to maximize its profit for executing provided services byexternal consumersService Consumers• Number of consumers with similar requirements exist• They want to achieve high value for their expense• To maximize their service• By composing matched available services from different providers


Web Engineering Lecture7, Adaptive Compansations6Software Product LinesSoftware Providers• Number of reusable software assets exist• They may vary in its functionality• They want to maximize its profit by providing the assets inan application in a family mostly from one companySoftware Consumers• Number of consumers with similar requirements• They want to achieve high value for their expense• To maximize their service• By composing a final application from the reusable assets


Web Engineering Lecture7, Adaptive Compansations7DifferenceClient is composing in web service worldClient is composing from different providers in web serviceworldServices used in the composition may be exchangedQuestion:• What can be achieved by current state of the art softwareproduct lines techniques?


Web Engineering Lecture7, Adaptive Compansations8OutlineGeneral problemBusiness transactionsMiddleware for advanced compensationsService provider and client feature modellingMatchmaking and restriction modelFurther Challenges


Web Engineering Lecture7, Adaptive Compansations9Payroll ScenarioCompanyEmployeePrint and send payslipTransfer salaryTransfer taxTransfersalaryPrint andmail payslipTransfertaxWait for paymentTransfer monthly instalmentfor the new carTransfer carinstalmentBank


Web Engineering Lecture7, Adaptive Compansations10Service Oriented Payroll ScenarioCompanyEmployeePrint andmail payslipTransfersalaryTransfertaxTransfer carinstalmentBankTo reach mutually-agreed outcome (commit/cancel)In environment with concurrent access


Web Engineering Lecture7, Adaptive Compansations11TransactionsControl the execution of the required operations on theexternal services.Consist of a set of operations (e.g. database operations) that areperformed by multiple participants.Control the collective outcome of the operations.Distributed transactions control the execution of operations onmultiple providers.• Participant• Coordinator


Web Engineering Lecture7, Adaptive Compansations12Error CompensationDifferent transaction specifications exist for different purposesBackward recoveryNormally, predefined rollback operations are executed in order to restorethe state before the transaction.‣ Time and money is lost‣ Dependent transactions also have to roll back (domino effect)Forward recoveryAims at changing pro-actively the state of the participant or transaction toenable a successful execution after a failure.‣ Complex‣ Can normally only be performed semi-automatically


Web Engineering Lecture7, Adaptive Compansations13Traditional WS-Transaction Coordin. StructureCompany:Business Process1. Create new transaction2. Return coordination contextNormal Request request failureprocessing handling7. Send requestresult3. Invoke service, sendcoordination contextTransactionCoordinator8. AborttransactionWeb Service 1Transfer salary6. Process request→ Failure4. Register with coordination context7. Send failure notification5. Confirm registration


Web Engineering Lecture7, Adaptive Compansations14WS – Tx / Business Activity Coordination TypeCT 1WS 2 WS 3WS 1WS 4abstract state diagram


Web Engineering Lecture7, Adaptive Compansations15Payroll ProcessingCalculatesalaryCompanyPerformpaymentEmployeePay billsTransfer 3. 1. 2. Transfer Specify instalment the of the salary salary tax to details, the to the to car the tax print dealer‘s employee‘s authority‘s and account send accountthe payslipWeb Service 1Web Service 2Web Service 3…Transfer salaryTransfer taxPrint and sendpayslipTransactionAccountsCompanyEmployeeTaxCar Dealer


Web Engineering Lecture7, Adaptive Compansations16Motivating Scenario – ProblemCalculatesalaryCompanyPerformpaymentEmployeePay billsWeb Service 1Transfer salaryTransactionWeb Service 2Transfer taxWeb Service 3Print and sendpayslipA service fails due to an internal error.The error can only be compensated by aborting the complete transaction.Why should the transaction be aborted, if a different service exists that canperform the same operations?…


Web Engineering Lecture7, Adaptive Compansations17OutlineGeneral problemBusiness transactionsMiddleware for advanced compensationsService provider and client feature modellingMatchmaking and restriction modelFurther Challenges


Web Engineering Lecture7, Adaptive Compansations18Extended Transaction Coordination StructureCompany:Business Process1. Create new transaction2. Return coordination context13. Send requestresult12. Send requestresultAbstractServiceWeb Service 1Transfer salary11. Process request3. Invoke abstract service, sendcoordination context4. Request adaptercontext7. Returnadaptercontext8. Invoke concreteservice, sendadapter contextAdapter9. Register withadapter context5. Register withcoordinationcontext6. Confirmregistration10. Confirm registrationTransactionCoordinator


Web Engineering Lecture7, Adaptive Compansations19New Components - Abstract ServiceDoes not directly implementfunctionalities.Manages a list of concrete services.Is a mediator between the client and theconcrete service.Manages and performs compensationactions.Interfaces:• Service• Event (internal compensationhandling)• Compensation (externalcompensation handling)• Contract exchangeContract exchangeAbstract serviceAbstract ServiceManagementConcrete service listConcrete service wrappersCompensation rulesrepositoryContract repositoryCompensationEvent


Web Engineering Lecture7, Adaptive Compansations20Compensation Activities and Types


Web Engineering Lecture7, Adaptive Compansations21Example: Internal Compensation RuleCondition The Step condition execution 1: 2: Replace Resend 1: 2: 3: 4: The A of plan direct the internal state last the last current of compensationtherequest which eventrulethe replacement must compensation concrete concrete have service been called concrete service rule a this failure has method of to theconcrete be service has service to exist


Web Engineering Lecture7, Adaptive Compansations22New Components - AdapterEncapsulates coordinator-specificfunctionality.Functions as a coordinator for theconcrete service.Manages messaging:• Forwards normal messagesbetween the real coordinator andthe concrete service.• Intercepts failure messages andinforms the abstract service.• Creates additional notifications aspart of a compensation process.AbstractserviceInstructionsAdapterAdapter ManagementCoordinatorCapabilitiesConcrete serviceCoordinator


Web Engineering Lecture7, Adaptive Compansations23Internal Compensation Handling – No ActionCompany:Business ProcessAbstractService14. Fail13. ReporteventAdapter15. ForwardfailurenotificationTransactionCoordinator16. AborttransactionWeb Service 1Transfer salary12. Signal failureConcrete service fails.Abstract service checks its compensationrules and contract.Compensation is not possible.Normal transaction abort.11. Process request


Web Engineering Lecture7, Adaptive Compansations24Internal Compensation Handling – ReplacementCompany:Business Process21. Send requestresultAbstractService14. Forgetparticipant13. ReporteventAdapterTransactionCoordinator20. Send requestresultWeb Service 4Web Service 1Transfer salaryTransfer salary16. Resendrequest12. 17. Signal Register failure withadapter context18. 15. Confirm registration failure11. 19. Process requestConcrete service fails.Abstract service checks its compensationrules and contract.Concrete service is replaced.Coordinator was not notified!


Web Engineering Lecture7, Adaptive Compansations25EvaluationMultiple scenarios for internal and external compensationhandling have been implemented and tested.An evaluation model has been created, which calculates net valuesfor the standard environment and the abstract serviceenvironment.‣ Allows an assessment whether the utilization of the newdesign is economical and beneficial.Experiment performed on a simalated environmentMore in ACM TWEB paper


Web Engineering Lecture7, Adaptive Compansations26OutlineGeneral problemBusiness transactionsMiddleware for advanced compensationsService provider and client feature modellingMatchmaking and restriction modelFurther Challenges


Web Engineering Lecture7, Adaptive Compansations27Compensation Types>Compensation 1 1>CompensationPlan1 1..*>CompensationAction>NoCompensation>Repetition>Replacement>Forwarding>AdditionalService>AdditionalRequest>SessionRestart


Web Engineering Lecture7, Adaptive Compansations28Compensation Features>Compensation>ExternalCompensationHandling>InternalCompensationHandling>SessionRestart>Forwarding>AdditionalActions>NoCompensation>Repetition>Replacement>{Kind = AND}>{Kind = OR}>ServiceAbort>AdditionalService>AdditionalRequest>PartialRequestRepetition>LastRequestRepetition>AllRequestRepetition>RequestSequenceChange>ResultResending


Web Engineering Lecture7, Adaptive Compansations29Capability Feature Model>SalaryTransferService>ExternalCompensationHandling>TransferSalary>GetAccountBalance>InternalCompensationHandling>AdditionalActions>NoCompensation>Repetition>Replacement>{Kind = OR}>AdditionalService>AdditionalRequest>PartialRequestRepetition>LastRequestRepetition>AllRequestRepetition>TelephoneCall>ResultResendingConsists of:• functionality feature model• compensation feature modelThe compensation feature model can contain custom features.


Web Engineering Lecture7, Adaptive Compansations30Service Capabilities>SalaryTransferService>ExternalCompensationHandling>TransferSalary>GetAccountBalance>InternalCompensationHandling>SessionRestart>Forwarding>AdditionalActions>NoCompensation>Repetition>Replacement>{Kind = AND}>{Kind = OR}>ServiceAbort>AdditionalService>AdditionalRequest>PartialRequestRepetition>LastRequestRepetition>AllRequestRepetition>RequestSequenceChange>TelephoneCall>ResultResending


Web Engineering Lecture7, Adaptive Compansations31Consumer Requirements>SalaryTransferService>ExternalCompensationHandling>TransferSalary>GetAccountBalance>InternalCompensationHandling>SessionRestart>Forwarding>AdditionalActions>NoCompensation>Repetition>Replacement>{Kind = AND}>{Kind = OR}>ServiceAbort>AdditionalService>AdditionalRequest>PartialRequestRepetition>LastRequestRepetition>AllRequestRepetition>RequestSequenceChange>ResultResending


Web Engineering Lecture7, Adaptive Compansations32OutlineGeneral problemBusiness transactionsMiddleware for advanced compensationsService provider and client feature modellingMatchmaking and restriction modelFurther Challenges


Web Engineering Lecture7, Adaptive Compansations33Matchmaking between service and consumer featuremodelsCompatibility score calculationIteratively compares feature modelsFeatures must appear at the same place in the graphMandatory features must all match but do not contribute to thecompatibility scoreIf a mismatch is found in a mandatory feature, algorithm stopsand a negative score is returnedOptional features add to the compatibility score when a match isfound (in our case +1)Additional features may contribute with different scores


Web Engineering Lecture7, Adaptive Compansations34Restriction Feature Model>Compensation>InternalCompensationHandling>NoCompensation>Repetition>Replacement>PartialRequestRepetition>LastRequestRepetition>AllRequestRepetition>ResultResending


Web Engineering Lecture7, Adaptive Compansations35Example: Internal Compensation Rule


Web Engineering Lecture7, Adaptive Compansations36Feature Model


Web Engineering Lecture7, Adaptive Compansations37Layers of AbstractionPhysical Services andWorkflow VariantsCapability andCompensationConceptsCapability andCompensationFeatures andConfigurationsRestrictionProfilesNavigationandInteractionxorandxor


Web Engineering Lecture7, Adaptive Compansations38OutlineIWIS group and backgroundGeneral problemBusiness transactionsMiddleware for advanced compensationsService provider and client feature modellingMatchmaking and restriction modelFurther Challenges


Web Engineering Lecture7, Adaptive Compansations39Workflows vs. MiddlewareCompensations and adaptations can be specified at the designlevel in workflowsCopensations and adaptations can be encoded in an intelligentmiddlewareHow to combine themHow to compose themHow to ensure consistency…


Web Engineering Lecture7, Adaptive Compansations40References• M. Schäfer and P. Dolog: Feature-Based Engineering ofCompensations in Web Service Environment. ICWE 2009:197-204• M. Schäfer, P. Dolog, W. Nejdl: An Environment for FlexibleAdvanced Compensations of Web Service Transactions. ACMTWEB, 2(2), 2008• P. Dolog, W. Nejdl: Using UML-based feature models andUML collaboration diagrams to information modelling forweb-based applications. UML 2004.

More magazines by this user
Similar magazines