jmettraux (owner)

Revisions

gist: 73813 Download_button fork
public
Public Clone URL: git://gist.github.com/73813.git
pr.rb
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
class Pr0 < OpenWFE::ProcessDefinition
#OpenWFE.process_definition :name => 'pr', :revision => '0'
 
  # at launch time, the fields 'manager', 'initiator' and 'pr_url' are set
  # by the initiator
 
  cursor :rewind_if => '${f:rework}', :break_if => '${f:rejected}' do
 
    participant '${f:initiator}', :activity => 'prepare pr', :if => '${f:rejected}'
      # when entering the cursor, the field 'rejected' will not have been
      # set so the flow will jump directly to the manager.
 
    manager :activity => 'pr approval'
 
    cfo :activity => 'pr approval', :if => '${f:dollar_value} > 10000'
      # only goes to the CFO if the dollar value is high enough
 
    accounting :activity => 'pr approval'
    participant :field_ref => 'initiator'
  end
 
  #process_definition :name => 'manager' do
  define 'manager' do
    #
    # variable 'activity' is set when this subprocess is called
    #
    sequence do
      participant :ref => 'mail', :subject => '${activity}' # notification
      participant :ref => '${f:manager}', :activity => '${activity}'
    end
  end
 
end