|
Best of Support |
|
|
Grammar Server |
|
Issue
I have created several templates that use the Grammar server tasks and I'd prefer to have the party's gender asked within a Dialog grouped with other related fields rather than separately (outside of a Dialog). Adding standard and List fields to a Dialog is not a problem, but I haven't figured out how to get the grammar list (Male, Female, Corporate Identity, Plural) onto a Dialog. Is that possible?
Solution:
Your question is a good one - and the solution would not have been obvious. GhostFill's grammar object has 4 methods: "Male", "Female", "Corporate" and "Plural" which, as a default, are all set to "false" when the object is created. When the object is first used to determine a grammar value, if at run time all 4 of these methods are false, the drop-down selection interface pops up and the chosen method is then set to "true".
You can from a FillPoint pre-set one of the methods to "true". For example, in the Grammar Sample.dot template that ships with the GF Feature Samples application, at the top of the template you could have:
%[Def=Grammar.Party('Defendant')] %[def.female=true]
%[Plaint=Grammar.Party('Plaintiff')] %[plaint.corporate=true]
In this case the run-time gender selection list would NOT appear, and the template would automatically be filled for a female defendant and a corporate plaintiff.
Now if you have a dialog value to determine the gender of, for example, the defendant, in your template you could have something like:
%[Def=Grammar.Party('Defendant')]
%[iftrue(mydialog.defendanttype="female", def.female=true)]
%[iftrue(mydialog.defendanttype="male", def.male=true)]
%[iftrue(mydialog.defendanttype="Plural", def.plural=true)]
%[iftrue(mydialog.defendanttype="Corporate", def.corporate=true)]
This is not all that elegant - although you could put the above in a Script to make the template less messy.
A somewhat more elegant approach would be in the actual List that appears in your Dialog. In the ITEM column have "Male", "Female", "Plural" and "Corporate", but in the RESULT column have the appropriate FillPoint:
%[def.male=true], %[def.female=true], %[def.plural=true] and %[def.corporate=true].
Then in your template all you need is:
%[Def=Grammar.Party('Defendant')] and then %[MyDialog.DefendantType] which will execute the result column of the selected defendant type.
Dan Todes