WorkflowManager wkflManager = getWorkflowManager();
WorkflowInfo wkflInfo = wkflManager.getWorkflowInfo(wkflId);
String taskId = wkflInfo.getJobInfo(jobIndex).getTaskId();
RunningJobInfo jobInfo = jobInfoManager.getJobInfo(wkflId);
//create serializer config:
Map config = new HashMap();
config.putAll(req.getParameters()); //do first (so user can't overwrite following params)
config.put("WORKFLOW_MANAGER", wkflManager);
config.put("WORKFLOW_MANAGER_SERVICE", this);
config.put("WORKFLOW_ID", req.getJobId());
config.put("WORKFLOW_ID", wkflId);
config.put("WORKING_DIRECTORY", jobInfo.getWorkingDirectory()); //TODO: this is wrong
JDOMSerializer paramSerializer = serializers
.getWorkflowSerializerSet(wkflManager)
.getOutputParameterSerializer(jobIndex, taskId, config);