How to pass variables to call activity subprocess from parent process

Hi,

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.

Below is my configuration:

LOGGER.info(“Map Force has been triggered for fileId:”+execution.getVariable(“fileId”)+" "+execution.getVariableLocal(“fileId”));

Please let me know how to access the variables from parent to callActivity sub Process.

The mapping looks correct today - what does the code in your java delegate look like?

@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.

Ok, can you upload the models so i can look for anything that might be cause this?

FileProcessing.bpmn (19.6 KB)
MapsHandling.bpmn (10.2 KB)

I am calling FileProcessing(MapsHandling.bpmn) sub subprocess.

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

1 Like

Thank you Aravindh! Issue has been resolved.