I’m not sure I understand the question. You can invoke an activity synchronously. Then when the activity invokation returns then the activity is completed (which internally corresponds to ActivityTaskCompleted event). You can invoke an activity asynchronously in this case the activity completion causes its Promise to become ready.
Sorry for the confusion, let me clarify my question.
We have below workflow class
//Workflow Method
public void startWorkflow(){
runStepOne();
Workflow.Wait(()->signalToStartStep2);
runStepTwo();
runStepThree();
}
//Signal Method
public void startStep2(){
this.signalToStartStep2 = true
}
And there is a RestController to recieve signal like below.
public class RestController{
public boolean startStep2(){
myWorkflow.startStep2();
// Block here to wait the StepTwo activity real completed.
}
}
We are looking for a way to get the activity status in RestController.StartStep2 method.
Once the activity run to success, then back true to the API caller.
Any advice? Can we subscribe the ActivityComplated event in RestController?
We do plan to support this feature. But it is a nontrivial project which is going to take a while to design and implement. So don’t rely on its availability any time soon.