2.1. Working with BPM Entities

CUBA provides a handy way of working with the entities of the BPM data model: the BpmEntitiesService service. Its methods will simplify the following typical operations:

  • findProcDefinitionByCode() - finds the ProcDefinition by process definition code.

  • findActiveProcInstancesForEntity() - returns the list of ProcInstance entities by process definition code.

  • findActiveProcTasks() - returns the list of ProcTask instances available for the passed process instance and user.

  • findProcRole() - finds the ProcRole instance by process definition code and the process role code.

  • findActiveProcTasksForCurrentUser() - returns the list of ProcTask instances available for the passed process instance and the current user.

  • createProcInstance() - creates a new process instance, see [process_runtime_service_usage].