processEngine.getCaseService().
The CaseService offers two API variants. One is in the following referred to as the classic API, since it is very similar to the API offered by the RuntimeService for BPMN processes. The fluent API follows a different concept in that it allows composition of case service commands by method chaining.
Classic and Fluent API by Example
As an example, theCaseService offers two classic methods to manually start a task:
Entry Points to the Fluent API
The fluent API can be used to work with case definitions and case executions. The entry points are as follows:caseService.withCaseDefinition(caseDefinitionId): Offers interactions on the case definition that has the provided id, such as creating a new case instance.caseService.withCaseDefinitionByKey(caseDefinitionKey): Offers interactions on the case definition that has the latest version of those that have the provided key.caseService.withCaseExecution(caseExecutionId): Offers interactions on case executions, such as starting and completing tasks.