24
Vakgroep Informatietechnologie – Breedbandcommunicatienetwerken (IBCN) Dynamic and generic workflows in .NET Bart De Smet

Vakgroep Informatietechnologie – Breedbandcommunicatienetwerken (IBCN) Dynamic and generic workflows in.NET Bart De Smet

Embed Size (px)

Citation preview

Page 1: Vakgroep Informatietechnologie – Breedbandcommunicatienetwerken (IBCN) Dynamic and generic workflows in.NET Bart De Smet

Vakgroep Informatietechnologie – Breedbandcommunicatienetwerken (IBCN)

Dynamic and generic workflows in .NET

Bart De Smet

Page 2: Vakgroep Informatietechnologie – Breedbandcommunicatienetwerken (IBCN) Dynamic and generic workflows in.NET Bart De Smet

Agenda

Introduction Workflow: what and why? Research

Dynamic workflows Methodologies Instrumentation framework

Generic composition Generic data-driven workflows Design decisions

Performance and conclusion

Vakgroep Informatietechnologie – Breedbandcommunicatienetwerken (IBCN)2

Page 3: Vakgroep Informatietechnologie – Breedbandcommunicatienetwerken (IBCN) Dynamic and generic workflows in.NET Bart De Smet

Introduction

What is workflow? Graphical construction of applications

Business processes, human workflows State machines versus sequential workflows

Typically long-running processes E.g. order processing with human approval

Key advantages Graphical inspection by various stakeholders Availability of runtime services

Raise the level of abstraction E.g. persistentie, tracking, scheduling, etc

Vakgroep Informatietechnologie – Breedbandcommunicatienetwerken (IBCN)3

Page 4: Vakgroep Informatietechnologie – Breedbandcommunicatienetwerken (IBCN) Dynamic and generic workflows in.NET Bart De Smet

Introduction

Windows Workflow Foundation Workflow in a general purpose framework Part of Microsoft’s .NET Framework 3.0

Vakgroep Informatietechnologie – Breedbandcommunicatienetwerken (IBCN)4

Page 5: Vakgroep Informatietechnologie – Breedbandcommunicatienetwerken (IBCN) Dynamic and generic workflows in.NET Bart De Smet

Introduction

Vakgroep Informatietechnologie – Breedbandcommunicatienetwerken (IBCN)5

Activity

Sequential workflow definition

If-Else

Parallelism

Interactions

Page 6: Vakgroep Informatietechnologie – Breedbandcommunicatienetwerken (IBCN) Dynamic and generic workflows in.NET Bart De Smet

Research

Dynamic workflows Problem statement

Long-running versus changing business environment Visual obstruction by aspects

Adaptation at run-time Modification of workflow instances Injection of aspects, e.g. logging, authorization, etc

Generic composition Problem statement

Repetitive tasks, e.g. data querying and retrieval Ultimate vision: composition by the end-users

Generic blocks for composition

Vakgroep Informatietechnologie – Breedbandcommunicatienetwerken (IBCN)6

Page 7: Vakgroep Informatietechnologie – Breedbandcommunicatienetwerken (IBCN) Dynamic and generic workflows in.NET Bart De Smet

Agenda

Introduction Workflow: what and why? Research

Dynamic workflows Methodologies Instrumentation framework

Generic composition Generic data-driven workflows Design decisions

Performance and conclusion

Vakgroep Informatietechnologie – Breedbandcommunicatienetwerken (IBCN)7

Page 8: Vakgroep Informatietechnologie – Breedbandcommunicatienetwerken (IBCN) Dynamic and generic workflows in.NET Bart De Smet

Dynamic workflows

What? Dynamic adaptation of workflow instances Examples

Changing business policy (e.g. extra order approval) Injection of runtime aspects (e.g. logging, auth’z) Inspection of workflow instances (e.g. debugging)

How? WF Dynamic Updates

Flexible framework-level mechanism Additional custom tools layered on top

Instrumentation framework

Vakgroep Informatietechnologie – Breedbandcommunicatienetwerken (IBCN)8

Page 9: Vakgroep Informatietechnologie – Breedbandcommunicatienetwerken (IBCN) Dynamic and generic workflows in.NET Bart De Smet

WF Dynamic Updates

Internal modification By code inside a running workflow instance Access to internal state Fast Prior knowledge of adaptation kinds required Requires pre-configured communications to the outside

External modification By code at the host level Access to external state Adaptation in an ad-hoc manner Relatively slow Timing issues concerning the state an instance is in

Vakgroep Informatietechnologie – Breedbandcommunicatienetwerken (IBCN)9

Page 10: Vakgroep Informatietechnologie – Breedbandcommunicatienetwerken (IBCN) Dynamic and generic workflows in.NET Bart De Smet

Instrumentation

Best of both worlds External modification + internal modification Suspension points for exact timing

Vakgroep Informatietechnologie – Breedbandcommunicatienetwerken (IBCN)10

InstrumentRuntimeEvent

Handlers

Inspect, inject,

resume

Page 11: Vakgroep Informatietechnologie – Breedbandcommunicatienetwerken (IBCN) Dynamic and generic workflows in.NET Bart De Smet

Instrumentation

Examples Logging Debugging Time measurement Authorization

Tracking Real-time inspection Execution history Workflow Monitor

Vakgroep Informatietechnologie – Breedbandcommunicatienetwerken (IBCN)11

Page 12: Vakgroep Informatietechnologie – Breedbandcommunicatienetwerken (IBCN) Dynamic and generic workflows in.NET Bart De Smet

Agenda

Introduction Workflow: what and why? Research

Dynamic workflows Methodologies Instrumentation framework

Generic composition Generic data-driven workflows Design decisions

Performance and conclusion

Vakgroep Informatietechnologie – Breedbandcommunicatienetwerken (IBCN)12

Page 13: Vakgroep Informatietechnologie – Breedbandcommunicatienetwerken (IBCN) Dynamic and generic workflows in.NET Bart De Smet

Flowcharts

Vakgroep Informatietechnologie – Breedbandcommunicatienetwerken (IBCN)13

Iterative

Decision logic

Reporting

Calculations

Error handling

Page 14: Vakgroep Informatietechnologie – Breedbandcommunicatienetwerken (IBCN) Dynamic and generic workflows in.NET Bart De Smet

Generic composition

What? Generic building blocks

Reusable blocks for workflow composition Typical tasks such as data retrieval

Important design decisions Easy translation from flowchart to workflow Dataflow versus workflow Combination with Service Oriented Architectures Workflow versus procedural: what’s the cost?

How? Custom activities in WF Designer rehosting

Vakgroep Informatietechnologie – Breedbandcommunicatienetwerken (IBCN)14

Page 15: Vakgroep Informatietechnologie – Breedbandcommunicatienetwerken (IBCN) Dynamic and generic workflows in.NET Bart De Smet

Generic blocks

Data retrieval Data gathering block IQueryManager

DBMS independent

PropertyBag storage

Iteration Foreach block

Decision logic IfElse + conditions Reporting of results

Vakgroep Informatietechnologie – Breedbandcommunicatienetwerken (IBCN)15

Page 16: Vakgroep Informatietechnologie – Breedbandcommunicatienetwerken (IBCN) Dynamic and generic workflows in.NET Bart De Smet

Design decisions

To iterate or not to iterate... Stale data during iteration

Loop body long-running? Persistence is your enemy

Granularity of workflow instances

Chatty or chunky? Reduction of database communication More logic at the database tier?

Introduces workflow need at a different layer

“Dataflow” isn’t trivial Bindings required for explicit dataflow (no pipelining) Generic & weakly typed versus specific & strongly typed

Vakgroep Informatietechnologie – Breedbandcommunicatienetwerken (IBCN)16

Page 17: Vakgroep Informatietechnologie – Breedbandcommunicatienetwerken (IBCN) Dynamic and generic workflows in.NET Bart De Smet

Service oriented architecture

Workflow level Granularity and invocation mechanism?

Block level Publish block functionality (e.g. query manager)

Windows Communications Foundation (WCF) Keep internal communication efficient Make external communication WS-* compliant

Vakgroep Informatietechnologie – Breedbandcommunicatienetwerken (IBCN)17

Page 18: Vakgroep Informatietechnologie – Breedbandcommunicatienetwerken (IBCN) Dynamic and generic workflows in.NET Bart De Smet

Result

Vakgroep Informatietechnologie – Breedbandcommunicatienetwerken (IBCN)18

Page 19: Vakgroep Informatietechnologie – Breedbandcommunicatienetwerken (IBCN) Dynamic and generic workflows in.NET Bart De Smet

Rehosting

Vakgroep Informatietechnologie – Breedbandcommunicatienetwerken (IBCN)19

Page 20: Vakgroep Informatietechnologie – Breedbandcommunicatienetwerken (IBCN) Dynamic and generic workflows in.NET Bart De Smet

Agenda

Introduction Workflow: what and why? Research

Dynamic workflows Methodologies Instrumentation framework

Generic composition Generic data-driven workflows Design decisions

Performance and conclusion

Vakgroep Informatietechnologie – Breedbandcommunicatienetwerken (IBCN)20

Page 21: Vakgroep Informatietechnologie – Breedbandcommunicatienetwerken (IBCN) Dynamic and generic workflows in.NET Bart De Smet

Procedural versus workflow

Iterative workflows

Procedural is better WF scheduler overhead

Data gathering

Parallelism reduces damage

Vakgroep Informatietechnologie – Breedbandcommunicatienetwerken (IBCN)21

Let the runtime services

do useful work!

Page 22: Vakgroep Informatietechnologie – Breedbandcommunicatienetwerken (IBCN) Dynamic and generic workflows in.NET Bart De Smet

Exploiting parallelism

Intra-workflow Inter-workflow

Vakgroep Informatietechnologie – Breedbandcommunicatienetwerken (IBCN)22

Boost scheduler

Page 23: Vakgroep Informatietechnologie – Breedbandcommunicatienetwerken (IBCN) Dynamic and generic workflows in.NET Bart De Smet

Instrumentation

Internal modification External modification

Vakgroep Informatietechnologie – Breedbandcommunicatienetwerken (IBCN)23

Instrumentation framework• Reduces # of ad-hoc external modifications• Workflow is set to idle by suspension points

Instrumentation framework• Reduces # of ad-hoc external modifications• Workflow is set to idle by suspension points

Impact by scheduler

Page 24: Vakgroep Informatietechnologie – Breedbandcommunicatienetwerken (IBCN) Dynamic and generic workflows in.NET Bart De Smet

Conclusion

Vakgroep Informatietechnologie – Breedbandcommunicatienetwerken (IBCN)24