1

I have an activity(say actN) that is dependent on N number of activities. All the N activities are executed in parallel. After the completion of all the activities i want to execute activity actN. I want to do this without using any @Asynchronous annotation as @Asynchronous tag is not working for me.

public Promise<Integer> executeLastactivity(List<Promise<Integer>> prm){

//TODO


}  
Rahul
  • 33
  • 7
  • I think the real question is, why isn't `@Asynchronous` not working? Are you sure that you are running/compiling your code correctly? – mkobit Dec 11 '14 at 01:32

1 Answers1

1

The parameter of any type that extends Collection should be annotated with @Wait. It is necessary because the Flow framework relies on Java reflection to determine if type of the argument is Promise. But Java doesn't expose generic types through reflection.

So your method signature should look like:

@Asynchronous
public Promise<Integer> executeLastactivity(@Wait List<Promise<Integer>> prm){

//TODO

} 
Maxim Fateev
  • 6,458
  • 3
  • 20
  • 35
  • 1
    Another option is to use [`Promises.listofPromisesToPromises(List> promises)`](http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/simpleworkflow/flow/core/Promises.html#listOfPromisesToPromise(java.util.List)) and then you just have a single `Promise>` as your input. – mkobit Nov 19 '14 at 07:23