99 | | An UpdateFunction is a function that changes a Parameter value. The following are available: |
100 | | ||UpdateFunction||description||Additional parameters|| |
101 | | ||Set||Directly sets the parameter to a given value. ||value: ParameterValue|| |
102 | | ||BlockSubstitute||Substitutes in given value all occurences if [X] where X is a known parameter with the value of parameter X. Unknown parameters are not substituted||value: ParameterValue|| |
103 | | ||ValueWithCondition||Sets parameter to given value , iF the condition holds.||value:ParameterValue, condition: Parameters|| |
104 | | ||SetBestMatch||sets a parameter to the value that has the best condition||valueconditions: List<ValueWithCondition>|| |
| 99 | An UpdateFunction is a function programmed in Java (extending UpdateFunction class) that can be called from the json dialog file to change parameter values. |
| 100 | |
| 101 | Generally these functions look like this in json |
| 102 | |
| 103 | {{{ {"NameOfFunction":[val1, val2, val3....] } }}} |
| 121 | |
| 122 | |
| 123 | |
| 124 | The following are available: |
| 125 | ||UpdateFunction||description||Additional parameters|| |
| 126 | ||Set||Directly sets the parameter to a given value. ||value: ParameterValue|| |
| 127 | ||BlockSubstitute||Substitutes in given value all occurences if [X] where X is a known parameter with the value of parameter X. Unknown parameters are not substituted||value: ParameterValue|| |
| 128 | ||ValueWithCondition||Sets parameter to given value , iF the condition holds.||value:ParameterValue, condition: Parameters|| |
| 129 | ||SetBestMatch||sets a parameter to the value that has the best condition||valueconditions: List<ValueWithCondition>|| |
| 130 | ||SetFirstMatch||set parameter to the first value for which the condition holds, or the "orelse" value if no condition holds|| |
| 131 | ||SetIfElse||Sets parameter to the vtrue value if the condition holds, else to vfalse value|| |
| 132 | |
| 133 | Custom functions can be programmed in Java and then used in your json code. Of course make sure that your custom functions are properly attached to the json parser. |
| 134 | |
| 135 | |
| 136 | == DialogPhase |
| 137 | Each DialogPhase contains a list of UpdateFunctions that are executed in the given order. It allows computation of derived variable values. |
| 138 | |
| 139 | |
| 140 | |
| 141 | |