I am trying to get a variable from parent process to sub process callActivity but I am getting null when I am getting the value in Java Delegate of sub Process.
I tried setting variable “all” and actual variable name “fileId” but its not working.
@Service(“triggerMapforce”)
public class TriggerMapForceMap implements JavaDelegate {
@Autowired
FileProcessingService fileProcessingService;
private final static Logger LOGGER = Logger.getLogger(TriggerMapForceMap.class.getName());
@Override
public void execute(DelegateExecution execution) throws Exception {
LOGGER.info("Map Force has been triggered for fileId:"+execution.getVariable("fileId")+" "+execution.getVariableLocal("fileId"));
execution.setVariable("mapForceMapTriggered", fileProcessingService.triggerMapForce(Integer.parseInt(execution.getVariableLocal("fileId").toString())));
}
}
Its giving me null for execution.getVariable(“fileId”) and execution.getVariableLocal(“fileId”) when calling from parent process.
try with lowercase for the field fileid or fix the variable name. In subprocess, you are setting input variable fileid as lowercase in the Input parameters for the task Trigger MapForce and in delegation code you’re trying with camel case of the variable name like fileId