-
Notifications
You must be signed in to change notification settings - Fork 53
feat: add sub worflows run on FuncDSL #1295 #1299
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -39,6 +39,7 @@ | |||||
| import io.serverlessworkflow.fluent.spec.ScheduleBuilder; | ||||||
| import io.serverlessworkflow.fluent.spec.TimeoutBuilder; | ||||||
| import io.serverlessworkflow.fluent.spec.configurers.AuthenticationConfigurer; | ||||||
| import io.serverlessworkflow.fluent.spec.configurers.WorkflowConfigurer; | ||||||
| import io.serverlessworkflow.fluent.spec.dsl.DSL; | ||||||
| import io.serverlessworkflow.fluent.spec.dsl.UseSpec; | ||||||
| import io.serverlessworkflow.impl.TaskContextData; | ||||||
|
|
@@ -1072,6 +1073,30 @@ public static FuncTaskConfigurer set(Map<String, Object> map) { | |||||
| return list -> list.set(s -> s.expr(map)); | ||||||
| } | ||||||
|
|
||||||
| /** | ||||||
| * Create a {@link FuncTaskConfigurer} that adds a workflow subflow task. | ||||||
| * | ||||||
| * @param configurer configurer for the nested workflow task | ||||||
| * @return a {@link FuncTaskConfigurer} that adds a workflow task to the tasks list | ||||||
| */ | ||||||
| public static FuncTaskConfigurer workflowTask(WorkflowConfigurer configurer) { | ||||||
| Objects.requireNonNull(configurer, "configurer"); | ||||||
| return list -> list.workflow(configurer); | ||||||
| } | ||||||
|
|
||||||
| /** | ||||||
| * Create a {@link FuncTaskConfigurer} that adds a workflow subflow task. | ||||||
| * | ||||||
| * @param configurer configurer for the nested workflow task | ||||||
| * @return a {@link FuncTaskConfigurer} that adds a workflow task to the tasks list | ||||||
| * @deprecated use {@link #workflowTask(WorkflowConfigurer)} to avoid ambiguity with spec-side | ||||||
| * workflow factory methods | ||||||
| */ | ||||||
| @Deprecated | ||||||
|
||||||
| @Deprecated | |
| @Deprecated(since = "<version>", forRemoval = false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whats the point of adding a new function that is also deprecated???
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This implementation builds a separate spec
TaskItemListBuilder, then builds a list only to extract a singleTaskItem. That indirection adds unnecessary complexity and allocation, and also makes failures harder to diagnose. Prefer constructing the workflow task item directly (e.g., build aWorkflowTaskBuilder, applyitemsConfigurer, then add a singleTaskItem), and if you keep the current approach, includenamein the exception message to improve debuggability.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what are we trying to do here?