Giter Site home page Giter Site logo

workflow's Introduction

CQRS Eventsourcing Workflow Engine

Join the chat at https://gitter.im/cqrs-engine/Lobby

IMPORTANT

Only the data structures are working, for testing and collecting feedbacks. We believe that at the begining of December 2016, the framework will be usable.

Pure functions data structures

In the folder engine > types you will find the data structures, so you can write your pure functions over them, under the "side effects" dimension.

  1. A pure function is given one or more input parameters.
  2. Its result is based solely off of those parameters and its algorithm. The algorithm will not be based on any hidden state in the class or object it’s contained in.
  3. It won’t mutate the parameters it’s given.
  4. It won’t mutate the state of its class or object.
  5. It doesn’t perform any I/O operations, such as reading from disk, writing to disk, prompting for input, or reading input.

Motivation

As aggregates listen for commands, process managers listen for events (sometimes commands also), and as aggregates emmits events, process managers dispatch commands.

  • pure functional data structures for aggregates and process managers
  • use monads (monadex) to simulate different business scenarios
  • one abstraction to implement side-effects
  • multiple data-stores
  • plugable message queue for publishing events
  • one gen_server implementation for aggregates and process managers
  • automatic process-manager creation based on correlation-ids (as suggested by Greg Young)
  • easy use of FSM on process managers

Develop

mix test.watch

Send events from the prompt:

iex -S mix
TODO: add example

Eventstore

Run a docker instance in your machine. If you have mac, ask the sys-admin to start it in a linux server on you LAN or WAN. Access the web gui in http://localhost:2113 . User: admin, pass: changeit

docker run --name eventstore-node -it -p 2113:2113 -p 1113:1113 eventstore/eventstore

Resources

Below you can see several resources I researched before writing this lib. Special thanks for Ben Smith, where many ideas were copied from commanded library.

  • burmajam for sharing the very well written extreme driver to connect to Eventstore.
  • slashdotdash for sharing the CQRS framework, where many parts of the code here are from his framework.
  • cqrs-erlang - A memory model using standard spawn functions CQRS in erlang.
  • gen-aggregate - Macro for the aggregate structure, using buffers.

workflow's People

Contributors

gitter-badger avatar henry-hz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

workflow's Issues

implement pipelines for handle and mutators

The most flexible pipelines, that will permit assigning meta-data (correlation-id, causation-id, etc..) freely, should be done with pipelines:
1- before handle
2- after handle
3- handle fail
4 -before mutation
5- after mutation
6-mutation failed

implement aggregate REST flow

When state is needed after a command, check if created event was successfully applied, and eventstore returned a beautiful OK that the event was persisted, so in terms of latency, you have now the most young state created, and instead of round-tripping to eventstore to return to REST, send back the state from the mutated aggregate as an answer, using pipelines.

Below some resources:

http://stackoverflow.com/questions/32476397/how-to-support-command-in-rest-while-doing-rest-cqrs-and-eventsourcing-together

https://lostechies.com/jimmybogard/2016/06/01/cqrs-and-rest-the-perfect-match/

http://stackoverflow.com/questions/32476397/how-to-support-command-in-rest-while-doing-rest-cqrs-and-eventsourcing-together

https://www.infoq.com/articles/rest-api-on-cqrs

https://groups.google.com/forum/#!topic/dddcqrs/YdTAIcGMXFI%5B1-25%5D

http://vvgomes.com/cqrs-and-rest/

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.