Quick work-around is to use a temporary process variable, "cam-variable-name", to hold the value for embedded form display. This works with the embedded form's built-in buttons: save/complete.
Here is the source at github - these files are evolving... so, for example only at this stage. There's lots of 'cruft' in the code at this time... but, you'll get the idea.
Note that I'm naming the temporary camunda variable "customer_value_firstname" - this help with keeping track of variables.
Also, only using this work-around for JSON fields I'll be changing/editing within the form.
A more formal angularJS work-around will happen... later.
<!-- Save button work-around, I'll push the field value into this form and
use the 'save' event to better manage updates for both server and form -->
<label class="control-label">cam-variable-name: customer_value_firstname</label>
I then take advantage of Camunda's built-in events during embedded form life-cycles.
Field setup: id="customer_value_firstname"
var customer_value_firstname = $('#customer_value_firstname', camForm.formElement);
Load the actual JSON process variable I'm using. However I'm not directly displaying this JSON process var's field values for editing. Using a temporary field for that.
Set scope for the JSON object - noting that we're not directly displaying ng-model since it has trouble with using button events. My examples will show some JSON display for debugging only:
$scope.customer = variableManager.variableValue('customer');
Then apply the value into the temporary, though displayed, field:
var value = $scope.customer.value.firstname;
And, finally pushing the temp field value into the JSON process var during the store event.
- same approach for submit event.
$scope.customer.value.firstname = $scope.customer_value_firstname;