cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a process programatically, variables not being set.

roadtripryan
Champ in-the-making
Champ in-the-making
I'm using Activiti in a Grails application. So far, it is working very well, however I can't seem to get programatic process starting working. In my code I do:

Map<String, String> paramMap = new HashMap<String, String>();

… put parameters into the map ….

activitiService.runtimeService.startProcessInstanceById(params.processDefinitionKey, paramMap);

The process starts, but in the variables, the type is groovySerializable, the name is correct, but the text value is not filled in.

I am stumped as to why it is using groovySerializable as the type since it is a HashMap of <String, String>.  A gently poking of the activiti source code didn't turn anything up. Any idea what might be going on, or where to look? It must be getting the type incorrectly somewhere, but I can't see where, or how to force it to see my parameters as the strings they are.

Thanks!
Ryan
3 REPLIES 3

frederikherema1
Star Contributor
Star Contributor
How do you fill the map of variables? The startProcessInstance actually accept a Map<String,Object>. Perhaps the groovy is trying to coerce the values into a string?

roadtripryan
Champ in-the-making
Champ in-the-making
It ended up being a problem with the grails activiti plugin. I finally found a solution here:

https://groups.google.com/forum/#!msg/grails-activiti-plugin/mD0aJKhiZE4/c1axXOsrSrgJ

frederikherema1
Star Contributor
Star Contributor
Great, thanks for sharing the solution!