Hello there:

my peer and I are new to both, rails and openwferu, so my appologies
in advance if I'm asking the obvious.  We would like to use openwferu
within a rails application.
Following is the list of installed gems:

*** LOCAL GEMS ***

actionmailer (1.3.3)
    Service layer for easy email delivery and testing.

actionpack (1.13.3)
    Web-flow and rendering framework putting the VC in MVC.

actionwebservice (1.2.3)
    Web service support for Action Pack.

activerecord (1.15.3)
    Implements the ActiveRecord pattern for ORM.

activesupport (1.4.2)
    Support and utility classes used by the Rails framework.

ci_reporter (1.3.3)
    CI::Reporter allows you to generate reams of XML for use with
    continuous integration systems.

hpricot (0.6)
    a swift, liberal HTML parser with a fantastic library

mime-types (1.15)
    Manages a MIME Content-Type that will return the Content-Type for
a
    given filename.

openwferu (0.9.12)
    an open source ruby workflow and bpm engine

rails (1.2.3)
    Web-application framework with template engine, control-flow
layer,
    and ORM.

rake (0.7.3)
    Ruby based make-like utility.

rcov (0.8.0.2)
    Code coverage analysis tool for Ruby

rest-open-uri (1.0.0)
    A drop-in replacement for open-uri for use in REST clients.

sources (0.0.1)
    This package provides download sources for remote gem installation


As a starting point, we have a very simple (and yes, useless) class
that
wraps an OpenWFE::Engine instance (this class is defined in our rails
project under lib/wfe/simple_engine.rb):

require 'rubygems'
require 'openwfe/def'
require 'openwfe/workitem'
require 'openwfe/engine/engine'
require 'openwfe/worklist/worklist'
require 'openwfe/worklist/storelocks'
require 'openwfe/worklist/storeparticipant'

class SimpleEngine

  def initialize
    @engine = OpenWFE::Engine.new
  end

  #
  # An empty process definition: used for verification of engine start-
up
  class SimpleProcessDefinition < OpenWFE::ProcessDefinition
    sequence do
    end
  end

  # Launches a new instance of the process and returns the
corresponding Flow Expression Id
  #
  def launch_proccess
    li = OpenWFE::LaunchItem.new(SimpleProcessDefinition)
    li.status = "PROCESS_STARTED"
    fei = @engine.launch li
    puts "started process '#{fei.workflow_instance_id}'"
    return fei
  end

  #
  # Stops the underlying workflow engine
  def stop
    @engine.stop
  end

end


The corresponding test class (under <our_rails_project>/test/unit/
simple_workflow_test.rb):

require File.expand_path(File.dirname(__FILE__) + "/../../config/
environment")

require "test/unit"
require "wfe/simple_engine"

class SimpleWorkflowTest < Test::Unit::TestCase

  def setup
    @engine = SimpleEngine.new
  end

  def teardown
    @engine.stop
  end

  def test_simple_engine_started
    fei = @engine.launch_proccess
    assert_kind_of OpenWFE::FlowExpressionId, fei
    wfid = fei.workflow_instance_id
  end

end

Our first objective is to verify that we can launch workflow instances
as part of a rails
application.  Using Eclipse 3.3.0 (with corresponding Aptana and
RadRails plugins) when we
run just this test alone, the test passes and everything is fine.  But
if we attempt to run
all tests (either using Eclipse or "rake test" at the command line)
the test fails with the
following error:

  1) Error:
test_simple_engine_started(SimpleWorkflowTest):
SystemStackError: stack level too deep
    /usr/lib/ruby/1.8/open-uri.rb:32:in `open_uri_original_open'
    /usr/lib/ruby/1.8/open-uri.rb:32:in `open_uri_original_open'
    /usr/lib/ruby/gems/1.8/gems/rest-open-uri-1.0.0/lib/rest-open-
uri.rb:37:in `open'
    /usr/lib/ruby/1.8/logger.rb:518:in `open_logfile'
    /usr/lib/ruby/1.8/logger.rb:487:in `initialize'
    /usr/lib/ruby/1.8/logger.rb:263:in `new'
    /usr/lib/ruby/1.8/logger.rb:263:in `initialize'
    /usr/lib/ruby/gems/1.8/gems/openwferu-0.9.12/lib/openwfe/engine/
engine.rb:91:in `new'
    /usr/lib/ruby/gems/1.8/gems/openwferu-0.9.12/lib/openwfe/engine/
engine.rb:91:in `initialize'
    /work/workspace/prototype/config/../lib/wfe/simple_engine.rb:12:in
`new'
    /work/workspace/prototype/config/../lib/wfe/simple_engine.rb:12:in
`initialize'
    ./test/unit/simple_workflow_test.rb:9:in `new'
    ./test/unit/simple_workflow_test.rb:9:in `setup'

  2) Error:
test_simple_engine_started(SimpleWorkflowTest):
NoMethodError: You have a nil object when you didn't expect it!
The error occurred while evaluating nil.stop
    ./test/unit/simple_workflow_test.rb:13:in `teardown'

17 tests, 43 assertions, 0 failures, 2 errors

Can you please provide any guidance or workaround to this problem?

Thanks,

Javier.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"OpenWFEru users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/openwferu-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to