cancel
Showing results for 
Search instead for 
Did you mean: 

Problem adding Variables when starting with submitStartFormData

prace
Champ in-the-making
Champ in-the-making
Hi,

we want to start a Process with Form Parameters for the startEvent. For later steps in the Workflow we need to add additional variables.
I know that all Form Variables will become Workflow variables so I could just add them to the submitStartFormData call in the Map.

Problem for us is, that the signature of the Map supplied to startProcessInstanceByKey is Map<String,Object> (which we actually use to submit eg. java.util.Date's), but the signature for the Map of submitStartFormData is Map<String,String>.

We tried adding the variables after the start via something like this:

processInstance = getFormService().submitStartFormData(processDefinition.getId(), formValues);
getRuntimeService().setVariables(processInstance.getId(), dataMap);


but obviously the second statement never gets executed because the start of the process causes exceptions about unknown expressions/process variables.

Any other Ideas or hints besides converting all entries in the dataMap to Strings and handling everything as String in the Workflow?

Thanks!

Greets, Peter
3 REPLIES 3

balsarori
Champ on-the-rise
Champ on-the-rise
Providing log of thrown exceptions could help in understanding what's wrong.

prace
Champ in-the-making
Champ in-the-making
Hi,

it's not the point of thrown Exceptions.

The point is, when starting a workflow without any start form parameters i use a Map<String,Object> for the variables. (eg. to suppy directly a java.util.date)
When starting a workflow with Form Paramers i can only submit formValues as <String,String>. So I can't supply e.g. a Date directly for later usage in the workflow.

Ideally the submitStartFormData method needs an additional Map<String,Object> for the "regular" workflow variables…

Thank you.

Greets, Peter

dean
Champ in-the-making
Champ in-the-making

Same confusion