I would like to ask about the development of a "workflow merger". I have several workflows that are not very similar to each other. However, sometimes I want to combine them, slightly modifying them. Let me give you an example:
Workflow 1 - Shutdown
A1 (pack the bag) β A2 (leave the house) β A3 (catch the bus) β A4 ...
Workflow 2 - Daily Watering of Plants
B1 (turn on the water) β B2 (leave the house) β B3 (plant water) β B4 (enter the house) β B5 (turn off the water)
On Sunday I want to go on a trip, and I also need to water the plants. So I want to create something like A1 β B1 - B5 β A2 .... I also want to be able to tell my friend to finish watering, which would be something like A1 β B1 to B2 β C1 (transfer the task to a friend) β A3 ... As you can see, the flow is simple - there are no plugs and connections in it, and I donβt need such functions. All I need to do is create a linear list of commands with the ability to easily merge them. All code fragments are Java methods at the moment (and I would like to make them something like atomic threads).
The main goal of my approach is to avoid entering the same code again and again. A stream can have hundreds of steps. I would like to make an expression like Run thread A, but instead of starting A2 and A3, do B2 to B6 and continue with A.
I have two main questions:
- Is there any infrastructure that already supports this? If so, is it not too difficult for my purpose?
- If not, what would be the best way to implement such a thing?
Note. Could you indicate what is so incomprehensible in my question?
source share