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

Executing workflows dynamically using Java SDK #27

Closed
wants to merge 6 commits into from

Conversation

saksham2105
Copy link

@saksham2105 saksham2105 commented Jul 5, 2024

We will dynamically form this JSON based on mediation rules

(Check the input of this Workflow those will be our mediation rules ,based on this .We will dynamically form workflow)

https://events-test.orkesconductor.io/execution/408b97d4-3dfa-11ef-a272-ea44bab73e42

Changes in this PR :

Created Necessary Pojo classes for Mediation Rules

Added a Simple worker to execute an another workflow named dynamic_workflow and pass input to this workflow as WorkflowDef. We generated workflowDefinition using createDynamicSubworkflow() method which is basically a dynamic definition of subworkflow which we want to execute. If you check there is no workflow with definition dynamic_subworkflows_series exist ,since this subworkflow will be executed dynamically without definition. We can added as many steps in createDynamicSubworkflow() as we want and make the dynamic_subworkflows_series dynamic.

Sample executions : https://play.orkes.io/execution/abf1fac4-3a1d-11ef-9236-1aff359c3247

Check this execution and keep on expanding subworkflows in this workflow and the child workflows as well.

Note : I have changed some naming convention, workflow and variable names in code for readability

Screenshot :-
All_quest_subworkflows_series

@saksham2105 saksham2105 changed the title Dynamic workflow Executing workflows dynamically using Java SDK Jul 5, 2024
@jmigueprieto
Copy link
Contributor

@saksham2105 - I think that an example of "Executing workflows dynamically using Java SDK" might be great but I'm not sure if this is the place for it.

Also, the subworkflow created in DynamicSubworkflowWorker is too specific and complex for an example.

Copy link
Contributor

@jmigueprieto jmigueprieto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great but IMHO it's not a good "sample worker".

We should review it and simplify it.

@saksham2105 saksham2105 deleted the dynamic-workflow branch July 10, 2024 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants