It can be saved by jBPM if it is serializable. Other options will be worked out in future releases of jBPM.
Neat. As I read at the documentation it's likely that I should be able to save as an Hibernate entity, but Serializable is good enough for the time being.
Nevertheless, when I make it Serializable it gets stored but it can't be loaded, taskService.getVariables throws the following exception:
org.jbpm.api.JbpmException: couldn't deserialize object (...) org.jbpm.api.JbpmException: couldn't deserialize object Caused by: java.lang.ClassNotFoundException
I'm trying to deploy the .class file inside a .bar or .jar together with the jpdl and deploying it with createDeployment() .addResourcesFromZipInputStream(zip), but the class won't get deployed.