Sha256: 2ac76d47c9e02b95e53b6a57b4f0007b7c5609740207aa2cf1acd37f0a223ed9

Contents?: true

Size: 1.41 KB

Versions: 9

Compression:

Stored size: 1.41 KB

Contents

### EXAMPLE IN PREPARATION ###

#
# an OpenWFEru example
#

require 'rubygems'

require 'openwfe/engine/engine'
require 'openwfe/expressions/raw_prog'
#require 'openwfe/participants/soapparticipants'
#require 'openwfe/participants/atomparticipants'


#
# the process definition
# 
# instead of using the classical OpenWFE XML process definitions, we
# define the flow as a Ruby class

class ReviewFlow < OpenWFE::ProcessDefinition
    def make
        process_definition :name => "homework_review", :revision => "0.1" do
            sequence do
            end
        end
    end
end

#
# the engine
#
# a simple in memory engine, no persistence whatsoever for now.

engine = OpenWFE::Engine.new

#
# The Participants
#
# Ideally participants are shared by more than one process definition
# (a person is usually part of more than one business process in
# his organization)

# a small debug participant, as you can see, a participant can 
# directly be a ruby block (which receives the workitem)
# (it's commented out at the end of the flow)
#
engine.register_participant("puts_workitem") do |workitem|
    puts
    puts workitem.to_s
    puts
end

#
# launching

launchitem = LaunchItem.new(QuoteLookupFlow)
    #
    # Passing the process definition class as the unique 
    # LaunchItem parameter

launchitem.symbols = "aapl, sunw, msft, lnux"
    #
    # directly setting the value for the field "symbols"

engine.launch(launchitem)

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
openwferu-0.9.15 examples/homeworkreview.rb
openwferu-0.9.11 examples/homeworkreview.rb
openwferu-0.9.12 examples/homeworkreview.rb
openwferu-0.9.12.863 examples/homeworkreview.rb
openwferu-0.9.13 examples/homeworkreview.rb
openwferu-0.9.14 examples/homeworkreview.rb
openwferu-0.9.17 examples/homeworkreview.rb
openwferu-0.9.16 examples/homeworkreview.rb
ruote-0.9.18 examples/homeworkreview.rb