How to obtain process lists for inbox/outbox folders

For Inbox:

  • Create a WorkflowInbox table (Id, ProcessId, IdentityId).
  • Subscribe to ProcessStatusChanged event in WorkflowRuntime and run the following algorithm:
    • Delete all records from WorkflowInbox table for the current ProcessId.
    • Using GetAllActorsForDirectCommandTransitions, get IDs of all users who can execute periods in the current Activity.
    • Add the necessary records to WorkflowInbox table based on data from p. 2.2.
  • To get the list of incoming processes, filter the IdentityId field in the WorkflowInbox table.
  • To calculate the list of incoming documents, clear the WorkflowInbox table and call GetAllActorsForDirectCommandTransitions for every active process. If there are a lot of active processes, this operation may take a long time.

For Outbox:

A list of documents agreed upon by the user (or his assistant) can be obtained by filtering WorkflowProcessTransitionHistory table by ExecutorIdentityId and ActorIdentityId fields.

Top