test(engine): set variable twice with different types that overlap

failing testcase for CAM-2548
feat(engine): serialize java obects as json by default

- introduces a new variable type
- exclusive option: either objects are serialized with standard java
  serialization or the newly introduced json serialization is used
- temporarily uses latest Spin snapshot

related to CAM-2433
feat(engine): match serialization format by name

related to CAM-2433
feat(engine): write json-serialized java objects to history

related to CAM-2433
test(engine): test caching of data format variable type values

related to CAM-2433
feat(engine): implement #getRawValue for all variable types

related to CAM-2433
chore(engine): hide serialization specifics from public API

- exposing serialized values of variables is part of another ticket CAM-2544
  so the way of exposing serialized variable values may change

related to CAM-2433
chore(engine): make Spin dependency optional

- removes the 'hard' dependency on Spin classes
- if Spin is not on the classpath, corresponding serialization formats will
  not be available

related to CAM-2433
chore(upgrade): add new variable fields to upgrade scripts

related to CAM-2433
chore(engine): type name for object of SpinSerializationType

related to CAM-2433
feat(engine): engine config option for Serializable variable format

- setting 'defaultSerializationFormat' to 'java serializable' will use the
  variable type SerializableType (which is the also the default behavior when
  this option is omitted

related to CAM-2433
test(engine): test default serialization config

related to CAM-2433
chore(engine): remove variable configuration field

- reuses TEXT_VALUE2_ field for storing configuration
- reduces DATA_FORMAT_ID_ field size to 64

related to CAM-2433
chore(engine): add additional fields to persistent state of variables

related to CAM-2433
added long term result file including docs

refactoring to run jbpm processes in a dependent project

spell correction
fixed shell command for long term results
feat(case/listener): provide listener on tasks and case executions

This commit provides an infrastructure for listeners:

- CaseExecutionListener and
- TaskListener

This infrastructre gives the possibility to add some custom code when a
state transition occured on a CaseExecution (ie. CaseExecutionListener) or a property changed on a
HumanTask (ie. TaskListener).

CaseExecutionListener:

- CaseExecutionListeners which will be notified when a state transition
  happens on a CaseInstance

    <case ...>

      <casePlanModel ...>

        <extensionElements>
	  <camunda:caseExecutionListener event="complete"
             class="MyCaseExecutionListener" />

	  <camunda:caseExecutionListener event="close"
	     delegateExpression="${myCaseExecutionLsitener}" />

	  <camunda:caseExecutionListener event="create"
	     expression="${myListener.notify(caseExecution,
               	             caseExecution.eventName)}" />

          <camunda:caseExecutionListener>
            <camunda:script scriptFormat="groovy">
	      your groovy script
	    </camunda:script>
	  </camunda:caseExecutionListener>

        </extensionElements>

        ...

      </casePlanModel>

    </case>

- CaseExecutionListeners which will be notified when a state transition
  happens on a CaseExecution (which is associated with a Task -
  HumanTask, CaseTask or ProcessTask; or a Stage)

    <case ...>

      <casePlanModel>

        <planItem id="PI_1" definitionRef="HumanTask_1 />

        <humanTask id="HumanTask_1">

          <extensionElements>

            <camunda:caseExecutionListener event="complete"
               class="MyCaseExecutionListener" />

            <camunda:caseExecutionListener event="close"
               delegateExpression="${myCaseExecutionLsitener}" />

            <camunda:caseExecutionListener event="create"
               expression="${myListener.notify(caseExecution, caseExecution.eventName)}" />

            <camunda:caseExecutionListener>
              <camunda:script scriptFormat="groovy">
                your groovy script
              </camunda:script>
            </camunda:caseExecutionListener>

          </extensionElements>

        </humanTask>

      </casePlanModel>

    </case>

Note: If no "event" is given, the provided CaseExecutionListener will be
notified on each state transition that can happen on a corresponding
CaseExecution.

TaskListener:

- a TaskListener can only be provided on a HumanTask

  <humanTask ...>

    <extensionElements>

      <camunda:taskListener event="create" class="MyTaskListener" />

      <camunda:taskListener event="assignment"
         delegateExpression="${myTaskListener}" />

      <camunda:taskListener event="complete"
         expression="${myListener.notify(task, task.eventName)}" />

      <camunda:taskListener>
        <camunda:script scriptFormat="groovy">
          your groovy script
	</camunda:script>
      </camunda:taskListener>

    </extensionElements>

  </humanTask>

Note: If no "event" is given, the provided TaskListener will be notified
on each transition (create, complete, assignment or delete) on a Task.

related to CAM-2239, CAM-2555
feat(rest/hal): provide initial HAL representation of tasks

Provide

(1) GET /task          accept:application/hal+rest
(2) GET /task/id       accept:application/hal+rest

Requests in engine-rest.

The response body contains a single task (1) and a list of tasks (2)
in HAL (Hypertext Application Language) representation.

related to #CAM-2550
feat(engine): provide formKey as property of Task

provide Task.getFormKey() as simple way to get the form key for a task.
Previously an additional service call to the Form Service was necessary.

NOTE: the form key is only populated if taskQuery.initializeFormKeys() is called:

    // if initializeFormKeys() is called
    Task task = taskService.createTaskQuery()
      .processInstanceId(processInstance.getId())
      .initializeFormKeys()
      .singleResult();

    // then the form key is present
    assertEquals("exampleFormKey", task.getFormKey());

    // if initializeFormKeys() is not called
    task = taskService.createTaskQuery()
      .processInstanceId(processInstance.getId())
      .singleResult();

    // then the form key is present
    assertNull(task.getFormKey());

related to #CAM-2568
chore(engine): Task.getKey() throw exception if not initialized

task.getFormKey() now throws an exception if the form key has not
been initialized.

related to #CAM-2568