GithubHelp home page GithubHelp logo

xaop / ruote Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jmettraux/ruote

1.0 11.0 0.0 12.04 MB

a ruby workflow engine

Home Page: http://ruote.rubyforge.org

License: MIT License

Ruby 99.94% Shell 0.06%

ruote's Introduction

ruote

Ruote is a Ruby workflow engine. It’s thus a workflow definition interpreter. If you’re enterprisey, you might say business process definition.

Instances of these definitions are meant to run for a long time, so Ruote is oriented towards persistency / modifiability instead of transience / performance like a regular interpreter is. A Ruote engine may run multiple instances of workflow definitions.

Persistent mostly means that you can stop Ruote and later restart it without losing processes. Modifiability means that you can modify a workflow instance on the fly.

Process definitions are mainly describing how workitems are routed to participants. These participants may represent worklists for users or group of users, pieces of code, …

usage

grab ruote

gem install ruote
gem install yajl-ruby

Note : the json gem has a serious bug :

http://github.com/flori/json/issues#issue/21

So yajl-ruby is seriously recommended.

Then

require 'rubygems'
require 'ruote'
require 'ruote/storage/fs_storage'

# preparing the engine

engine = Ruote::Engine.new(
  Ruote::Worker.new(
    Ruote::FsStorage.new('ruote_work')))

# registering participants

engine.register_participant :alpha do |workitem|
  workitem.fields['message'] = { 'text' => 'hello !', 'author' => 'Alice' }
end

engine.register_participant :bravo do |workitem|
  puts "I received a message from #{workitem.fields['message']['author']}"
end

# defining a process

pdef = Ruote.process_definition :name => 'test' do
  sequence do
    participant :alpha
    participant :bravo
  end
end

# launching, creating a process instance

wfid = engine.launch(pdef)

engine.wait_for(wfid)
  # blocks current thread until our process instance terminates

# => 'I received a message from Alice'

test suite

see github.com/jmettraux/ruote/tree/master/test

license

MIT

feedback

ruote's People

Contributors

jmettraux avatar kennethkalmer avatar p avatar doitdistributed avatar

Stargazers

 avatar

Watchers

Stijn Pint avatar Peter Vanbroekhoven avatar France avatar Joeri Samson avatar Stijn Van Vreckem avatar James Cloos avatar Robrecht Dewaele avatar Ruben Tytgat avatar  avatar Sam Nielandt avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.