Coder Social home page Coder Social logo

florist's Introduction

florist

Flor is a "Ruby workflow engine", florist is an extension to flor that adds a few database tables and Ruby classes to manage one or more worklists, where tasks are stored.

It aims to follow the guidance/conventions found at http://www.workflowpatterns.com/patterns/resource/.

There is a WorklistTasker a flor tasker that, upon receiving a task from the flor engine it's bound to, stores it in its target worklist.

                                                          .-----------.
                                                      ,-->| suspended |
   .---------.                                .---------. '-----------'
-->| created |------------------------------->| started |<--'
   '---------'               .--------------. '---------'  .--------.
      |    '---------------->| allocated    |   ^ ^ | '--->| FAILED |
      |  .-----------------. | (single res) |---' | |      '--------'
      |  | offered         | '--------------'     | |   .-----------.
      `->| (1 or more res) |----------------------' `-->| COMPLETED |
         '-----------------'                            '-----------'

API

Florist::Worklist

A worklist needs access to the a flor engine/unit database and, if it's not the same database, a florist database.

list = Florist::Worklist.new(@flor_unit)
list = Florist::Worklist.new('postgresql://127.0.0.1/flor')
list = Florist::Worklist.new(@flor_unit, 'postgresql://127.0.0.1/florist')
list = Florist::Worklist.new('postgresql://127.0.0.1/flor', 'postgresql://127.0.0.1/florist')
# ...

Once a worklist is instantiated, one can extract task instances out of it via the #tasks accessor. That yields a Sequel dataset.

puts "there are currently #{list.tasks.count} task(s) in the worklist"

tasks = list.tasks.all
  # fetches all the tasks in the worklist

tasks = list.tasks.where(domain: 'acme.org.accounting')
  # fetches all the tasks whose domain is exactly 'acme.org.accounting'

tasks = list.tasks.where(Sequel.like(:domain, 'acme.org.accounting.%'))
  # fetches all the tasks under the demain 'acme.org.accounting'

TODO continue me

Florist::Task

task = lists.tasks.first

p task.exid    # the id of the execution that emitted the task
p task.tasker  # the tasker name as seen from the execution
p task.name    # the task name

p task.payload
p task.fields   # the hash, the payload of the workitem behind the task

tasks, transitions, and assignments

As seen above, the task, freshly emitted by a flor engine, starts in the "created" state. The worklist may then automatically assign or offer it to a "resource" (someone or something with access to the worklist).

TODO continue me

Florist::WorklistTasker

TODO

LICENSE

MIT, see LICENSE.txt

florist's People

Contributors

jmettraux avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.