Posted: 26 Jun 2017 8:26 EDT Last activity: 16 Oct 2018 12:03 EDT
Kill Interaction and activity in the middle
If I have an interaction manager in the main project connected to another interaction manager in project/adapter 2 and I have an activity running in project/adapter 2, how can I stop the activity and close the interaction properly when an user clicks a stop button (aka. stop interaction initiated in the main project)?
**Moderation Team has archived post**
This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.
On the InteractionManager component, there is a method called CloseInteraction that accepts one parameter (cancelRunningActivity). If you started your activities using the interaction key, then this will cancel them all in one shot.
If you are not using interaction keys with your activities, then there is a CancelActivity method on the InteractionManager component that accepts an integer. (workItemId). This value is what is returned when you call the StartActivity method. You can record that value as you start activities and then pass it into this method to cancel it.