Giter VIP home page Giter VIP logo

microflow's People

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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

microflow's Issues

Information About this Framework

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,

Workflow persistence

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?

Transient service disposal problem

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.

Build issues

Hi, Andrey

I'm having trouble with building the project with latest MicroFlow version. Is .net 4.0 supported on latest version?

Flow Usage Question

I am trying to implement BL using Flows. Is there any opinionated way to:

  • set input to a Flow
  • get output for a Flow
  • use an existing Dependency container (Microsoft.Extensions.DependencyInjection)

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:

  • Flows must be transient - downside the FlowDescriptor gets rebuilt at every run, container is reconfigured every time
  • No option for composing flows (eg: a Flow to be considered an activity on it's own) - not an issue actually, maybe not actually desired to allow flow composition

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());

If-ElseIf-Else conditon problem

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

An exception thrown in transient service constructor stops the flow and global fault handler is not called

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.

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.