I have a simple asynchronous method:
@Asynchronous
public void doSomething(Promise<int> something) {
if(something == 0) {
return;
}
ActivityHolder.someActivity();
System.out.println("Current value: " + Integer.toString(something));
doSomething(something--);
}
This is what I’m doing to see if a certain requirement of mine is feasible or not. I essentially, want certain actions to be performed in batches, where members of each batch are run parallely. I essentially have another activity (in another class):
@Activity
public void someActivity() {
// Some stuff
}
The output i get is (I call doSomething with 100):
Current value: 100
After that, the workflow execution fails and gives me an error stating that the activity was not found. Why was it not found? How was it found in the first execution?
Couple of things:
When you pass a promise variable, you call
variable.get()on it to extract its value.If you are getting activity not found error, Did you check if this activity is actually registered? Run your activity classes first and see if they are running from the logs. Ensure that you have registered the activities successfully.
Code should have been something like this (using
Promise.asPromise()andpromise.get()):What is ActivityHolder here? Is it client implementation of the class containing someActivity()?