Function Documentation: |
This function compares the content of a file to different values and
directly goes to a different step in the action according to the value.
This function may be used if the treatment to be done after a
submission depends on a field entered by the user. Typically
this is used in an approval interface. If the referee approves
then we do this. If he rejects, then we do other thing. More
specifically, the function gets the value from the file named
[casevariable] and compares it with the values stored in
[casevalues]. If a value matches, the function directly goes to
the corresponding step stored in [casesteps]. If no value is
matched, it goes to step [casedefault].
@param parameters: (dictionary) of parameters (relating to the given
doctype/action) that are to be passed to the function:
+ casevariable: This parameters contains the name of the
file in which the function will get the
chosen value.
Eg:"decision"
+ casevalues: Contains the list of recognized values to
match with the chosen value. Should be a
comma separated list of words.
Eg:"approve,reject"
+ casesteps: Contains the list of steps corresponding to
the values matched in [casevalue]. It should
be a comma separated list of numbers.
Eg:"2,3"
In this example, if the value stored in the
file named"decision" is "approved", then the
function launches step 2 of this action. If it
is "reject", then step 3 is launched.
+ casedefault: Contains the step number to go by default if
no match is found.
Eg:"4"
In this example, if the value stored in the
file named "decision" is not "approved" nor
"reject", then step 4 is launched.
@return: (string) - empty string |