Hi there, I am trying to figure out how to implement the following scenario . Lets say I have several global/flow variables (A,B,C) used in various ways throughout the flow (displays, calculations, etc.). On the UI I side I have a configuration with corresponding text inputs, check boxes, and buttons to trigger different functions (including reset); I am using a template approach (basically a form, so all values are submitted together):
<div flex="" style="margin 3px 0px 0px 7px" layout="row">
<div flex="35" style="padding:0 5px">
<div layout="column">
<div><md-checkbox ng-model="dfl" aria-label="def">$ . . D</md-checkbox></div>
<div><md-input-container><input aria-label="amt" ng-model="amt"></md-input-container></div>
</div>
</div>
<div flex="20" style="padding:0 5px">
<div layout="column">
<div><md-checkbox ng-model="sl_trl" aria-label="sl_trl">L</md-checkbox></div>
<div><md-input-container><input ng-model="sl"></md-input-container></div>
</div>
</div>
<div flex="20" style="padding:0 5px">
<div layout="column">
<div><md-checkbox ng-model="tp_trl" aria-label="tp_trl">P</md-checkbox></div>
<div><md-input-container><input ng-model="tp"></md-input-container></div>
</div>
</div>
<div flex="20" style="padding:0 5px">
<div layout="column">
<div><md-checkbox ng-disabled="true" ng-model="t_trl" aria-label="t_trl">TRL%</md-checkbox></div>
<div><md-input-container><input aria-label="trl" ng-model="trl"></md-input-container></div>
</div>
</div>
</div>
<div style = "text-align:center" flex=""><md-button aria-label="set" class="md-accent md-hue-2 md-raised" ng-click="send({payload:{amt:amt, sl:sl, tp:tp, trl:trl, tp_trl:tp_trl, sl_trl:sl_trl, dfl:dfl, t_trl:t_trl}})">SET</md-button></div>
In a change-node I have permanently defined "initialization values" {"A": 3, "B":5, "C":7) and when the application initializes, it sets the variables to (lets call it a persistent state) "session default".
-
From the UI I want to be able to update just one variable without affecting the others; right now if I leave inputs blank I end up with "undefined" . That updated value is an a "temporary state" persisting only until a function is triggered and then resets back to its "session default".
-
However, I may also want to make that new value become the "session default", by checking a check box prior to submitting (so that flag causes it to be stored differently). Of course, if the flow is reset it starts off again with the initialization values stored in the change-node.
THANKS!