Giter VIP home page Giter VIP logo

plan-process's Introduction

Plan Process Framework

Process Lifecycle Automation Notation

"La semplicità è l'ultima sofisticazione" (simplicity is the ultimate sophistication) - Leonardo da Vinci

"Keep it simple stupid" - Kelly Johnson

The Plan framework is an extremely small and light Java library (one class, three interfaces, < 200 lines of commented code, see note) for defining and executing processes.

Plan process definitions are similar to workflows, but the framework intentionally refrains from addressing elements commonly found in workflow solutions, such as diagramming, standard process model compliance or integration with databases or service interfaces.

Rather than coding a particular process flow programmatically, as in this example:

public void flightBooker(FlightBooking request) {
  validate(request);
  if(request.getState()==BookingState.VALID) {
    pay(request);
  }
  if(request.getState()==BookingState.PAID) { 
    notify(request);
  }
}

Plan extends Spring's context schema, to declaratively define a process as a mapping of the request states to the next action (in this example, referencing bean objects for the process steps, from, for example, @Component-annotated Java classes):

<plan:process id="flightBooker" 
      state-class="org.seefin.plan.tests.booking.BookingState">
    <plan:node state="OPEN" action-ref="validator"/>
    <plan:node state="PAID" action-ref="bookFlight"/>
    <plan:node state="BOOKED" action-ref="notifier"/>
</plan:process>

There is a good article over on InfoQ Workflow Engine – To Build or Not to Build One? where the author challenges the (apparently) common decision to built-not-buy a workflow engine. One of the main reasons for building is given as we only have very basic requirements, a very simple state machine. A workflow engine is overkill. and the reader encouraged to spent time getting to understand a workflow engine, first.

Well, I followed that advice, I downloaded innumerable projects, resolved un-resolvable jar dependencies, but all the projects were either dead, or far, far bigger in scope and complexity than what I wanted. One exception was Apache ServiceMix BeanFlow, but the stated goal of that framework was to avoid xml and stick with Java - not really what I was looking for. The concurrency model (based on Java 5 Concurrency) is excellent, and perhaps could be applied to Plan at some stage in the future.

Update : at last, found a workflow engine that meets my criteria: Activiti - highly recommended

note : cheating slightly, the core classes of Plan are indeed less that 00 lines long; however, there is almost 500 lines of Java implementing the Spring XSD code)

Why the contrived project name 'Plan'

Just a nod to one of the first languages I programmed in, the PLAN assembly language on the ICL 1900 series, before moving on to high level languages, like BCPL. Interesting historical asice: BCPL was the first language in which Hello World was written, and also the source of some of the syntax inherited by Java (for better or worse...):

// BCPL 'Hello World' program
GET "LIBHDR"

LET START () BE { WRITES ("Hello World!*N") }

plan-process's People

Watchers

 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.