Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8697471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:32:03+00:00 2026-06-13T01:32:03+00:00

I’d like to ask about designing workflow merging. I’ve got several workflows that aren’t

  • 0

I’d like to ask about designing “workflow merging”. I’ve got several workflows that aren’t very similar to each other. However, sometimes I want to combine them modifying them very slightly.
Let me give you an example :

Workflow 1 – Trip

A1 (pack the bag) -> A2 (leave the house) -> A3
(catch the bus) -> A4 …

Workflow 2 – Daily plant watering

B1 (turn the water on) -> B2 (leave the house) -> B3 (water the plants) -> B4 (enter the house) -> B5 (turn the water off)

On Sunday, I want to go for a trip and I need to water the plants too. So I want to create something like A1 -> B1 to B5 -> A2… . I also want to have possibility to tell my friend to finish the watering, which would be something like A1 -> B1 to B2 -> C1 (pass the task to a friend) -> A3 …
As you can see, the flow is straightforward – there are no forks and joins in it and I don’t need such functionality. All I need is to create a linear list of commands with possibility to merge them together easily. All fragments of code are Java methods at the moment (and I’d like to make them something like atomic flows).

The main goal of my approach should be avoiding typing the same code over and over again. The flow may have hundreds of steps. I’d like to make a statement like Execute flow A, but instead of running A2 and A3, execute B2 to B6 and continue with A.

I’ve got two major questions :

  • Is there any framework that already supports this? If there is, isn’t it too complex for my purpose?
  • If not, what would be the best way to implement such thing?

Note : Can you please specify what is so unclear about my question?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T01:32:04+00:00Added an answer on June 13, 2026 at 1:32 am

    I personally feel that the requirement can be implemented without the use of any specific framework. You could design the application as follows :

    1. TaskPerformer : An interface with a method named performTask. Represents a Task to be performed.

    2. BagPackTask : A concrete class that implements TaskPerformer. Also defines the performTask method that contains code for packing a bag.

    3. WaterPlantsTask : Another concrete class that implements TaskPerformer. Also defines the performTask method that contains code for watering plants.
      Similarly, you have one class per task that implements Taskperformer and defines the behavior for the task using the performTask method.

    4. Workflow : A class that will be used for executing two or more tasks and will allow you to mix and match existing tasks. The class will contain a List of TaskPerformer and the constructor for this class will have a List parameter to ask for Tasks to execute. The class will contain an executeWorkflow method that will iterate over the List and call the performTask method of each element in the list. In other words, this class can be used to execute all the tasks passed to its constructor during instantiation by using its executeWorkflow method. It is important to note that the order in which you insert elements in the list is the order in which the tasks will be executed.

    Using this approach, you eliminate the need to have any if-else conditions to determine what task to perform. You can reuse your TaskPerformer implementations in how many ever Workflow instances as you wish. You get a super clean design. Let me know if you need any clarifications since I feel that this design should solve your problem. It would be a good idea to clarify all your doubts before accepting any answers 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a string that has curly quotes in it. I'd like to replace
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am reading a book about Javascript and jQuery and using one of the
I would like to run a str_replace or preg_replace which looks for certain words
I am trying to render a haml file in a javascript response like so:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.