akarpov89 / microflow Goto Github PK
View Code? Open in Web Editor NEWLightweight workflow engine
Home Page: http://akarpov89.github.io/MicroFlow/
License: MIT License
Lightweight workflow engine
Home Page: http://akarpov89.github.io/MicroFlow/
License: MIT License
Hi,
Thanks for this great framework.
I want to create an activity that depends of user intervention, this means that we are creating this activity, the workflow instance, should be on standby until the user does an action.
Also how we can suspend and resume workflow instance.
Many Thanks,
More:
https://github.com/danielgerlag/workflow-core
https://www.codeproject.com/Articles/1164009/Wexflow-Open-source-workflow-engine-in-Csharp
https://www.tomware.ch/2018/04/30/building-a-simple-workflow-system-with-asp-net-core/
http://www.workflowpatterns.com/patterns/presentation/concretesyntax/index.php
Support creating the flow on the fly from it's scheme
Hi, are there persistence features? This is, in case there is a crash in the server application, is the updated workflow data/status saved somewhere?
Hi!
Given a disposable transient service:
public interface IDisposableService: IDisposable
{
...
}
public class DisposableService: IDisposableService
{
...
}
added to the flow
protected override void ConfigureServices(IServiceCollection services)
{
services.AddTransient<IDisposableService, DisposableService>();
}
i use in the activity (which is disposable as well), which throws an exception
public class SomeActivity : BackgroundActivity, IDisposable
{
public SomeActivity(IDisposableService service)
{
}
public override ExecuteActivity()
{
throw new Exception("Porebrik");
}
...
}
In this case Dispose is not called in the service instance.
Hi, Andrey
I'm having trouble with building the project with latest MicroFlow version. Is .net 4.0 supported on latest version?
I am trying to implement BL using Flows. Is there any opinionated way to:
From what i see from the docs / src a flow does not have an extensibility point to replace the DI container. An option of setting input is to pass it when constructing the flow via TInput
Ctor arg / Property and get the output after run from another Property IValue<TOutput>
that is updated after the last activity is executed.
A few observations about the design:
Sample for Flow with I/O (most probably not best way to do it):
public abstract class Flow<TInput, TOutput> : Flow
{
public override string Name => GetType().Name;
protected TInput Input { get; set; }
protected Variable<TOutput> Output { get; set; }
// Sync example
public TOutput Run(TInput input)
{
Input = input;
Run().Wait();
return Output.CurrentValue;
}
protected abstract void BuildCore(FlowBuilder builder);
protected override void Build(FlowBuilder builder)
{
Output = builder.Variable<TOutput>();
BuildCore(builder);
builder.WithDefaultCancellationHandler<DefaultCancelationandler>()
.WithDefaultFaultHandler<DefaultFaultHandler>();
}
}
public class XFlow : Flow<XInput, XOutput>
{
protected override void BuildCore(FlowBuilder builder)
{
var activity = builder.Activity<XActivity>();
activity.Bind(a => a.Input).To(Input);
activity.OnCompletionUpdate(Output, activityOutput => new XOutput());
builder.WithInitialNode(activity);
}
}
Usage:
XOutput output = new XFlow().Run(new XInput());
Hi, Andrey!
Looks like i've found a bug in If-ElseIf-Else conditon. If i define this condition with at least one ElseIf statement it's ok
var node = builder
.If("Condition1", () => boolExpr1).Then(node1)
.ElseIf("Condition2", () => boolExpr2).Then(node2)
.Else(node3);
but if i don't use ElseIf statement, node builder returns null:
var node = builder
.If("Condition", () => boolExpr).Then(node1)
.Else(node2);
Best regards,
Pavel
I've added a WCF service as transient service which has no endpoint defined. Like this:
protected override void ConfigureServices(IServiceCollection services)
{
services.AddTransient<IExceptionThrowingServiceAdapter, ExceptionThrowingServiceAdapter>();
}
This service throws an exception in constructor.
My activity looks like this:
public class SomeActivity : BackgroundActivity
{
public SomeActivity(IExceptionThrowingService service)
{
...
}
...
}
When flow tries to enter the activity, it immediately stops. No global fault handler is called and task, which was returned from Run() method has status "RanToCompletion".
The flow log file contains an exception stack trace.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.