Thanks for the reply, I use the Map<String, String> only as a workflow-step param, the conventional UI Builder uses only supported databinds compatible with /lib/form controls. Here's the code:
public class SCTMStep extends AbstractStepImpl {
private final int projectId;
private final List<Integer> execDefIds;
@DataBoundSetter public Map<String, String> params;
@DataBoundSetter public String buildNumber;
@DataBoundSetter public int delay;
@DataBoundSetter public boolean continueOnError;
@DataBoundSetter public boolean collectResults = true;
@DataBoundSetter public boolean ignoreSetupCleanup;
@DataBoundConstructor
public SCTMStep(final int projectId, final List<Integer> execDefIds) {
this.projectId = projectId;
this.execDefIds = execDefIds;
}
@Extension(optional = true)
public static final class DescriptorImpl extends AbstractStepDescriptorImpl {
public DescriptorImpl() { super(Execution.class); }
@Override public String getFunctionName() { return "sctm"; }
@Override public String getDisplayName() { return Messages.getString("SCTMExecutorDescriptor.plugin.title"); }
}
public static final class Execution extends AbstractSynchronousStepExecution<Boolean> {
private static final long serialVersionUID = 1L;
@Inject private transient SCTMStep step;
@StepContextParameter private transient TaskListener listener;
@StepContextParameter private transient FilePath workspace;
@StepContextParameter private transient Run<?, ?> run;
@Override
protected Boolean run() throws Exception {
SCTMExe sctmExe = new SCTMExe(workspace, listener);
sctmExe.execute(step.projectId, step.execDefIds, step.params, step.buildNumber,
step.delay, step.collectResults, step.ignoreSetupCleanup, step.continueOnError, false);
if (step.collectResults) {
sctmExe.publish(run);
}
return true;
}
}
}
The databind of the Map<String, String> is done correctly and in the workflow Job this works like a charm:
...
sctm projectId: 123, execDefIds: [456, 789], params: [NAME: 'Flávio Augusto Valones', ADDR: 'Some Street']
...
The sctm step is listed in the Snippet Generator (I have not yet implemented the jelly form for it), and everything goes as expected.
The exception only occurs if I do this in the SCTMStep:
...
private Map<String, String> params;
@DataBoundSetter public void setParams(Map<String, String> params) { ... }
...
Probably caused by use of wildcards in the type.