cancel
Showing results for 
Search instead for 
Did you mean: 

Process variables for repeating timed process

hyapit
Champ in-the-making
Champ in-the-making
Hello,

I need to be able to pass in process variables for the subsequent process cycles. Does Activiti have supports for something like this?

Does Activiti support process-definition scoped process variables? i.e., for cycles of process instance from the same process definition, use the same map of process variables?

I only managed to pass in process variables map the first time I kick start the process via RuntimeService.startProcessByKey(id, processVars).

I realize the challenge to what I'm asking here – how do you specify which variables to passed in when the the process cycle decides to fire some time midnight when it's raining in the full moon? I'm thinking about possibly hooks to modify previously used process variables in the previous process cycles.

Thanks!

hussein
3 REPLIES 3

jbarrez
Star Contributor
Star Contributor
I don't 100% grasp what you are trying to do.

Activiti does indeed not support defining variables in a process definition. However, it does support execution listeners that can hook in on process start and populate variables. Those execution listener can be scripts and thus can be part of the process xml.

hyapit
Champ in-the-making
Champ in-the-making
By "cycle", I'm referring to an instance of a recurring timed process that uses "timecycle" timer.

I was figuring out how to pass in a set of parameters to subsequent process cycles when they are fired.

My solution is to use FormService to track parameters for a process ID in conjunction with ExecutionListener as you suggested.

For those who are curious, I'm using activiti 5.12.1.

Thanks again!

hyapit
Champ in-the-making
Champ in-the-making
Just found out that it turns out "processDefinitionId" parameter name does not refer to a process definition "id" xml attribute. process definition id attribute is processDefinitionKey.

So Joram is right, there's no processDefinition scoped variables supported currently.