55d409ab26407b4167315ee74edffe40.ppt
- Количество слайдов: 24
Open. Flow: A Perl-Based Web or Workflow Application Framework Sho-Huan Tung National Yunlin University of Science and Technology Taiwan, R. O. C. tungsh@mis. yuntech. edu. tw The Perl Conference 3. 0, August 1999, Monterey, CA. Open. Flow: 1
Web Application Development z. Too many tools or languages ybrowser, HTTP server, database server, CGI, HTML, Javascript, Perl …. z. Interacts with multiple participating users z. Is difficult to automate Open. Flow: 2
Language-Centered Approach z. Most flexible z. Too low-level z. Lacks an abstraction layer describing common patterns in Web applications. z. Examples: Java, Perl and CGI. pm …. Open. Flow: 3
Model-Centered Approach z. Models capture patterns of applications z. More convenient z. May be less flexible z. Examples: y. Hyper. Card model and the Web. Writer y. Open. Flow: 4
Open. Flow: An Introduction z. The FPR model: A Web application repeatedly generates and processes forms for one or more on-line or off-line users. z. An FPR separates the specification of its Form from its Data Processor or Receivers. z. Control structure (conditional branching, parallel branching, loops, join) can be specified among FPRs. Open. Flow: 5
Open. Flow: An Introduction (cont. ) z. Supports passive as well as proactive Web applications. z. Perl-based. z. Form data are stored and accessed in Perl Hashes. y. The me hash stores instance data. y. The sg hash stores shared global data. Open. Flow: 6
Example: The Presidential Election Open. Flow: 7
Example: The Presidential Election Open. Flow: 8
Example: The Presidential Election Open. Flow: 9
Example: The Presidential Election Open. Flow: 10
Structure of the President Application z. Open. Flow ywf x. President • main – 0 Form DP – 1 – 2 Form Open. Flow: 11
Contents of wf/President/main/0/Form <FORM ACTION=”!CGI" METHOD="POST"> Sex: <SELECT NAME="Sex" SIZE=1> <OPTION>M <OPTION>F </SELECT> Age: <INPUT TYPE="text" NAME="Age" SIZE=40> <SELECT NAME=”Vote_for” SIZE=1><OPTION>Chen <OPTION>Wang <OPTION>Ma </SELECT> <INPUT TYPE="hidden" NAME="wf. Key" VALUE="!KEY"> <INPUT TYPE="submit" VALUE="Submit"> <INPUT TYPE="reset" VALUE="Reset"> </FORM> Open. Flow: 12
Contents of wf/President/main/0/DP #do_mr 1 #Read. Only return "FPR: 1"; Open. Flow: 13
Contents of wf/President/main/1/Form Your sex is: !VARSex!RAV Your age is: !VARAge!RAV You voted: !VARVote_for!RAV <FORM ACTION="!CGI" METHOD="POST">Are those correct? Yes: <INPUT TYPE="radio" NAME="correct" VALUE="Yes”> No: <INPUT TYPE="radio" NAME="correct" VALUE="No"> <INPUT TYPE="hidden" NAME="wf. Key" VALUE="!KEY"> Open. Flow: 14
Contents of wf/President/main/1/DP #Data. Correct? #Transaction if ($me{correct} eq 'Yes') { $sg{"$me{Vote_for}"} = sg{"$me{Vote_for}"} + 1; } else { un. Mark(”tungsh: President: main: 0: $pid"); un. Mark(”tungsh: President: main: 1: $pid"); return "FPR: 0"; } Open. Flow: 15
Contents of wf/President/main/2/Form <h 3>Votes accumulated so far: </h 3><hr> Chen has !VARChen!RAV votes. Wang has !VARWang!RAV votes. Ma has !VARMa!RAV votes. Open. Flow: 16
Extending the President Application Open. Flow: 17
Extending the President Application Open. Flow: 18
Code Extensions z. In wf/President/main/1/DP if (defined($sg{allemail})) { $sg{allemail} = "$me{email}, n $sg{allemail}"; } else { $sg{allemail} = $me{email}; } if (defined($sg{"first-time"})) { return "FPR: 2"; } else { $sg{"first-time"} = 1; return "FPR: 2|3 -days"; Open. Flow: 19 }
Code Extensions z. In wf/President/main/3 -days/Form This file does not exist. z. In wf/President/main/3 -days/DP #Sleep 3 Days #Read. Only sleep. For(0, 0, 3); return "FPR: Notice"; Open. Flow: 20
Code Extensions z. In wf/President/main/Notice/Form The same file as wf/President/main/2/Form. z. In wf/President/main/Notice/DP This file does not exist. z. In wf/President/main/Notice/Receiver Notice [MAILVAR]allemail Open. Flow: 21
Implementation z. Written completely in Perl z. Uses yeval, Freeze. Thaw. pm y. Berkeley DB Files to store Perl hashes y. File locks y. Process Management z. Source code is about 1600 lines. Open. Flow: 22
Future Work z. GUI interfaces for yworkflow editor, debugger ymonitor, worklist manager yworkflow administrator z. Workflow related research ytransaction processing across FPRs ydynamic and distributed workflow yerror and exception handling mechanisms Open. Flow: 23
Conclusion z. Open. Flow is y. Simple: The FPR is a simple model. The implementation is small and simple. y. Flexible and Powerful: Uses Perl. Source code is available. z. To down load: openflow. mis. yuntech. edu. tw/~tungsh/Open. Flow: 24
55d409ab26407b4167315ee74edffe40.ppt