Analytics Public API for Business Users 
You can use the BPM analytics public API (AnalyticsManager, com.sap.bpm.analytics.api) to obtain analytics information for business process administrators and business task administrators. You can display statistics pertaining to processes, tasks, and events.
To be able to use this API, the current user must be a business process administrator or/and a business task administrator for any active instance on the system. The archived instances are not taken into account.
The statistics provided by this interface includes only the process instances for which the logged in user is assigned as one of the business process administrators and the task instances for which the logged in user is assigned as one of the business task administrators.
For a detailed description of the BPM public APIs, see http://help.sap.com/javadocs/ (under ).
You have added the necessary dependencies to development component tc/bpem/facade/ear (public part api) in software component BPEM-FACADE.
You have ensured that your user is a Business Process Administrator and/or a Business Task Administrator or a super user with DISPLAY_ALL permission.
Get count of active process instances based on status
Returns the ProcessStatusStatistics elements that encapsulate ProcessModel details and the number of active process instances for a given status and duration.
Syntax
List<ProcessStatusStatistics> getProcessStatusStatistics(Date startTime, Date endTime, Set<ProcessStatus> statuses, int maxNoOfProcessModels) throws BPMException
Get duration of active process instances based on status
Returns the ProcessDurationStatistics elements that encapsulate ProcessModel details and the duration of active process instances for a given status and duration.
Syntax
List<ProcessDurationStatistics> getProcessDurationStatistics(Date startTime, Date endTime, ProcessStatus status, int noOfTopProcessModels) throws BPMException
Get count of active task instances based on status
Returns the TaskStatusStatistics elements that encapsulate TaskModel details and the number of active task instances for a given status and duration.
Syntax
List<TaskStatusStatistics> getTaskStatusStatistics(Date startTime, Date endTime, Set<Status> statuses, int noOfTopTaskModels) throws BPMException
Get duration of active task instances based on status
Returns the TaskDurationStatistics elements that encapsulate TaskModel details and the duration of active task instances for a given status and duration.
Syntax
List<TaskDurationStatistics> getTaskDurationStatistics(Date startTime, Date endTime, Status status, int noOfTopTaskModels) throws BPMException
Get count of events
Returns the EventStatistics elements that encapsulate EventType details and the number of active occurrence of specified EventType for a given duration and interval.
Syntax
List<EventStatistics> getEventStatistics(Date startTime, Date endTime, Set<EventType> events, long intervalInMilliSeconds) throws BPMException
Get count of processes in error
Returns the number of all active process instances in error.
Syntax
int getCountOfProcessesInError() throws BPMException
Get count of tasks escalated
Returns the number of all active task instances in escalated state.
Syntax
int getCountOfTasksEscalated() throws BPMException
Get count of tasks in error
Returns the number of all active task instances in error.
Syntax
int getCountOfTasksInError() throws BPMException
Get count of tasks without owner
Returns the number of all active task instances without actual owner.
Syntax
int getCountOfTasksWithoutOwner() throws BPMException