Skip to content
This repository has been archived by the owner on Aug 31, 2020. It is now read-only.
/ petri_flow Public archive
forked from hooopo/petri_flow

Petri Net Workflow Engine for Ruby.

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
MIT-LICENSE
Notifications You must be signed in to change notification settings

pleisto/petri_flow

 
 

Repository files navigation

Petri Flow

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

Usage

Add wf_config:

# config/initializers/wf_config.rb
Wf::Workflow.class_eval do
  def self.user_class
    ::User
  end
  
  # you can add more org class, for example, Role, Department, Position etc.
  def self.org_classes
    { group: ::Group }
  end
end

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

Demo App: https://github.com/hooopo/petri_flow_demo

Contributing

Contribution directions go here.

License

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

About

Petri Net Workflow Engine for Ruby.

Resources

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
MIT-LICENSE

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 67.7%
  • HTML 27.9%
  • CSS 3.9%
  • JavaScript 0.5%