cancel
Showing results for 
Search instead for 
Did you mean: 

Process variables best practices

hisaak
Champ in-the-making
Champ in-the-making
Hi everybody,

I've been looking for the way to define list of variables used in a process and came across Explicit variables in process definitions topic and related ACT-620.

However, ACT-620 is closed without any reasoning or solution, so I'd like to formulate the question differently: Are there any best practices regarding process variables? Besides the need for "process interface", I need to handle process variables at three or four places within the project: process itself, published process API (e.g. web service for instance creation), JavaDelegate implementations and jUnit tests. Is there a way to define shared process related list of variables?

I thought about a simple Java class/enum (or Spring bean) holding all process instance names. It seems simple, but at least it could help with typo errors, (naming) conventions and prevent duplicate variables … However, I can't use expression in resultVariableName attribute within process definition and that makes my idea unfeasible.

Regards
2 REPLIES 2

hisaak
Champ in-the-making
Champ in-the-making
"holding all process instance names" -> "holding all process variable names"

frederikherema1
Star Contributor
Star Contributor
Using an enum is a good idea, and is accessible from expressions, if that is required… Or use some kind of map that is exposed to the expressions in activiti (using processEngineCOnfiguration beans for example, see userguide).