cancel
Showing results for 
Search instead for 
Did you mean: 

how to put variables in an instance ?

vire7777
Champ in-the-making
Champ in-the-making
Hello Smiley Happy

I wanted to know if it exists a way to give the workflow global variables like :
formService.submitTaskFormData(String taskId, Map<String,String> );

but with a Map<String, object> like at the moment we launch a workflow instance.

Thanks for your help
5 REPLIES 5

frederikherema1
Star Contributor
Star Contributor
Use runtimeService.startWorkflowByKey("key", mapOfVariables); or related methods.

Alternatively, you can use runtimeService.setVariables(processInstance.getId(), mapOfVariables); or related methods.

debarcar
Champ in-the-making
Champ in-the-making
Is it possible to store the variables in the bpmn define file?

Regards!

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

BPMN file defines the process. Variables definition can be part of the activiti extensions in BPMN file (e.g. form properties). BPMN file itself does not contain variable definition section.

It is not possible to store variable instances in the BPMN process definition.

Regards
Martin

debarcar
Champ in-the-making
Champ in-the-making
How about some global constants?  In my application, we have logic that when a process instance run to some user task, the associated business application form is unchangeable. No I put the unchangeable flag in the user task's form, but I think a setting for the user task in the bpmn diagram xml will be better.

Regards!

frederikherema1
Star Contributor
Star Contributor
You can make your process take different paths, depending on a variable (e.g. value filled in in an earlier form). Depending on that, you can direct the flow to either a task with a editable form and in the other case, a task with a read-only form.
Welcome to the new Hyland Connect. Get started or submit feedback.