Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.Net: process framework - Simplest step implementation and simplification of Function event resolution for steps with 1 function. #9650

Merged

Conversation

joslat
Copy link
Contributor

@joslat joslat commented Nov 11, 2024

Motivation and Context

Required:
I would like to have a process framework with a simplified process and steps, showing how simple, easy and straightforward it can be. I want this example to take away the fear and reduce the cognitive load as a "first super-easy step".

Problem solved:
Excessive cognitive load on the first example. There Should be a super-easy step that is and feels easy. I believe this gets close to it :)

Scenario:
Learning, taking the fear out. Helping in making it easier.

Simplification added:
Also to simplify it even further i added the feature that the Function event name gets resolved when there is a single function
When declaring the process, instead of:

        startStep
            .OnEvent(StartStep.OutputEvents.Executed)
            .SendEventTo(new ProcessFunctionTargetBuilder(doSomeWorkStep));

        doSomeWorkStep
            .OnEvent(DoSomeWorkStep.OutputEvents.Executed)
            .SendEventTo(new ProcessFunctionTargetBuilder(doMoreWorkStep));

        doMoreWorkStep
            .OnEvent(DoMoreWorkStep.OutputEvents.Executed)
            .SendEventTo(new ProcessFunctionTargetBuilder(endStep));

        endStep
            .OnEvent(EndStep.OutputEvents.Executed)
            .StopProcess(); 

I would like to do the following:

      startStep
           .OnFunctionResult()
           .SendEventTo(new ProcessFunctionTargetBuilder(doSomeWorkStep));

       doSomeWorkStep
           .OnFunctionResult()
           .SendEventTo(new ProcessFunctionTargetBuilder(doMoreWorkStep));

       doMoreWorkStep
           .OnFunctionResult()
           .SendEventTo(new ProcessFunctionTargetBuilder(endStep));

       endStep
           .OnFunctionResult()
           .StopProcess();

So that the Function is inferred by the framework, reducing verbosity and cognitive load.

Fixes: #9647
Fixes: #9648

Description

  • Added example Step00 (process, steps )
  • Added documentation
  • Added the small refactoring on the StepProcessBuilder to support Function resolution when "there is only one"

Contribution Checklist

@joslat joslat requested a review from a team as a code owner November 11, 2024 20:23
@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code documentation labels Nov 11, 2024
@joslat
Copy link
Contributor Author

joslat commented Nov 12, 2024

@alliscode, @esttenorio this PR needs one more "green check" - would you do the honors? :)

@crickman crickman added PR: ready for review All feedback addressed, ready for reviews samples processes experimental Associated with an experimental feature labels Nov 12, 2024
@crickman crickman added this pull request to the merge queue Nov 15, 2024
@microsoft microsoft deleted a comment from joslat Nov 15, 2024
Merged via the queue into microsoft:main with commit 983da69 Nov 15, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation enhancement experimental Associated with an experimental feature .NET Issue or Pull requests regarding .NET code PR: ready for review All feedback addressed, ready for reviews processes
Projects
Status: Sprint: Done
4 participants