h2. OpenWFEru developer documentation

h3. <a name="into"></a>getting into OpenWFEru

A good starting point is studying the "quotereporter.rb":/examples/quotereporter.rb example.

There are other "examples":/examples/ worth looking at.

Among them is a "flow tracing" example. You can run it from your OpenWFEru tree with

<pre>
    ruby -I lib examples/flowtracing.rb
</pre>

It will output to the std a trace for each participant reached.

The next step would be to browse the unit tests, especially those that are prefixed with "ft_". They show all the aspects of the process engine.

If you get lost in the terminology, you can consult the "glossary":glossary.html


h3. <a name="utests"></a>running the unit tests

<em>Note :</em> OpenWFEru is developed and tested on MacOSX (<em>ruby 1.8.5 (2006-12-25 patchlevel 12) [i686-darwin8.8.3]</em>, this environment was built following the fine instructions from Dan Benjamin at "Hivelogic":http://hivelogic.com/narrative/articles/ruby-rails-mongrel-mysql-osx)

Following the Rake tradition, you can run the unit tests from your openwfe-ruby tree with

<pre>

    rake test

</pre>

At each rake test run, a brand new _engine.log_ is produced and contains the complete debug log of the test run. It's your best friend while testing and debugging.

As OpenWFEru is a workflow / BPM engine, the persistence aspect is very important (the average business process lasts long, it has to survive a restart).

To run all the tests in rake_qtest.rb in persisted mode, do

<pre>

    rake ptest

</pre>

Note that this test persistence mode uses no cache, it's not meant for production but for testing, it is meant to display immediately any error in the persistence rythm of the expressions being tested.
By running 'ptest', every 'ft_' test is run in this raw persistence mode.

You can run tests one at a time with 

<pre>

    rake test TEST=test/ft_2_concurrence.rb

</pre>

You can run that same test in persistence mode (provided it extends FlowTestBase) with

<pre>

    rake ptest TEST=test/ft_2_concurrence.rb

</pre>

just changing 'test' to 'ptest'.

There is also the set of tests for the "CachedFilePersistenceEngine", an engine
almost as fast as the in-memory one but with the persistence turned on.

You can test it with 

<pre>

    rake ctest

</pre>


h3. <a name="template"></a>engine template

There is now a <a href="/examples/engine_template.rb">template</a> showing how to configure an OpenWFEru engine. It's extensively commented.

One should be able to copy this template and modify it to get a complete OpenWFEru engine setting.

_(to be continued)_

