Sha256: ad8b938850173eb06d8dc8c4a7dfe1a5932b5b30421a4842fecba512d414dee3

Contents?: true

Size: 1.37 KB

Versions: 2

Compression:

Stored size: 1.37 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

2 entries across 2 versions & 1 rubygems

Version Path
ruote-0.9.20 examples/homeworkreview.rb
ruote-0.9.19 examples/homeworkreview.rb