Transient Variables

302 views
Skip to first unread message

Falko Menge

unread,
Feb 23, 2015, 10:23:40 AM2/23/15
to camunda...@googlegroups.com
The new capabilities of Camunda BPM to handle complete JSON and XML
documents seem to spawn renewed interest in transient process variables.

I already encountered multiple customers that want to send JSON or XML
documents are from the Camunda JavaScript Forms SDK or other frontends
to the Camunda REST API and forward it to backend services using a BPMN
process. If the backend services already take care of storing the
documents, they should not be stored redundantly in the process engine
database (neither in the runtime database nor in the history).
Especially, in high load scenarios this can lead to slow performance and
rapidly growing DB size.

Now one could try to set variables to null after use, but that requires
additional code after the variable has been used.

Better would be, if one could declare a variable as transient. That
could be similar to setting the serialization format and then the engine
automatically disposes the variable values.

For the history, a workaround would be to lower the history level or
implement a custom history level that filters out the transient
variables. But, again that is a lot of additional code and could easily
lead to errors.

Any chance that this is added as a feature to the engine?

Daniel Meyer

unread,
Feb 23, 2015, 11:25:38 AM2/23/15
to camunda...@googlegroups.com

Falko Menge

unread,
Feb 23, 2015, 12:17:05 PM2/23/15
to camunda...@googlegroups.com
That related post just describes a similar workaround.

Do the new persistence methods that allow JSON and XML make the declaration and implementation of transient variables easier?

Daniel Meyer

unread,
Feb 24, 2015, 3:49:04 AM2/24/15
to camunda...@googlegroups.com
Yes indeed, I just wanted to add the link for cross reference.

In terms of Java API, I think that there could be a "isTransient()" method in the TypedValue interface.

Then, there could be static builders in the org.camunda.bpm.engine.variable.Variables class:

VariableMap variables = createVariables()
     
.put("transientString", transientStringValue("aaa"))
     
.put("transientObject", transientObjectValue(...));

The transient property would then be present in the "value info" map as well such that the REST api can support it:

{
 
"value" : "someTransientStringValue",
 
"type" : "String",
 
"valueInfo" : {
   
"transient": true
 
}
}


WDYT?

Daniel

Falko Menge

unread,
Apr 9, 2015, 10:14:25 AM4/9/15
to camunda...@googlegroups.com
Sounds good! How do we progress from here?

Daniel Meyer

unread,
Apr 14, 2015, 3:03:50 AM4/14/15
to camunda...@googlegroups.com
Would you be able to provide a PR?

Daniel

Falko Menge

unread,
Apr 14, 2015, 4:51:41 AM4/14/15
to camunda...@googlegroups.com
I could certainly do it, but I'm not sure if I'll have time any time soon.

Daniel Meyer

unread,
Apr 14, 2015, 5:20:55 AM4/14/15
to camunda...@googlegroups.com
Yes, same thing here :)
Reply all
Reply to author
Forward
0 new messages