When to use state vs return type in Process framework? #12273
Answered
by
esttenorio
hansmbakker
asked this question in
Q&A
-
In the Process framework, process steps can have stronly-typed state. Also, their logic is implemented using I couldn't find a clear explanation in the samples when to return an object from the |
Beta Was this translation helpful? Give feedback.
Answered by
esttenorio
May 29, 2025
Replies: 1 comment 2 replies
-
@esttenorio Can you help here? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @hansmbakker, return ->
OnFunctionResult
is recommended when your function only returns the same object type when executed [no conditional logic or complex logic that may need to branch out to different process paths]Making use of
EmitEventAsync
allows custom mapping of events from a same function. Example:correctlyGeneratedObject
andreasonsObjectFailedToBeGenerated
can be different object types and yet be emitted by the same function. If usingonFunctionResult
probably a struct with …