Transfer data from one REST to other

Hi,

Iam implementing camunda in my project and using AJSC framework.
I tried a basic POC and had this issue.

This is two task and implementing REST in background

ProcessRest Service : Implementation

@Service(“getHelloWorld”)
public class ProcessRestService {

@Transactional
public void  getHelloWorldResource(DelegateExecution execution){
	RestTemplate restTemplate = new RestTemplate();	
	ResponseEntity<HelloWorld> responce = restTemplate.getForEntity("http://localhost:8080/restservices/camundaAJSC/v1/service/hello", HelloWorld.class);
	System.out.println("value of resp:" + responce.getBody());
	StringValue responceBody = Variables.stringValue(responce.getBody().toString());
	execution.setVariable( "getHelloWorldResponce", responceBody);
}

ProcessRest Service1 : Implementation

@Service(“processHelloWorld”)
public class ProcessRestService1 {

public void processHelloWorld(DelegateExecution execution){
	
	HelloWorld getHelloWorldResponce = (HelloWorld) execution.getVariable("getHelloWorldResponce");
	System.out.println("Responce from REST2 : processHelloWorld :" + getHelloWorldResponce);
}

NOW, execution.getVariable(“getHelloWorldResponce”) = null.

I know both are different task.How do i get the data from task 1 to task 2.

Kindly guide me…!!
Thanks.

@sooriyaa_pr you can save your data into a Process Variable, and have “Process Rest Service 1” do a getVariable() to retrieve the data

@StephenOTT I am trying to do the same in my above code.

I am saving data in,

execution.setVariable( “getHelloWorldResponce”, responceBody);

And trying to retrieve the data by,

execution.getVariable( “getHelloWorldResponce”);

But I don’t find any data. Am I missing out something.

thanks for the help.

What does the cockpit show the variable value as ?

Are you sure the reaponsebody is actually returning data?