Hi @Ajr
In general “process variables” should be used to store data for transition conditions “affect the path of the process” (example: Boolean process variable named “approved”), and identifiers for business data stored in an external database (example: String process variable named “orderId” which has the value of the unique identifier of business order object/record)
Form Loading Phase:
Using the unique identifier value (which is stored in a process variable named “orderId”), business data (order object) should be retrieved.
In case of embedded forms, This could be done by invoking your custom rest service (your get order rest service) in “form-loaded” event listener
https://docs.camunda.org/manual/7.4/reference/embedded-forms/lifecycle/#event-listeners
Form Submission Phase:
Business data (order object) should be saved to the external database
In case of embedded forms, This could be done by invoking your custom rest service (your save order rest service) in “submit-success” event listener
https://docs.camunda.org/manual/7.4/reference/embedded-forms/lifecycle/#event-listeners
In case of simple forms (simple business data)
You could use process variables to store the business data (use JSON type to store form data & use primitive type to store searchable attributes)
for example
(Student Object could be stored as JSON type process variable
& searchable attributes like studentId & name could be stored as primitive type process variables)