I was wondering if there is a way to grab data while an activity is running? For example, let’s say i have a workflow that runs an activity that makes multiple external service calls. Is it possible to pass back status that is returned by one of the external calls while the activity is still running back to the workflow. In this case, the workflow would have a query method to report this data back to the user.
Let’s say the activity is a blocking call that starts something and then poll for status for completion. In the first request to start it, the external service returns data. I want to be able to access that data from a query method while its still running.
I think there are two possible ways
setContextPropagateand pass the object into the activity. Within the activity, i would store the value in that object.
- In the activity, I signal the workflow with the updated value.
- Is there an another way or recommended way?
- If you go with the
setContextPropagatemethod, Is there an example of how you get that object in the activity. I can’t find any code example for this.