OrchardCMS / OrchardCore

Orchard Core is an open-source modular and multi-tenant application framework built with ASP.NET Core, and a content management system (CMS) built on top of that framework.
https://orchardcore.net
BSD 3-Clause "New" or "Revised" License
7.37k stars 2.38k forks source link

Use ELSA-Core workflow #13652

Open MikeAlhayek opened 1 year ago

MikeAlhayek commented 1 year ago

Is your feature request related to a problem? Please describe.

ELSA-Core provides an improved UI for workflow. The implementation is very similar to OrchardCore so the change should not be dramatic.

https://github.com/elsa-workflows/elsa-core

MikeAlhayek commented 1 year ago

@sfmskywalker maybe you would be interested in creating this PR?

jtkech commented 1 year ago

The implementation is very similar to OrchardCore so the change should not be dramatic.

We would have to take care about what we have introduced like, as I remember, distributed locking and recursion checking.

hyzx86 commented 1 year ago

I tried that UI 2 years ago but it really worked. It's a long story Since all node positions are calculated automatically, it is very likely that changing one node causes many nodes to update synchronously, once. I dragged 90+ nodes. Then the page crashed I don't know if it has been fixed yet

I've been experimenting with ReactFlow recently

sfmskywalker commented 1 year ago

@MikeAlhayek You mean a PR for updating the Orchard Core's workflow designer with that of Elsa? Or replace its engine as well?

In any case, I am working on a small Orchard module that integrates Elsa 3. It works, but there are some challenges that I need to go through still:

  1. Colliding Monaco
  2. Elsa 3 uses FastEndpoints - how does it behave in a multi-tenant environment? I am considering moving the Elsa 3 endpoint implementations to mediator-like handlers, and then have the OC module expose its own set of API controllers and invoke these handlers (to maximize code reuse).
  3. CSS bleed - I need to add some CSS rules to prevent OC / Bootstrap styles from bleeding into the designer, which makes it looks not so attractive at the moment.
  4. The OC module, ideally, provides the same set of activities currently found in the OC Workflows module as well as other modules that take a dependency on the OC Workflows module. The downside here of course is that when users use the Elsa OC module, it might add many other modules as dependencies. But these arre just package dependencie; feature-wise, I would group them into separate startup classes.

Challenge number 4 would dissappear if the OC Workflows module would be updated to leverage the Elsa packages of course. Perhaps this might be an option once the Elsa OC module proves effective.

MikeAlhayek commented 1 year ago

@sfmskywalker we had a discussion about improving workflow in OC with @sebastienros. He mentioned ELSA. I like the UI used by ELSA as it provide better guidance during the design. I don't know all the differences between ELSA 3 and OC workflow. It's my understanding that the foundation/services are the same.
I think we would replace the OC package with ELSA as long as it does not break everything we already have implemented from activities and tasks.

Here are some things we can improve in OC It would be nice to have a starting point on the UI so it's more use friendly. The first node would exists asking the user to add first event to design the workflow.

image

Also, I think it would be nice if we can have some sort of activity dependencies like activity X would be applicable unless activity B happened. For example, you can't apply Form Validation task, before for submitting for task.

Having to stay on the same page when designing a workflow is nicer from a user perspective.

@sebastienros may have more feedback on weather we should depend on ELSA package or just design OC UI to match what ELSA is doing. But I think if the core components/services are the same, I would think using ELSA package may not be a bad idea.

sfmskywalker commented 1 year ago

It's my understanding that the foundation/services are the same.

In spirit, they are similar, but a lot has happened in the past 4 years or so ;)

as long as it does not break everything we already have implemented from activities and tasks.

It would break all existing workflow definitions and instances out there, unfortunately. V2 and V2 workflow definition schema are not 1-1 when compared to OC's workflow schema.

It would be nice to have a starting point on the UI so it's more use friendly. The first node would exists asking the user to add first event to design the workflow.

This is true. Elsa 3 doesn't have this anymore, but I'd like to add it back, even if only as a configurable option.

Also, I think it would be nice if we can have some sort of activity dependencies like activity X would be applicable unless activity B happened. For example, you can't apply Form Validation task, before for submitting for task.

That's a very neat idea, although I wonder about its feasibility. In Elsa, for example, you could have the "Form Validation" activity a few steps ahead of the "Form Submitted" event. And perhaps the user decided to have its own version of a "Form Submitted" event, and wants to use a dynamic expression in the "Form Validation" activity to validate. I might have misunderstood you, of course, and if not, I might simply be wrong.

Having to stay on the same page when designing a workflow is nicer from a user perspective.

💯

But I think if the core components/services are the same, I would think using ELSA package may not be a bad idea.

I'm afraid it would be a complete and total breaking change. Therefore, the best course of action might be to add it as a new module, allowing users the choice which one to use. And possibly, we can find a way to increase code reuse from existing OC activities as much as possibly.

One idea could be to have the existing activities start implementing Elsa interfaces. Another idea might be to have an Elsa Activity Provider that discovers the OC activities, return activity descriptors that delegate to the OC activity's functionality.

I'm working on a small PoC to explore this in more detail, here: https://github.com/elsa-workflows/elsa-orchard-core/tree/v3

MikeAlhayek commented 1 year ago

@sfmskywalker I think creating a module with a new UI would be good to have the option to choose which interface to use.

But, I think if ELSA 3 is actively being developed and maintained, it may make sense to use their component even if it comes with breaking changes. The benefit here would be that we can still provide powerful workflow in OC with Elsa community's support. You may want to join our triage call in about 50 mins and talk about it. I am sure @sebastienros will provide better feedback of the path of the project.

sfmskywalker commented 1 year ago

Sure, I'd be happy to attend today's call and discus this further. See you in a few minutes.

agriffard commented 1 year ago

Sure, I'd be happy to attend today's call and discus this further. See you in a few minutes.

No triage meeting today.

sfmskywalker commented 1 year ago

Alright, some other time then.

MikeAlhayek commented 1 year ago

Sorry that the meeting today was cancelled. Hopefully you can join our next meeting Tuesday 12PM PST or Thursday 10AM PST.

sfmskywalker commented 1 year ago

No worries! I’ll try and join the call next Tuesday.

hyzx86 commented 1 year ago

Having to stay on the same page when designing a workflow is nicer from a user perspective.

A JSON-based low-code front-end framework is recommended and should be useful for node configuration forms for the workflow module.

I've used it for several pages in OC and it works well with the OC style

Repository : https://github.com/baidu/amis

Document address (currently only in Chinese, it is recommended to use browser translation): https://baidu.github.io/amis/zh-CN/docs/index

Page editor demo: https://aisuda.github.io/amis-editor-demo/#/edit/0

image

hyzx86 commented 1 year ago

Sorry that the meeting today was cancelled. Hopefully you can join our next meeting Tuesday 12PM PST or Thursday 10AM PST.

Hi @MikeAlhayek Will there be a replay of the meeting?

MikeAlhayek commented 1 year ago

I am sure it'll be published soon. @Piedone do we know when we he previous meeting will be published?

Piedone commented 1 year ago

@domonkosgabor?

domonkosgabor commented 1 year ago

@MikeAlhayek After @sebastienros sends it to me. :D

hyzx86 commented 1 year ago

Thanks for sharing https://www.youtube.com/watch?v=bHN118JfaKk

MikeAlhayek commented 1 year ago

@sfmskywalker I just want to share some minor suggestions on the ELSA UI (which is bountiful already)

  1. Make modal dialogs scrollable so they don't overflow out of the screen.
  2. Make the list of activities buttons smaller to reduce the length. Maybe even reduce the margin-bottom on the buttons.
  3. In the Information section (bottom right), there is extra margin-bottom that you could remove to eliminate wasted real estate.
  4. In the workflow journal, maybe first column should be the event/activity name instead the time.
jeanbaptistedalle commented 1 year ago

Hi everyone, my company and I built our solution on OrchardCore and we are very enthusiastic about Elsa Framework, especially since we saw the demo made during Orchard Harvest 2023. We wish to know what is the current status of this milestone, if someone already works on it and if it's the case, who, to collaborate with him/her ? If that's not already launched, how we can contribute to add modules for Elsa Workflow ? That will be our first contribution on OrchardCore so we wanted to do it right ! I found the repo https://github.com/elsa-workflows/elsa-orchard-core on elsa-workflow but not very sure if something newer was already developed.

sfmskywalker commented 1 year ago

@MikeAlhayek Thank you for the great feedback! A lot has changed since you sent that message. More specifically, the entire dashboard has been redone with a Material Design library called MudBlazor. I would love to hear your feedback on that whenever you get a chance to try it out. The repo for Elsa Studio can be found here.

sfmskywalker commented 1 year ago

@jeanbaptistedalle As the author of Elsa Workflows, it makes me very happy to hear that you like it!

The Orchard Core integration module is currently of "proof of concept" quality. What remains to be done for it to be MVP is:

I am probably missing a few details, but I think these are the most crucial ones.

Please feel free to let me know if you want to hop on a call and talk through these things in more detail if you want!

hyzx86 commented 1 year ago

@sfmskywalker I found that Antv includes an xflow repository that has integrated some workflow interactions

https://xflow.antv.vision/zh-CN/docs/tutorial/solutions/flow image

sfmskywalker commented 1 year ago

@hyzx86 Awesome, thanks for pointing me to this!

MikeAlhayek commented 5 months ago

@sfmskywalker is there any traction on this? Last time I saw your demo and it was pretty close. If you don't mind, can you please share the current status. Are you still actively working on this?

sfmskywalker commented 5 months ago

Hi @MikeAlhayek , no work has been done since then, but it is still on my todo list.

MikeAlhayek commented 5 months ago

Hopefully your next call to ToDo.Dequeue() returns this task... at least before the 2024 Conference :) Thanks for the update