# Array or JSON Object Process Variable

**URL:** <https://forum.flowable.org/t/array-or-json-object-process-variable/548>\
**Category:** Flowable Engine\
**Created:** [May 10, 2017, 2:46pm UTC](https://forum.flowable.org/t/array-or-json-object-process-variable/548 "2017-05-10T14:46:59Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![martin.grofcik](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/martin.grofcik/32/71_2.png) [@martin.grofcik](https://forum.flowable.org/u/martin.grofcik)\
**Post date:** [May 11, 2017, 6:25am UTC](https://forum.flowable.org/t/array-or-json-object-process-variable/548/2 "2017-05-11T06:25:27Z")

</div>

Hi,

the exception says:

```
org.flowable.engine.common.api.FlowableException: couldn't find a variable type that is able to serialize [object Array]
	at org.flowable.engine.impl.variable.DefaultVariableTypes.findVariableType(DefaultVariableTypes.java:62)
	at org.flowable.engine.impl.persistence.entity.VariableScopeImpl.createVariableInstance(VariableScopeImpl.java:863)
	at org.flowable.engine.impl.persistence.entity.ExecutionEntityImpl.createVariableInstance(ExecutionEntityImpl.java:531)
	at org.flowable.engine.impl.persistence.entity.VariableScopeImpl.createVariableLocal(VariableScopeImpl.java:784)
	at org.flowable.engine.impl.persistence.entity.VariableScopeImpl.setVariable(VariableScopeImpl.java:662)
	at org.flowable.engine.impl.persistence.entity.VariableScopeImpl.setVariable(VariableScopeImpl.java:654)

```

You can easily add new type support in ProcessEngineConfiguration.  
See `org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl#initVariableTypes`

```
public void initVariableTypes() {
    if (variableTypes == null) {
        variableTypes = new DefaultVariableTypes();
        if (customPreVariableTypes != null) {
            for (VariableType customVariableType : customPreVariableTypes) {
                variableTypes.addType(customVariableType);
            }
        }
        variableTypes.addType(new NullType());
        variableTypes.addType(new StringType(getMaxLengthString()));
        variableTypes.addType(new LongStringType(getMaxLengthString() + 1));

```

The example in the jUnit test is `org.flowable.examples.variables.VariablesTest#testBasicVariableOperations`

Regards  
Martin

---

_[View the full topic](https://forum.flowable.org/t/array-or-json-object-process-variable/548)._
