Increase the Default Process Variable Size in jBPM
In this article, see how to increase the default process variable size in jBPM.
Join the DZone community and get the full member experience.
Join For FreeProcess variables in jBPM are limited to 255 characters by default. The number of characters in turn are also dependent on the character set that is being followed. So, it is always better to have an option to increase the default value.
This article is just an extension of the solution provided in the above link; simplifying things a little more for beginners.
To increase the variable size, two configuration changes are needed to be one.
Change the Column Data Type in jBPM Database
Variable information is stored in “VariableInstanceLog” table in jBPM database. Find the table in the jBPM schema and increase the VARCHAR size of the column “value” to the desired size (lets say 20000)
Ask jBPM to Use the New Size
Even if we increase the size of the value column in the database, jBPM will still truncate any value bigger than 255 before saving it to the database. We need to set the following system property to let jBPM know the new size.
-Dorg.jbpm.var.log.length=20000
where 20000 is the desired size of the variable value.
As jBPM includes ant script to start the jboss (now wildfly) server, we can configure the system property in the standalone.xml file. ant task will read this file and set the system properties while starting the server.
To do this, open standalone.xml file located in the jBPM configuration directory and open it with a text editor. Look for target by name and add the following line under the exec tag along with the other properties.
xxxxxxxxxx
<property name="org.jbpm.var.log.length" value="20000"/>
The final exec tag should look like the following under standalone.xml target.
xxxxxxxxxx
<system-properties>
<property name="org.jbpm.var.log.length" value="20000"/>
</system-properties
Opinions expressed by DZone contributors are their own.
Comments