Skip to content
Petri Net Workflow Engine for Ruby.
Ruby HTML CSS JavaScript
Branch: master
Clone or download
Latest commit 1d8cebf Feb 19, 2020
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/workflows try github action Feb 16, 2020
app add more powerful guard expression Feb 18, 2020
bin init Jan 12, 2020
config add user workitem list Feb 4, 2020
db/migrate replacable form Feb 14, 2020
lib bump 0.1.7 Feb 18, 2020
screenshots add screenshots Feb 7, 2020
test add more powerful guard expression Feb 18, 2020
.editorconfig some configs Jan 23, 2020
.gitattributes some configs Jan 23, 2020
.gitignore redesign bootstrap theme and graphviz color scheme. Feb 8, 2020
.rubocop.yml some configs Jan 23, 2020
FormSpec.md extract config to Wf Feb 15, 2020
Gemfile mysql support Feb 6, 2020
Gemfile.lock bump 0.1.7 Feb 18, 2020
LICENSE Initial commit Jan 12, 2020
MIT-LICENSE init Jan 12, 2020
README.md add more powerful guard expression Feb 18, 2020
Rakefile rubocop -a Jan 23, 2020
wf.gemspec add more powerful guard expression Feb 18, 2020

README.md

Petri Flow Ruby Gem Testing

Workflow engine for Rails.

Features

  • Full petri net features support (seq, parallel, iterative, timed, automitic etc.)
  • Both approval workflow and business workflow.
  • Simple web admin for workflow definition and case management.
  • Build-in simple dynamic form.
  • Replaceable dynamic form.
  • Graph screen for workflow definition.
  • Graph screen for case and token migration.
  • Powerful guard expression.
  • MySQL and Postgres Support.
  • Powerful assignment management.
  • Flexible integration of organizational structure system(role, group, position or department etc.)

Docs

Screenshots

iterative routing

parallel_routing

guard

case state graph

Installation

Add this line to your application's Gemfile:

gem 'petri_flow', require: 'wf'

And then execute:

$ bundle

Install graphviz

brew install graphviz

Migration:

bundle exec rake wf:install:migrations
bundle exec rails db:create
bundle exec rails db:migrate
bundle exec rails db:seed

Usage

Add wf_config:

# config/initializers/wf_config.rb
Wf.user_class = "::User"
Wf.org_classes = { group: "::Group" }

Set parties:

class User < ApplicationRecord
  belongs_to :group, optional: true
  has_one :party, as: :partable, class_name: 'Wf::Party'

  # NOTICE: group or user or role all has_many users
  has_many :users, foreign_key: :id

  after_create do
    create_party(party_name: name)
  end
end
class Group < ApplicationRecord
  has_many :users
  has_one :party, as: :partable, class_name: 'Wf::Party'
  after_create do
    create_party(party_name: name)
  end
end

then

bundle exec rails 

visit:

http://localhost:3000/wf

Testing

  • RAILS_ENV=test rake app:db:migrate && RAILS_ENV=test rake app:db:test:prepare && bundle exec rake test

Contributing

Contribution directions go here.

License

The gem is available as open source under the terms of the MIT License.

You can’t perform that action at this time.