如何更改Camunda数据库以接受长字符串变量?

时间:2018-11-25 20:45:17

标签: java h2 bpm camunda

通过Camunda Engine传递长字符串变量(长度超过4000个字符)时,我遇到了一个问题。

enter image description here

是否仍然有必要更改camunda数据库以避免此异常,或者禁用默认的长字符串限制?

1 个答案:

答案 0 :(得分:1)

import org.camunda.bpm.engine.variable.Variables;
import org.camunda.bpm.engine.variable.Variables.SerializationDataFormats;

variableMap.put("Authorization", Variables
                              .objectValue(authorization)
                                  // tells the engine to use java serialization for persisting the value 
                              .serializationDataFormat(SerializationDataFormats.JAVA)  
                              .create());