How to invite/get all users who can approve a document

For example you have Transition A -> B and you need to notify users which can approve (or reject) a document in Activity B. You have two options to do that.

1st option:

To notify users who can do something with your document in Activity B. You need to put a notification code to Activity B. Use Code Actions or IWorkflowActionProvider to do that. When you execute a transition from A to B, the implementation of Activity B will be executed.

2nd option:

You can write code that determines and notifies respective users in ProcessStatusChanged or ProcessActivityChanged (in versions >= 1.5.5) event handlers.