public
Description: a rails wrapper around the OpenWFEru "ruote" workflow and BPM engine
Homepage: http://openwferu.rubyforge.org/rquickstart.html
Clone URL: git://github.com/jmettraux/ruote-web.git
ruote-web / public / process_definitions / vacation_request_0.rb
100644 60 lines (47 sloc) 1.487 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#
# an example of a Ruby process definition, for a small
# vacation request application.
#
class VacationRequest0 < OpenWFE::ProcessDefinition
 
    description "requesting some vacation time"
 
    #
    # setting some fields right at the beginning of the
    # process
    #
    # those are the fields to be filled by the employee
    # for his request to be considered.
 
    set :v => "employee", :value => "${f:launcher}"
    set :v => "boss", :value => "alice"
    set :v => "assistant", :value => "bob"
 
    set :f => "employee", :value => "${f:launcher}"
    set :f => "from_date", :value => ""
    set :f => "to_date", :value => ""
    set :f => "reason", :value => ""
 
 
    #
    # the 'body' of the process definition
    #
    sequence do
 
        #
        # the first participant is the employee (the user who
        # launched the process)
        #
        employee
        
        #
        # now setting some fields that the assistant and perhaps
        # the boss will fill.
        #
        set :f => "granted", :value => "false"
        set :f => "not_enough_info", :value => "false"
        set :f => "boss_should_have_a_look", :value => "false"
 
        assistant
 
        #
        # if the assistant set the field 'boss_should_have_a_look',
        # then the process will head to the boss desk
        #
        boss :if => "${f:boss_should_have_a_look}"
 
        #
        # employee gets the answer to his request
        #
        employee
    end
end