Complex User Types as Process variables

1,132 views
Skip to first unread message

Michael Grom

unread,
Jun 20, 2013, 10:17:22 AM6/20/13
to camunda-...@googlegroups.com
Dear Community,

I found to my dissatisfaction that one could well store a (serializable) complex user type as a process variable, i.e. when calling a service task, but retrieving this complex type object is virtually impossible. I'm using a custom task list and while accessing the process variable holding the complex user type, the engine fires and exception with ClassNotFound as the root cause. I've found a posting here dealing with the same problem, however, I wonder if this is going to be changed in the future or if there is a workaround for this.
The application is running as an independend Web application on GF3, using the shared process platform and the DefaultEjbProcessApplication. The complex user type is a dto class for a JAX-WS client called from the same application. Getting a reference to the ProcessApplication and using Context.executeWithinProcessApplication did not help (not that I have fully understood the effect of this method call ;-) )

Background:
According to my feeble knowledge about camunda-bpm, the task lacks a dynamic description that could, for example, be created from process variables. I've put some homebrew expressions referencing process variables in the <documentation> tag of the UserTask which I then retrieve using task.getDescription(), resolve the expressions and return them to the JSF page. Now the process variables are not always primitives or standard java types.

Fix or workaround greatly appreciated :-)

kind regards
Michael



Daniel Meyer

unread,
Jun 20, 2013, 11:04:41 AM6/20/13
to camunda-...@googlegroups.com
Hi Miachael,

we will provide support for Serializable variables: https://app.camunda.com/jira/browse/CAM-907

The issue is scheduled for the next alpha release.

Cheers,
Daniel

Daniel Meyer

unread,
Jun 29, 2013, 12:39:24 AM6/29/13
to camunda-...@googlegroups.com

gnt...@googlemail.com

unread,
Oct 11, 2013, 7:18:12 AM10/11/13
to camunda-...@googlegroups.com
Hello Daniel,

I also added an object of a serializable class (here DataObjectHelper) as a process variable, see:

processVariables.put("data", new DataObjectHelper(requestNumber, documentNumber));
ProcessInstance processStarted = getRuntimeService().startProcessInstanceByMessage(
MESSAGE_BARCODE_GESCANNT, requestNumber, processVariables);

This code is called within doGet() of a servlet deployed and running on the standard Tomcat environment as downloaded from the camunda website. I did it without Spring integration. The camunda BPM version 7.0.0-Final is used.

After the process start the process is waiting in a user task having a task form. Fetching it with the camunda tastlist application from the inbox (action ‘start to work on task’) shows the following stack trace (Class not found execption) and all values in the task form are empty (the data object itself is not referenced in the task form).

Is there any further need for configuration (class path?) so the DataObjectHelper class is found, or is this a bug?

Thanks for answer,
Günter

11.10.2013 12:35:11 org.camunda.bpm.engine.rest.exception.ExceptionHandler toResponse
WARNUNG: java.lang.ArrayIndexOutOfBoundsException: 25
at java.util.ArrayList.add(ArrayList.java:352)
at org.jboss.resteasy.core.ResourceMethod.<init>(ResourceMethod.java:107)
at org.jboss.resteasy.core.ResourceMethodRegistry.processMethod(ResourceMethodRegistry.java:276)

11.10.2013 12:39:46 org.camunda.bpm.engine.impl.interceptor.CommandContext close
SCHWERWIEGEND: Error while closing command context
org.camunda.bpm.engine.ProcessEngineException: Couldn't deserialize object in variable 'data'
at org.camunda.bpm.engine.impl.variable.SerializableType.getValue(SerializableType.java:62)
at org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntity.getValue(VariableInstanceEntity.java:196)
at org.camunda.bpm.engine.impl.persistence.entity.VariableScopeImpl.collectVariables(VariableScopeImpl.java:81)

Caused by: org.camunda.bpm.engine.ClassLoadingException: Class not found: net.dtrust.ceroma.bpm.ceromaprocessprototype.application.DataObjectHelper
at org.camunda.bpm.engine.impl.util.ReflectUtil.loadClass(ReflectUtil.java:88)
at org.camunda.bpm.engine.impl.variable.SerializableType$ClassloaderAwareObjectInputStream.resolveClass(SerializableType.java:117)

Caused by: java.lang.ClassNotFoundException: net.dtrust.ceroma.bpm.ceromaprocessprototype.application.DataObjectHelper
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at org.camunda.bpm.engine.impl.util.ReflectUtil.loadClass(ReflectUtil.java:68)
... 67 more

Nico Rehwaldt

unread,
Oct 14, 2013, 5:52:38 AM10/14/13
to camunda-...@googlegroups.com, gnt...@googlemail.com
Hi Günter, 

which kind of task forms are you using? A form embedded into the tasklist? Or a form that is directly served in your application (via a redirect)?

Embedded task forms do not yet support complex (serializable) objects.

Regards
Nico

Günter

unread,
Oct 14, 2013, 7:45:28 AM10/14/13
to camunda-...@googlegroups.com

Hallo Nico,

thanks for reply. We are using embedded forms. The complex data type isn’t referenced by any field of the form. We only add a process variable with the complex data before the user task is active and try to use it afterwards by calling some business methods of the data type in subsequent flow conditions.  But doing so breaks the form’s behavior as an error message appears and the values of the simple process variables are not shown in the form fields (seems to be null at all).

So there isn’t a real need for support, only putting a complex data type as a process variable should not break the otherwise working behavior of a form. Do you think this improvement (ignoring complex data types) has a change to be realized in one of the next releases of the process engine?

Regards
Günter


2013/10/14 Nico Rehwaldt <nico.r...@camunda.com>

--
You received this message because you are subscribed to a topic in the Google Groups "camunda BPM users & process application developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/camunda-bpm-users/5L_PtEI0ej0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to camunda-bpm-us...@googlegroups.com.
To post to this group, send email to camunda-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/camunda-bpm-users/9eb380a1-34e2-49d8-a9b3-7141724ad520%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages