I have selectedAddresses as output variable in a Service Task http-connector in Camunda modeller
Which is the correct way to access this variable in Java class ?
String x = execution.getVariable("selectedAddresses");
Or
String x = (String) runtimeService.getVariable(processId, "selectedAddresses");