Code Monkey home page Code Monkey logo

orleans.activities's Introduction

Orleans logo Orleans.Activities

Workflow Foundation (.Net 4.x System.Activities workflows) over Microsoft Orleans framework to provide stable, long-running, extremely scalable processes with XAML designer support.

Stable: GitHub version NuGet version

Master: Build status AppVeyor project feed (NuGet source)

Stats: Issue Stats PR Issue Stats Issues

Issues: Help Wanted (filtered view) Up for Grabs (filtered view) Ready In Progress

Documentation (see Samples below)

Guidelines

This project is licensed under the Apache License.

Concept

Overview

This is a very high level view:

  • Each WorkflowGrain is indistinguishable from a normal grain and backed by a WorkflowHost.
  • The WorkflowHost is responsible to handle the lifecycle of the WorkflowInstance, mainly recreate it from a previous persisted state when it aborts.
  • The communication between the WorkflowGrain and the WorkflowHost is based on 2 developer defined interfaces for the incoming and outgoing requests (TWorkflowInterface and TWorkflowCallbackInterface). These interfaces' methods can be referenced from the workflow activities to accept incoming or to initiate outgoing requests.
  • The methods of the TWorkflowInterface and TWorkflowCallbackInterface are independent from the grain's external public interface, you can merge different public requests into one method or vice versa. Or a reentrant grain even can execute (read-only) public interface methods independently from the current running workflow operations.
  • The method's signatures are restricted, their parameters and return values are lazy, async delegates with 1 optional parameter/return value. The delegates executed by the workflow activities if/when they accept them (command pattern).
  • There are design-, build- and static-run-time checks to keep the interfaces and the workflows in sync.
  • Though you can execute complete workflows as methods also.

A typical workflow grain manages operations in other grain(s) and handles only the process specific data in it's own state.

The goal, is to keep the C# code in the grain, and use the workflow only to decide what to do next. This way we can avoid a steep learning curve to use workflows: the developer doesn't need to write or to understand anything about activities, he/she can build workflows with the provided activities in a designer.

If it's needed, a mainly computational workflow can be executed also, even without any incoming or outgoing request.

Functionality

Implemented:

  • Persistence (compatible with legacy workflow extensions)
  • Reminders (compatible with legacy Delay activities)
  • Tracking
  • Designer support
  • Nearly all legacy activities are supported (except TransactionScope and messaging activities)

Extra implemented features:

  • TAP async API
  • Optionally idempotent request processing for forward recovery
  • Automatic reactivation after failure
  • Workflow can be persisted during processing an incoming request (ReceiveRequestSendResponseScope is not an implicit NoPersistScope)
  • Executing code "in the background" on the tail of the request after the request returns it's response
  • Workflow is informed whether it is running in a reloaded state after failure (to determine necessary recovery)
  • Notification participant extensions (to get notified when the workflow is idle)

Under construction:

  • Tests (currently semi manual, semi automatic MSTest, don't even look at them)
  • More elaborate sample with
    • DI/Autofac
    • Strategy and Humble Object patterns, to show an architecture, where the application logic can be tested independently from Orleans and from Orleans.Activities workflows

Not implemented, help wanted (for design and for implementation):

  • DynamicUpdateMap support (updating loaded workflows to a newer definition version), though the separation of the application logic (the plain C# delegates) and the process (the diagram) results in a very simple workflow diagram, that has a big chance you won't need to update when it runs
  • See all Help Wanted issues (filtered view)

And there are nearly unlimited Open issues...

Samples

HelloWorld - How to communicate with the workflow through custom interfaces.

Arithmetical - How to execute the complete workflow like a method.

Details

This is still an overview, all the details of the classes are hidden. The goal is to give a map to understand the relations between the classes. See the comments in the source!

Overview

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.