Process Request will run in the BP for each item passed in. You can use ap_SelectedItems or ap_Items.

protected override void am_BeforeProcessCommand(AB_Command command, RoutedEventArgs e)
        {
            // Access the Current Selected Entity
            //var selectedEntity = ap_SelectedEntity as AB_SystemEntity;
            //if (selectedEntity != null)
            //{
            //    var myVariable = selectedEntity.<Property>;
            //}

            switch (command.ap_CommandID)
            {
                //case "<CommandID>":

                //    Do Something ...

                //    set e.Handled to true to prevent the higher level from executing its command click logic and to prevent further processing by the Detail.
                //    e.Handled = true;

                //    break;

                case SharedEnums.CustomCommandIDs.CheckAll:
                    // Pass All Items - Process Request will run in the BP for each Item in the Datagrid
                    am_CallProcessCommandForDetailer(command, ap_DataPresenter.ap_Items, e);
                    e.Handled = true;

                    break;

                case SharedEnums.CustomCommandIDs.UncheckAll:
                    // Pass All Items - Process Request will run in the BP for each Item in the Datagrid
                    am_CallProcessCommandForDetailer(command, ap_DataPresenter.ap_Items, e);
                    e.Handled = true;

                    break;

                case SharedEnums.CustomCommandIDs.ExcludeAll:

                    break;

                default:
                    break;
            }

        }