cancel
Showing results for 
Search instead for 
Did you mean: 

Explicit variables in process definitions

kaech
Champ in-the-making
Champ in-the-making
All examples I have seen so far make use of implicit variables, i.e. variables that are not explicitly defined in the process definition. An example is the "Advanced example using Spring beans and JPA" in the tutorial. Here the loanRequest variable is just returned from the newLoanRequest operation.

Does Activiti support the use of explicit variables in the process definitions?
If yes, how can I explicilty define a POJO or XML message as a process variable?

Thank you.
7 REPLIES 7

tombaeyens
Champ in-the-making
Champ in-the-making
Declaration of variables is something we plan to add soon.  A lot of the pieces are already implemented.  But finishing it off might take some more time.
Can you explain a bit about your use case so that we can take that into account as we work out this feature?

I created http://jira.codehaus.org/browse/ACT-620

kaech
Champ in-the-making
Champ in-the-making
I think this is especially important when it comes to BPMN execution.
The process model is kind like source code.
Therefore it is important to explicitly define all variables in the model.
Otherwise there would be some hidden magic that is not visible to the process developer.
It is the same as in BPEL. All variables have to be defined before they can be used in the process.
That is good cause the model contains all relevant information (process flow and data).
Does this make sense?

jbarrez
Star Contributor
Star Contributor
This certainly makes sense.But it was not our first focus: that was to make it as easy as possible for developers to use process data.
However, as we are implementing more and more BPMN 2.0 constructs, the data definitions of BPMN 2.0 will be supported at some point in time.

tombaeyens
Champ in-the-making
Champ in-the-making
I think it is a matter of style and preference.

If you quickly want to build a prototype, implicit and automatic creation of variables can be fast and easy.
If you want to apply more rigorous procedures, then declaring all variables can be a better option.  There are obvious advantages of declaring variables.  But a downside is that if you want to change / refactor a variable, then you need to update a lot more in case of explicit declarations.

gant
Champ in-the-making
Champ in-the-making
Hi,

Are there any news on this topic? I see there is no activity on issue ACT-620.

We plan to build a repository of reusable sub-procsesses. To manage this, it would be great if we could use excplicit variables to describe the processes 'interface' (something like a method signature).

Does anybody have other aproaches to extract the 'interfaces' from the process definitions?

Regards

fredg
Champ in-the-making
Champ in-the-making
Hi,

I also had a requirement to embed more informations inside process definition (and from the designer), and use java to "discover" them at runtime.

I tryed to use Form properties (only applies to UserTask node)
See http://forums.activiti.org/en/viewtopic.php?f=6&t=2188
It works if you only need to retrieve variable name or type, but can't make it access default values.
Not sure if you can use for a sub-process, but at least they are defined.

Many users would like to use activiti in production, not only for doing prototypes. At this step process dev & java dev may work using this interface contract, at different time.
I agree with Kaech, with the need of "auto documented by source" constraints, and an acute definition in process for what gonna happend at execution.

lsmall
Champ in-the-making
Champ in-the-making
I have cloned ACT-620 with a request to support Data Objects:

http://jira.codehaus.org/browse/ACT-1847