by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    idscom
    @idscom
    Just to clarify - what i want to do is run the elsa workflow on one project and then the dashboard in another client application. Then adjust the look and feel of the dashboard.
    Sipke Schoorstra
    @sfmskywalker
    @idscom The Dashboard in its current form doesn't allow for customization, so I recommend creating your own one. I do plan on creating a couple of dashboard apps for Elsa 2: one SPA, and one in the form of an Orchard Core module - Orchard Core's dashboard is customizable - extensible. In all of these scenarios, the workflow designer component will be reused, and wrappers will be provided (React, Angular, Vue and Blazor).
    But that is still far away, so right now your best bet would be to create a dashboard yourself and just re-use the workflow designer component.
    jayachandra21
    @jayachandra21
    Is it possible to create a custom activity using the Elsa workflow? I mean,I need to create a Custom Activity to use in workflow. Please suggest me.
    12 replies
    Roland Whitley
    @syntaxonline.com.roland.whitley_gitlab
    @sfmskywalker, the tips about debugging came in helpful. Did not catch fully qualified in message type. Saw how typename is being used and works as expected. Thank you
    1 reply
    jayachandra21
    @jayachandra21
    @sfmskywalker will it be possible to create a variables in workflow and assign value to the same variable in Custom Activity? If so is there any help document to refer the same procedure? Thank You!
    13 replies
    chinasky
    @hellowxw
    @sfmskywalker
    I designed two workflows, and when I triggered one of them, both workflows would be instantiated. I designed different start signals for the two workflows
    2 replies
    Eric Dunn
    @ericdunn
    @sfmskywalker Hello ! I'm brand new to using Elsa, as in I'm still evaluating whether or not it will fit my needs. I'm struggling a bit here so just wanted to see if it will even work lol. I basically have to write a workflow that represents a set of gates that a project needs to go through, that can span over years. They are all (for the most part) 1 off, no-op type. So a business user simply flips a switch, that makes it move on to the next step. Some will require approvals, some won't. The most they'll ever do is send off an email. It seems every workflow solution I find is geared towards running a set of steps, either in their own background thread or sequentially, then stop. I know there can be blocking tasks in there, but not sure how I'd represent a 3 month-long blocking task. I started writing my own and then noticed it resembles A LOT how Elsa is built lol. Any help/advice would be appreciated !
    3 replies
    jayachandra21
    @jayachandra21

    Hello,
    We have created two custom activities, let say CustomActivity1 and CustomActivity2. Now output variable value of CustomActivity1 should read in CustomActivity2.

    CustomActivity1:
    protected override async Task<ActivityExecutionResult> OnExecuteAsync(WorkflowExecutionContext context, CancellationToken cancellationToken)
    {
    var str= await context.EvaluateAsync(ConnectionString, cancellationToken);
    object result = await FetchDataAsync(str, cancellationToken);
    Output.SetVariable("FetchJSONVal", result);
    return Done();
    }

    CustomActivity2

    1. Created a WorkflowExpress<string> property
      '[ActivityProperty(Hint = "Enter an expression that evaluates to the resultset.")]
       public WorkflowExpression<string> DataResultset
       {
           get => GetState<WorkflowExpression<string>>();
           set => SetState(value);
       }
    2. In Workflow Designer set the DataResultset as Liquid
      {{Activities.CustomActivity1.FetchJSONVal}}Reading the DataResultset value in below CustomActivity2 code:
      public WorkflowExpression<string> DataResultset
       {
           get => GetState<WorkflowExpression<string>>();
           set => SetState(value);
       }
      protected override async Task<ActivityExecutionResult> OnExecuteAsync(WorkflowExecutionContext context, CancellationToken cancellationToken)
       {
           var strResultSet = await context.EvaluateAsync(DataResultset, cancellationToken);
           object result = await FetchDataAsync(strResultSet, cancellationToken);
           return Done();
       }

    In this case I am getting the value of strResultSet ={{Activities.CustomActivity1.FetchJSONVal}} inplace of excat value passing from the CustomActivity1.

    Please suggest.

    27 replies
    Sipke Schoorstra
    @sfmskywalker
    Thanks. I’ll t try and have a look over the weekend and will let you know.
    Sipke Schoorstra
    @sfmskywalker
    image.png
    jayachandra21
    @jayachandra21

    Hi,

    I have a custom activity named it as CustomActivity1 and it returns the list as below screenshow.
    alt
    I have set list in SetVariable as,

    Output.SetVariable("FetchJSONVal", _strOutput);'

    Moreover, I want to use ForEach Acitivity in workflow designer to loop the above list items and check in each iteration if(EmpData.Value>EmpData.ID) then send an email

    How to design it and what is the best possible approach?

    Thanks for your support
    CustomActivity1.cs

    ` [ActivityProperty(Hint = "Enter an Expression that evaluates to the name of the database connection string.")]
    public WorkflowExpression ConnectionString
    {
    get => GetState<WorkflowExpression>();
    set => SetState(value);
    }
    protected override async Task OnExecuteAsync(WorkflowExecutionContext context, CancellationToken cancellationToken)
    {
    try
    {
    var sqlconnectionString = await context.EvaluateAsync(ConnectionString, cancellationToken);
    List _strOutput = await FetchDataAsync(sqlconnectionString, cancellationToken);
    Output.SetVariable("FetchJSONVal", _strOutput);
    }
    catch (Exception ex)
    {
    throw ex;
    }
    return Done();
    }
    private Task<List> FetchDataAsync(string _connectionstring, CancellationToken cancellationToken)

    {
        List<EmpData> geo = new List<EmpData> {
                new EmpData { Name="Emp1",Value="100", ID=1,Unit="1"},
                new EmpData { Name="Emp2",Value="101", ID=2,Unit="2"},
                new EmpData { Name="Emp3",Value="102", ID=3,Unit="3"},
            };
        return Task.FromResult(geo);
    }
    
    public class EmpData
    {
        public string Name { get; set; }
        public string Value { get; set; }
        public int ID { get; set; }
        public string Unit { get; set; }
    
    }

    `

    Boris Molodyi
    @BMol1

    Hi! I've started using Elsa for a POC at work, and all looks quite sweet so far, but couple of questions:

    1. Why, when I download a workflow from the online designer, it is saved as workflow..json (note two periods)?
    2. If I have a property in my activity that is some custom class, can it be serialized properly into the State? When I try to do it, I always get Json errors pointing at the expression path. If I just quote the entire expression and change syntax to Literal, I can deserialize the value in the activity code with no issues.

    Thanks!

    Ariel Jadzinsky
    @arieljad
    Hello, is there a simple example to see how to create an instance workflow by code, get an instance workflow by id, fire event to an instance to move to a new state? Thanks a lot. The project seems to be really interesting
    idscom
    @idscom

    @sfmskywalker Sorry to bother you again - but I am having difficulty getting Elsa configured in the following setup:

    I have a balzor ASP.Net Hosted application. I want to run the dashboard in the Blazor Client project and the execute the workflows in the Server Project. I run into issues because the Dashboard needs to target .net core 3.2 and the Blazor client in .Net Standard. So I can't add Elsa or the Dashboard to the Client Project. If i add Elsa to the Server project the Dashboard will not startup, with a complaint about: 'TypeLoadException: Generic method or method in generic class is internal call, PInvoke, or is defined in a COM Import class.'

    The alternative approach is to create a web project which targets .net core 3.2, run the dashboard in this project, but then how is is possible to use the dashboard to create workflows and have them target the Blazor ASP.net hosted server and not the elsa server in the dashboard is project?

    Thanks for any help!

    Eric Dunn
    @ericdunn

    Hello!
    I'm building a long-running workflow (that can span years). I'd like to know how I can get the current state of a workflow without actually starting it.

    Based on the examples, I can run

    var executionContext = await invoker.StartAsync(workflowDefinition, correlationId: correlationId);
    var currentStep = executionContext.CurrentActivity;

    In this case though, I need to start the workflow though, and I don't necessarily want to do that every time. If a user is just viewing the item in question, they don't need the workflow to run. Is there an easier way to do this?

    Thanks!
    Eric.

    sairamjallepalli
    @sairamjallepalli
    Emails Not triggered from workflow
    1 reply
    can anyone help me on this
    jayachandra21
    @jayachandra21
    @sairamjallepalli if possible share your issue screenshot. I may help you to resolve this issue.
    jayachandra21
    @jayachandra21

    Hi,
    I have designed a workflow and used Timer Activity to trigger a workflow with following configurations:
    Timeout Expression : 00:01:00
    "Timers": {"SweepInterval": "0:00:01:00"}

    I have observed the following strange things:

    If user keep open the Elsa dashboard portal, then timer functionality is working properly(Deployed the dashboard portal in IIS)
    If user closed the Elsa dashboard portal ,then timer activity NOT scheduling/starting the workflow behind the scene.
    When user reopen the portal after some time, Timer Activity starts/resume workflow.

    2 replies
    chinasky
    @hellowxw

    Hello!
    I'm building a long-running workflow (that can span years). I'd like to know how I can get the current state of a workflow without actually starting it.

    Based on the examples, I can run

    var executionContext = await invoker.StartAsync(workflowDefinition, correlationId: correlationId);
    var currentStep = executionContext.CurrentActivity;

    In this case though, I need to start the workflow though, and I don't necessarily want to do that every time. If a user is just viewing the item in question, they don't need the workflow to run. Is there an easier way to do this?

    Thanks!
    Eric.

    await _WorkflowInstanceStore.GetByCorrelationIdAsync(CorrelationId);
    CorrelationIdis your business primary key

    Joe Robe
    @joer33304

    @sfmskywalker Sorry to bother you again - but I am having difficulty getting Elsa configured in the following setup:

    I have a balzor ASP.Net Hosted application. I want to run the dashboard in the Blazor Client project and the execute the workflows in the Server Project. I run into issues because the Dashboard needs to target .net core 3.2 and the Blazor client in .Net Standard. So I can't add Elsa or the Dashboard to the Client Project. If i add Elsa to the Server project the Dashboard will not startup, with a complaint about: 'TypeLoadException: Generic method or method in generic class is internal call, PInvoke, or is defined in a COM Import class.'

    The alternative approach is to create a web project which targets .net core 3.2, run the dashboard in this project, but then how is is possible to use the dashboard to create workflows and have them target the Blazor ASP.net hosted server and not the elsa server in the dashboard is project?

    Thanks for any help!

    Did you get this solved ? I want to do the same thing

    1 reply
    knguyen-hci
    @knguyen-hci
    Could anyone please guide me on how to make my custom activities show in the workflow designer please
    jayachandra21
    @jayachandra21
    @knguyen-hci please refer this Custom Activities
    4 replies
    jayachandra21
    @jayachandra21
    @sfmskywalker Is it possible to log a information in a file? if so, what are the settings for the that? I didn't find any setting related to the application log configuration.
    3 replies
    jayachandra21
    @jayachandra21
    Hi, Does any one know the option to change the Timezone format for elsa workflows? Because in Dashboard finished workflow instances timezone format is different then the my server timezone formats. image.png
    3 replies
    jayeshdhameliya
    @jayeshdhameliya
    Hi,
    How to use If/else activity and what is syntax of conditional expression in if/else activity?
    3 replies
    Please if possible provide if/else and while activity demo?
    chinasky
    @hellowxw
    @sfmskywalker
    How do I write an expression in ifelse activity? thank you!
    jayeshdhameliya
    @jayeshdhameliya
    How to set variable from activity completed like outcome(user).email?
    and how to check in if/else expression in UI side. like set variable name is UserEmail so UserEmail="xyz@domail.com"?
    Sipke Schoorstra
    @sfmskywalker
    @hellowxw Please see my reply to @jayeshdhameliya above, who asked the exact same question :)
    jayeshdhameliya
    @jayeshdhameliya

    How to set variable from activity completed like outcome(user).email?
    and how to check in if/else expression in UI side. like set variable name is UserEmail so UserEmail="xyz@domail.com"?

    Any update on this

    wangadeketan
    @wangadeketan

    @sfmskywalker hi i have integrated Liquid configuration in my project.
    When i am not using elsa workflow dbcontext in my workflow will be working properly but when i add a elsa workflow dbcontext my {{ Activities.CentralTask.taskId }} not accepting data
    Error

    2020-08-24 10:56:12 +05:30 [ERR] Error while evaluating Liquid expression "{ Activities.CentralTask.taskId }". Message: Object reference not set to an instance of an object.
    System.NullReferenceException: Object reference not set to an instance of an object.
    at Elsa.Scripting.Liquid.Handlers.CommonLiquidContextHandler.GetActivityOutput(LiquidObjectAccessor1 accessor, String activityName, String outputKey) at Fluid.Accessors.AsyncDelegateAccessor2.Fluid.IAsyncMemberAccessor.GetAsync(Object obj, String name, TemplateContext ctx)
    at Fluid.Values.ObjectValue.<GetValueAsync>gAwaited|6_0(IAsyncMemberAccessor asyncAccessor, Object value, String n, TemplateContext ctx)
    at Fluid.Ast.MemberExpression.Awaited(ValueTask`1 task, TemplateContext context, MemberSegment[] segments, Int32 startIndex)
    at Fluid.Ast.OutputStatement.<WriteToAsync>g
    Awaited|7_0(ValueTask1 t, TextWriter w, TextEncoder enc, TemplateContext ctx) at Fluid.BaseFluidTemplate1.Awaited(ValueTask1 task, TextWriter writer, TextEncoder encoder, TemplateContext context, List1 statements, Int32 startIndex)
    at Fluid.FluidTemplateExtensions.<RenderAsync>g__Awaited|3_0(ValueTask task, StringWriter writer, StringBuilderPool builder)
    at Elsa.Scripting.Liquid.Services.LiquidTemplateManager.RenderAsync(String source, TemplateContext context, TextEncoder encoder)
    at Elsa.Scripting.Liquid.Services.LiquidExpressionEvaluator.EvaluateAsync(String expression, Type type, WorkflowExecutionContext workflowExecutionContext, CancellationToken cancellationToken)
    at Elsa.Expressions.WorkflowExpressionEvaluator.EvaluateAsync(IWorkflowExpression expression, Type type, WorkflowExecutionContext workflowExecutionContext, CancellationToken cancellationToken)
    2020-08-24 10:56:12 +05:30 [ERR] Error while invoking activity fbba1f20-8b13-4c31-8fc5-147e6044269d of workflow 4e021e3d44fd40f1833e41d08d4f08c1
    Elsa.Exceptions.WorkflowException: Error while evaluating Liquid expression "{{ Activities.CentralTask.taskId }}". Message: Object reference not set to an instance of an object.
    at Elsa.Expressions.WorkflowExpressionEvaluator.EvaluateAsync(IWorkflowExpression expression, Type type, WorkflowExecutionContext workflowExecutionContext, CancellationToken cancellationToken)
    at Elsa.Extensions.WorkflowExpressionEvaluatorExtensions.EvaluateAsyncT
    at Elsa.Samples.UserRegistration.Web.Activities.TaskResolve.OnExecuteAsync(WorkflowExecutionContext context, CancellationToken cancellationToken) in E:\experiment\users\ketan\Elsa\user_creation\user_registration\src\Elsa.Samples.UserRegistration.Web\Activities\TaskResolve.cs:line 35
    at Elsa.Services.ActivityInvoker.InvokeAsync(WorkflowExecutionContext workflowContext, IActivity activity, Func`2 invokeAction)

    17 replies
    gsureshmca2020
    @gsureshmca2020
    How to bind ActivityPropertyTypes.List ? (List box) in elsa work flow and get multiple selection
    1 reply
    Matt Whetton
    @mattwhetton
    Are there any instructions anywhere on adding custom field editors?
    2 replies
    etherealdragon
    @etherealdragon
    Can I load a JSON Workflow created by the Dashboard into my C# ASP.NET Core App and execute it instead of having to type a bunch of C# Code workflows? I find it more intuitive to design the workflows in the Dashboard, persist them as JSON, and load the JSON workflow file programmatically and execute them in C# code. Are there any examples that demonstrate this? Thanks in advance! =)
    4 replies
    Jason Daly
    @JasonDa84754102_twitter
    Is there a code-based method to execute a workflow by name (i.e. something similar to IWorkFlowInvoker.TriggerAsync("workflow-name")?
    7 replies
    TaLz1978
    @TaLz1978
    Hi, saw this question and was wondering if anyone here can relate
    elsa-workflows/elsa-core#348
    Is there any way to configure the dashboard to display also the workflows that are programmatically created? From what I've seen, these workflows are not even stored in the WorkflowDefinitionVersions. It would be very useful to see the running workflows in the dashboard as well as the log part, even if the workflow is created from the code.
    If this feature is not supported yet, are there any plans to implement it in the future?
    1 reply
    wangadeketan
    @wangadeketan
    @sfmskywalker What is the next release date of elsa?
    2 replies
    Jovan
    @Jovan56154860_twitter
    There is a problem with CosmosDB persistence support. If I use MongoDB for persistence, everything is perfect, but with CosmosDB as a persistence layer I get NodaTime errors, Newtonsoft JSON errors. The same code works with MongoDB. Any hint how to resolve CosmosDB problem?
    1 reply
    RodiGarcia
    @RodiGarcia
    Hello, I there a way to configure JsonSerializerSettings to ReferenceLoopHandling = ReferenceLoopHandling.Ignore? When serializing my objects it's triggering an exception, I tried to implement my custom implementation of IWorkflowSerializerProvider with no luck...
    public class WorkflowSerializerProvider : IWorkflowSerializerProvider
        {
            public JsonSerializerSettings CreateJsonSerializerSettings()
            {
                return new JsonSerializerSettings
                {
                    NullValueHandling = NullValueHandling.Ignore,
                    ContractResolver = new CamelCasePropertyNamesContractResolver(),
                    ReferenceLoopHandling = ReferenceLoopHandling.Ignore
                }.ConfigureForNodaTime(DateTimeZoneProviders.Tzdb);
            }
    
            public JsonSerializer CreateJsonSerializer()
            {
                var jsonSerializer = new JsonSerializer();
                jsonSerializer.ConfigureForNodaTime(DateTimeZoneProviders.Tzdb);
                jsonSerializer.NullValueHandling = NullValueHandling.Ignore;
                jsonSerializer.ContractResolver = new CamelCasePropertyNamesContractResolver();
                jsonSerializer.ReferenceLoopHandling = ReferenceLoopHandling.Ignore;
                return jsonSerializer;
            }
        }
    2 replies
    jaredrsowers
    @jaredrsowers
    what is the timeline for the 2.0 release?
    1 reply
    gztamas
    @gztamas

    Hi, I'm working on a project where I think ELSA could simplify our job tremendously. The system we are building will consist of a number of "dumb" applications and services, and there would be an application based on ELSA hopefully, that would like be the brains. It would work with a library of workflows, some of which would be started by user interaction, some scheduled, and most of them triggered by "higher level" workflows.

    What I could not figure out yet is how to do "fire and forget" style workflow triggering. Let's say I have a user triggered workflow, called DoStuff. DoStuff first need to do some preparations to get the system ready for the handing in, which takes up to a minute.

    Now the funny stuff is, this preparation might be done for other reasons as well (triggered by timer, for example). So when I'm in the DoStuff workflow, I would trigger the PrepareSystem workflow, which might be already running anyway. When I am waiting for the preparation to finish, I don't actually care what triggered that preparation, so in DoStuff I do not want to wait on the PrepareSystem that I triggered, I just want to fire and forget it, then halt until I get the PREPARED signal.

    Moreover, the system can only finish one "preparation" at a time (physical limitations of the machine). That means I have to proceed in DoStuff to allow the next preparation to finish. If I am waiting for the child workflow I triggered, and another preparation finishes before the one I am waiting on, that will lead to deadlock and a sad boss.

    Now whatever I've been trying to do so far, the parent workflow was always waiting for the child to finish before proceeding. I started the child with the TriggerSignal activity, but I also tried writing a custom activity for that.

    What would be the recommended approach for this?

    3 replies
    gztamas
    @gztamas
    So I do not mean to steal the whole thread here, but I'm wondering if someone has a suggestion. If I have three workflows in the same stage, waiting for something to happen, and I want only one to proceed (that was waiting for the signal for the longest of the three) when my signal arrives, what's the best way to do that? I can create a queue and get my workflows to send their correlation IDs, then get the thing that does the signaling to send the first correlation ID. But maybe my requirement is not so unique and there's an easier way to do this?
    gztamas
    @gztamas
    Also, when I'm using the TriggerSignal activity to spawn a "child" workflow, how do I pass input variables? I mean, what's the right Liquid or Javascript expression to define an instance of Variables? Something like {"foo": input("bar")}?
    Hicham Mounadi
    @hichammounadi
    Hello, I am working on a project [DEMO] with two technologies .NET Core [Backend] and AngularJS [Frontend] and I need Elsa Workflows on it.
    What I need exactly, Approve vacation request
    In companies when an employee wanna have a vacation
    User create the workflow[ the start of the workflow] which is must be approved by his superior ( the first activity ) and approved by the HR ( the last activity)
    wangadeketan
    @wangadeketan
    @sfmskywalker What is the next release data of Elsa workflow ?
    Hicham Mounadi
    @hichammounadi
    in other word could I get this https://workflowengine.io/demo/designer/
    gztamas
    @gztamas
    @hichammounadi I think you will have to think about it from a different perspective. I found this article by Sipke very much enlightening, and I think there will be some takeaways for you too. https://medium.com/@sipkeschoorstra/building-workflow-driven-net-core-applications-with-elsa-139523aa4c50
    gztamas
    @gztamas
    Hey, I understand I can set an output for the workflow in the Finish activity. But conceptually, how am I supposed to access that in let's say a different workflow (that triggered the one I'm setting the output for). Or is this just for the record (so that I can see when I check the workflow history)? Also, I still could not figure out how to pass a Variables instance in a JavaScriptExpression. None of the ways I'd format a dictionary as json seemed to work, (other then "{}" for the empty). I am already thinking about creating an expression evaluator just for this (oh, the horror!), but I hope someone here can provide a working example so it does not have to come to that.