Note that there are some explanatory texts on larger screens.

plurals
  1. POActiviti custom variable type issue
    primarykey
    data
    text
    <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>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload