fix(config): implement config of scriptcompilation
refacor(persistence): extract PersistenceSession SPI

- extract PersistenceSession SPI for handling persistence operations
- DbEntityManager delegates to PersistenceSession for executing
  operations
- DbSqlSession is default Persistence SPI
- move SELECT operations to DbEntityManager
- refactor Schema Management

related to CAM-2602
chore(engine): cleanup Persistence SPI refactoring

- remove unused DbSchemeManager
- use selectById in CaseDefinitionManager
- add note that databaseSchemeUpgrade now always returns an
  empty string
- reenable test assertions

related to #CAM-2602
chore(engine): remove redundant casts
feat(caseInstanceId): caseInstanceId is propagated in BPMN

This commit adds the following features:

- it is possible to query for process instances with caseInstanceId
- all UserTask within this process instance get the caseInstanceId
- the given case instance id is propagated to sub processes and tasks
- it is also added to the existing history

related to CAM-2510 and fixes CAM-2609
feat(caseInstanceId/REST): expose propagated caseInstanceId in REST

related to CAM-2510
fix(engine/jobex): decrement job retries on exception during flush

Problem:

Currently the job retries are not decremented if a job fails with an
exception thrown during command context flush.
Examples of such exceptons are:
- optimistic locking exceptions
- database integrity constraint violations

Idenfified Cause:

The problem is that org.camunda.bpm.engine.impl.cmd.ExecuteJobsCmd has a
try/catch block around the execution of the job:

try {
  job.execute(commandContext);
} catch (...) {
  ... register listener on TX rollback
}

If an exception happens AFTER the catch block, the listener is not
registered.

Proposed fix:

Always register the transaction listener on rollback. This way it will
always be triggered if the transaction rolls back. If the transaction
succeeds, the listener is not triggered.

related to #CAM-2603
chore(persistence): throw exception on unexpected entity state

related to CAM-1971
fix(startActivity): set initialActivity on called sub process instance

related to CAM-2620
chore(typo): fix typo

related to CAM-2620
chore(REST): do not embed process definition
chore(engine): remove unnecessary semicolons
chore(HistoricTask/select): fix select statement by parameters

related to CAM-2510
Small fix in "testFilterByGroupNameLike.java"
feat(task): expose REST Api to create or update a task

related to CAM-2619
feat(task): connect new task with a case instance id

related to CAM-2374
feat(rest): embedded process definition, assignee and owner in task

related to #CAM-2608
test(engine): add failing test case for bug CAM-2636

related to CAM-2636
feat(engine): connect a process instance to a case instance on start

related to CAM-2370
fix(REST): provide null-check to avoid NullPointerException

related to CAM-2374