GithubHelp home page GithubHelp logo

workflower's Introduction

Workflower

This plugin enanche RoR by adding the possibility of handling workflows. By workflows, I mean a certain sequence of valid steps that we want the user to perform before achiving a result.

For instance, let's say you are building the checkout process in your new stunning e-commerce app. Clearly, you want the user to follow a certain path, i.e. go through the payments page, then the shipping page and finally the checkout page. But as a good developer, you are lazy and you don't feel like wasting your time implementing the logic the forces the user to follow that path and handles all the validations and redirections needed in these scenario. Instead, you just include this plugin in your app and you can get the behavior you are looking for just by typing:

workflow :checkout, singleton:true do |w|
    #first step - payment
		create_state w, controller: :checkout, action: :payment, redirect_to_wf: 'login'
    #secont step - shipping
		create_state w, conditions: valid_payment(params[:card_number]),
			 controller: :checkout, action: :shipment, redirect_to: '/checkout'
    #third step - submit order
		create_state w, conditions: valid_shipment(params[:shipping_ifo]),
			 controller: :checkout, action: :submit, redirect_to: '/checkout/shipment'	
end

More generally,

workflow :workflow_name, singleton:true|false do |w|
    ...
		create_state w, conditions: boolean,
			 controller: :controller_name, action: :action_name, redirect_to: '/checkout'
    ...
end

For more details, please read my 100pages dissertation :)

workflower's People

Contributors

rops avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

cbforks

workflower's Issues

Link to your masters thesis?

First, I would like to thank you for publishing this project. It looks really cool, though I am not sure that I would use it since I am not a Ruby fan. (I like CoffeeScript/ES3/ES5 keep it simple.)

I really like this kind of idea so it would be cool if you can publish your masters thesis (or even convert it to HTML). If you cannot do this, I will completely understand.

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.