Map Rest Controller to Camunda Workflow

My work starts from Create Order.This task will be triggered from some GUI screen.
I have written a RestController which will be exposed to GUI.How can i map CreateOrderController to the Camunda CreateOrder task .And I need to pass OrderInfo object to the next task i.e.“Place Order”

@RestController
public class CreateOrderController  {
	
	@PostMapping("/rest/create/order")
	public String createOrder(@RequestBody OrderInfo orderInfo) {
		System.out.println(" Order created with Order id  " + orderInfo.getOrderId());
		return "Order id created with " + orderInfo.getOrderId() ;
	}

> Blockquote

There are different options.
For one, you can use the REST API to claim and complete a user task.

When completing a task, you can provide a set of process variables which can be accessed by the successor state.
If you use Camunda 7 as an embedded engine, you can also use the process engine services.

For passing objects, such as orderInfo, Camunda Sping may help you:

Is below the correct way?And is there any other way i can achieve the same?

That is one way. But you are starting the process twice.
You can also remove the user task and provide all information when you start the process.