title: Activiti custom variable type issue
body: <p>In Activiti all complex objects are serialized and stored in database using Java serialization. I wish to override this behavior for my custom types and store the objects as JSON. This shall help me to have more control over the persisted object.</p>
  
  <p>I have created my custom VariableType to do this. Below is the snippet</p>
  
  <pre class="lang-java prettyprint-override"><code>public class CustomVariableType extends ByteArrayType{
  // overrided all the needed method.
  }
  </code></pre>
  
  <p>These types are configured in activiti configuration impl as below:</p>
  
  <pre class="lang-java prettyprint-override"><code>public class WorklistConfigurationService {
  
      private ProcessEngineConfigurationImpl processEngineConfigurationImpl;
      private List&lt;CustomVariableType&gt; customVarsTypes;
      public void init(){
          logger.debug("inside init");
          for(VOVariableType varType : voVars){
              logger.debug("adding type {}", varType.getTypeName());
              processEngineConfigurationImpl.getVariableTypes().addType(varType, 0);
          }
      }
     // getter and setters...
  }
  </code></pre>
  
  <p>Below is how I am injecting values to above in Spring</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration"&gt;
          &lt;property name="dataSource" ref="dataSource" /&gt;
      &lt;/bean&gt;
      &lt;bean id="worklistConfigurationService"
          class="...WorklistConfigurationService" init-method="init"&gt;
          &lt;property name="customVarTypes"&gt;
              &lt;list&gt;
                  &lt;bean id="var1" class="...CustomVariableType"&gt;
                      &lt;constructor-arg type="java.lang.String" value="custom" /&gt;
                      &lt;constructor-arg type="java.lang.Class"
                          value="..CustomType" /&gt;
                  &lt;/bean&gt;
              &lt;/list&gt;
          &lt;/property&gt;
          &lt;property name="processEngineConfigurationImpl" ref="processEngineConfiguration" /&gt;
      &lt;/bean&gt;
  </code></pre>
  
  <p>But the new serialization mechanism is never used by activiti engine. Instead it is always default serialization which is used. Can someone help in getting this resolved.</p>