Why can't the replacementActivity replace more than one cancelRequestedActivities?

I have a use case to dispatch the CancelRequested action to cancel all activities (more than one activity) and replace them with another. Besides, I have to make sure the DirtyHandling function works as expected (that’s why I dispatch the CancelRequested action).

However, A12 complains that it only accepts one cancelActivity for replacementActivity (both dirtyHandlingSaga and description of CancelRequested action in ActivityActions). Can we have any other approach to solve my case?

If you want to cancel multiple activities at once, I would group them under a common parent and then cancel that parent.

If you want to replace it then again with multiple activities, you need to do it one-by-one - we currently can’t easily create multiple activities in one action because several places in our code rely on one activitiy being created at a time.

My case would be I want to cancel multiple activities at once and replace them with only one activity. FYI: My cancel activities are under a common parent but I cannot cancel that parent.

The replacement activity was introduced so that you can replace an activity in a single state change. In your case, you cancel multiple activities, which will cause multiple state changes anyways, so you can simply create the new activity yourself using “wait for state change” and then push.

If you still would like to have this as a feature, please create a requirement ticket.