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 8122139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T05:44:03+00:00 2026-06-06T05:44:03+00:00

I am working to create an app in which there are multiple stages- in

  • 0

I am working to create an app in which there are multiple stages- in the first stage there are multiple tasks to be executed in parallel…once all tasks of that stage have been completed, only then processing should go to next stage.

From what I read about deciders, deciders can choose from one of many possible options for the next stage.

But I want to go to next stage only when all parallel processes of current stage are complete.

Does this mean that I should set up each parallel process to invoke the next stage, and when the next stage is initialised, it should check if all parallel processes of previous stage are complete, and only then actually start processing? This will mean that all the parallel processes of first stage will invoke corresp. parallel processes of second stage, out of which only one will actually do processing (since this will be the process that finds that all processes of previous stage are complete).

Is there a better way of implementing this? So that the process of next stage is called only once?

  • 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-06T05:44:04+00:00Added an answer on June 6, 2026 at 5:44 am

    This can be solved using Promise objects returned by activities in flow framework.

    In your decider code, have a function for stage1 which will execute multiple activities in parallel each returning a Promise object. Add all these promise objects in a List<Promise<>> and pass this List to an asynchronous method which handles stage 2.

    Here is a sample decider code. stage1() executes three activities in parallel and calls asynchronous method stage2(@Wait List<Promise<Void>> promiseList). stage2 will not be started unless all the promises in promiseList are satisfied, i.e. unless all three activities in stage1 have completed.

    private void stage1() {
        List<Promise<Void>> promiseList = new ArrayList<Promise<Void>>();
        Promise<Void> promise1 = activityClient.activity1();
        Promise<Void> promise2 = activityClient.activity2();
        Promise<Void> promise3 = activityClient.activity3();
    
        promiseList.add(promise1);
        promiseList.add(promise2);
        promiseList.add(promise3);
    
        stage2(promiseList);
    }
    
    @Asynchronous
    private void stage2(@Wait List<Promise<Void>> promiseList) {
        activityClient.activity4();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on this tutorial , which shows how to create an app with
I am working on a Rails app that allows you to create a configuration
I'm working on a python app that uses the gdata to programmatically create and
I've create a Custom Object/Action/Aggregations for my app. https://graph.facebook.com/10151038251679973 All is working fine but
I'm trying to create a bulk edit page for an app that I'm working
First the problem: I'm working on the application that uses multiple FragmentLists within a
I'm working on a simple android app in which I want to, once the
I have been working on test framework, which creates a new app domain to
I did heroku create and pushed a working rails app to the server. Everything
I need to create a compass on an app i am working on. 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.