I want to get Process Parameters from a groovy Script to write them to a File but it seems they are not know if they are not included manually in the script.
I don't want to add all of them manually, I need to have a dynamic List.
I've try:
import org.bonitasoft.engine.api.APIAccessor
import org.bonitasoft.engine.bpm.parameter.ParameterCriterio
import org.bonitasoft.engine.api.ProcessManagementAPI
File file = new File("/var/tmp/out.txt")
parameters = apiAccessor.processAPI.getParameterInstances(processDefinitionId, 0, 100, ParameterCriterion.NAME_ASC)
parameters.each {
varname = it.name
file.append(varname + ": " + evaluate("$varname") + "\n")
}
This Method don't works. I have to add an access to each parameters in the script to make it works (parameters are Param1 and Param2 in the example)
import org.bonitasoft.engine.api.APIAccessor
import org.bonitasoft.engine.bpm.parameter.ParameterCriterio
import org.bonitasoft.engine.api.ProcessManagementAPI
File file = new File("/var/tmp/out.txt")
xx = Param1
xx = Param2
parameters = apiAccessor.processAPI.getParameterInstances(processDefinitionId, 0, 100, ParameterCriterion.NAME_ASC)
parameters.each {
varname = it.name
file.append(varname + ": " + evaluate("$varname") + "\n")
}
How can I get a dynamic Parameters List?
Best Regards