Presentation is loading. Please wait.

Presentation is loading. Please wait.

Workflow API and workflow services A case study of biodiversity analysis using Windows Workflow Foundation Boris Milašinović Faculty of Electrical Engineering.

Similar presentations


Presentation on theme: "Workflow API and workflow services A case study of biodiversity analysis using Windows Workflow Foundation Boris Milašinović Faculty of Electrical Engineering."— Presentation transcript:

1 Workflow API and workflow services A case study of biodiversity analysis using Windows Workflow Foundation Boris Milašinović Faculty of Electrical Engineering and Computing University of Zagreb, Croatia Software Engineering: Computer Science Education and Research Cooperation 13th Workshop, Bansko, Bulgaria, August 25 –September 1, 2013

2 What is workflow? 0 The automation of a business process, in whole or part, during which documents, information or tasks are passed from one participant to another for action, according to a set of procedural rules. 0 [Workflow Management Coalition, Terminology & Glossary, Document Number WFMC-TC-1011] 0 Why workflow? 0 Not (only) coding activities but orchestrating them and gluing together 0 Usually people associate workflows with 0 big automated systems 0 various document management systems with many users 0 various BPM tools 0 But… nothing of that in this case study

3 Case study context - simplified description 0 Input: 0 geocoded findings of floristic species filtered according to various (and in future expandable) filters 0 an ESRI GIS layer: shape file with polygons and dbf file with additional information (attributes) for each polygon 0 Calculation: 0 Determine which findings belong to which polygon 0 Calculate biodiversity and ecological niche for a polygon and/or set of polygons having same attribute value 0 Output: 0 Create new dbf file extended with calculated data 0 Create result matrices (ecological niche, biodiversity data, taxa data, additional data...)

4 Biodiversity and ecological niche analysis 0 Ecological niche analysis 0 Species distribution - find in how many polygons (of the same GIS attribute) a species is present 0 Biodiversity analysis 0 α – diversity: number of different species in an area 0 Research intensity: Number of findings of each finding source per spatial unit (single polygon and/or GIS attribute consisting of multiple polygons) 0 Categories data 0 F(p, V) = N where V is one of possible values in a category (e.g. an ecological index) => N species in polygon p have value V

5 Why Workflow? 0 Visualizing the code 0 Frequent changes of order during development 0 Especially hard when parts of code are run in parallel => drag & drop 0 Result set depends on user’s permission and input criteria 0 many (hard to read) if-else/switch parts of code => flowchart 0 Logging, benchmarking, robustness 0 Try-catch blocks with stopwatch/log code before and after => composite activities 0 Continuation depends on an activity success/failure 0 Activities with many input and output arguments 0 using C# out/ref for parameters? 0 many new classes used only once? 0 Layering application

6 Why Windows Workflow Foundation? 0 Choosing one (from too many others) that easily plugs into environment and existing code 0 Windows Workflow Foundation (WF) 0 workflow engine and API integrated in.NET 0 differs from BPM tools as it is not intended for automatic form design 0 main purpose is control flow: sequential workflows, flowcharts and state machines 0 easily used from an application or exposed as a web service 0 workflow stored in xaml file (except code of custom activities) and designed inside Visual Studio

7 An excerpt from the workflow (1)

8 An excerpt from the workflow (2)

9 Workflow Activities 0 built in activities 0 custom ones 0 simple sequential activities (extending CodeActivity) 0 long running activities (AsyncCodeActivity) 0 complex activities (NativeActivity) - e.g. composite activities 0 combination of existing ones (mini-workflow) 0 each activitiy have Input/Output arguments 0 workflow has own variables

10 What have been done 0 Core GIS calculation extracted to separate library referenced by the workflow project 0 Workflow project contains 0 Composite activity for logging and benchmarking + try/catch 0 10-15 rather simple custom activities (20-100 lines of code) 0 A few custom activities designed as mini workflows consisting of built-in activities and custom ones 0 2 main workflows: 0 EcologicalNiche.xaml 0 BioDiversityWorkflow.xaml 0 Used in a separate workflow (web) service project 0 can be used from an application if needed

11 Exposing workflow as a web service 0 Precisely WCF service so does not need to be HTTP(S) protocol 0 WCF service contract shared or WSDL can be generated 0 PickActivity with many branches 0 Branches wait for invocation of a method from WCF service 0 start new instance or continues an existing one 0 common (initial) code before PickActivity executed every time new instance is created 0 Trigger – Action pattern 0 Trigger: receive and send response 0 Action: run after response …

12 Problems 0 Not so easy to learn WF and some initial effort is needed to become familiar with the tool 0 Demanding GUI (relatively fast computer needed) 0 Rectangular design, quite large and wide, not printable 0 Declarative code 0 Error in xaml can cause visual design to fail 0 Error descriptions and debugging not so clear like in „normal” code 0 Dependency graph not correct if project referenced only in xaml 0 Refactoring is painful 0 changing activity name, namespace or parameter name does not make changes in xaml file 0 Removing a parameter from a custom activity does not update xaml file – changes have to be done manually in xaml file

13 Conclusion 0 WF (or similar workflow engine) is very useful 0 Visualize a process 0 Helps layering application 0 Offers easy use from an application or advanced scenarios with web services 0 Enables flowchart design 0 Ease changing order of a execution (drag & drop and visual design) 0 Activities are well defined with input/output parameters and easy to test 0 … but still have some teething troubles 0 …but (in personal opinion) have bright future


Download ppt "Workflow API and workflow services A case study of biodiversity analysis using Windows Workflow Foundation Boris Milašinović Faculty of Electrical Engineering."

Similar presentations


Ads by Google