danielgerlag / workflow-core

Lightweight workflow engine for .NET Standard
MIT License
5.3k stars 1.19k forks source link

Bpmn posibility requirments #125

Closed Diaskhan closed 6 years ago

Diaskhan commented 6 years ago

Dear Daniel. I have a question could ure workflow be able to execute this kind bpmn diagram ? image

diagram.zip

1.The main problem is that workflow could be recursively. 2.Parallel gateway execution (when 2 human task must executes in parallel) 3.Exclusive gateway execution, by condition of variables execution flows to node when condition is true!

Could U guide me how it could resolved via Yure engine ?

Why i'am asking, because bpmn its real case in real life for workflow systems! That means if Ure engine could be able to execute bpmn, then about 90 % requirments of dev-users will be accomplished!

danielgerlag commented 6 years ago

Hi,

you can achieve recursion via the fluent API, like this:

var step1 = builder.StartWith<RandomOutput>(x => x.Name("Random Step"));

step1
    .When(data => 0).Do(then => then
        .StartWith<TaskA>()
        .Then(step1)
   )
    .When(data => 1).Do(then => then
        .StartWith<TaskC>()
        .Then<TaskD>()
   );

It works better with the JSON definition, because you could just point the next step to any previous step.

You can use .Parallel with .WaitFors inside to have 2 concurrent human tasks.

You can use the ExecutionResult.Outcome(...) within your steps to pass a value that the workflow can make a decision on using the .When(data => ...) method

Diaskhan commented 6 years ago

Could u fully describe all process? It really hard to understand notation !

Miggleness commented 6 years ago

@danielgerlag is BPMN part of your vision for this library?

The appeal of WorkflowCore is its simplicity and adding BPMN notation support would definitely require remodeling the core and a bit of APIs which needs more thinking and checking out of other implementations which mostly are in the Java world (Camunda, jBPM, Flowable).

It'll need commitment from other contributors, too so there has to be significant demand in the .NET space.

I suggest to close this and instead focus on a simple diagramming feature.

Diaskhan commented 6 years ago

@Miggleness in my vision there have few bpmn engines, mot fully cover requrments!

https://github.com/lafar6502/NGinnBPM https://github.com/roger-castaldo/BPMEngine https://github.com/aiska/BpmNet https://github.com/peterwidmer/DotBpm

but its some kind pet project!

My thoghts is to write bpmn flow engine from zero! Dont have any other ideas!

This flow could not be adopted in future to bpm reqirments!

Miggleness commented 6 years ago

I was on the same boat as you. Just figured out that my company doesnt really need bpmn.

Diaskhan commented 6 years ago

@Miggleness look at camunda bpm, sounds promising !

igor-betin commented 4 years ago

With ExpandoObject for Inputs and Outputs in definition, and with IParameter made of deleagtes in in-memory reporesentation, any markup to workflow/steps mapping is going to be painful Bumping to stress this issue

That Conductor server will not be of any use until a good markup format with deserialization AND serialization is supported, mark my words. And subworkflows.

bibo4 commented 3 years ago

Seeing as WorkflowCore has a domain specific language in JSON\YAML formats and BPMN 2.0 has a well define specification in XML format, it sounds quite possible to create a translator that can translate between these format which can then unlock lots of possibilities