Changes between Version 23 and Version 24 of dialogmanager


Ignore:
Timestamp:
10/04/23 16:17:45 (13 months ago)
Author:
wouter
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • dialogmanager

    v23 v24  
    9797
    9898== UpdateFunction
    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>||
     99An UpdateFunction is a function programmed in Java (extending UpdateFunction class) that can be called from the json dialog file to change parameter values.
     100
     101Generally these functions look like this in json
     102
     103{{{ {"NameOfFunction":[val1, val2, val3....] } }}}
    105104
    106105
    107106
    108 == UpdateFunction
    109 An UpdateFunction is one of the phases of the DialogPhase. It allows computation of derived variable values. These functions can be programmed in Java. Generally these functions look like this in json
    110 
    111 {{{ "updatefunction":{"NameOfFunction":[["invar1","invar2",...],["outvar1","outvar2",...]]},}}}
    112 
    113107NameOfFunction is the name of a java class that implements the UpdateFunction class.
    114108This class implements a function {{{ Parameters call(Parameters parameters) }}}
     109
     110
     111
     112An update function has access to all parameters and can change any of them. But generally it is good practice to only use/change parameters provided in the arguments. In above case, it would use
     113
     114
    115115
    116116The incoming Parameters will be set to the current parameter values in the dialogstate .
     
    119119This mechanism allows the function to be called with different parameters as needed in the dialog. And it allows functions of arbitrary input and output arity.
    120120
     121
     122
     123
     124The 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
     133Custom 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
     137Each DialogPhase contains a list of UpdateFunctions that are executed in the given order. It allows computation of derived variable values.
     138
     139
     140
     141