Expertsystemen

 

Conditional text fragments

This section builds on the model and document of Introduction to Document assembly and further. We highly recommend reading those articles first. Furthermore, a basic understanding of conditions is advised.

In our Word template there was an optional agreement between the buyer and the seller. We would like this statement to appear if the user wants to, including the number of years. Below you can see the questions that determine this statement.

The questions determining the text
The questions determining the text

Just like with formulas and connections, you can add conditions to text fragments. xxllnc Expertsystemen will then only create the text fragment if the condition is satisfied. If the condition is not true, the text fragment will not be made and the paragraph in the Word template will be deleted. You can also manually delete paragraphs.

To add a condition to a text fragment, first create a text fragment. For our example, we will create a text fragment called guarantee in the node text_fragments. In it, we will place the text from the template and paste the duration variable from the node duration_guarantee.

Creating the text fragment
Creating the text fragment

Next, we will add the condition. To do so, either directly enter the condition in the condition field or do it through the condition screen (by click the [...]). The second method is shown below in the image. If you don’t know how to do this, please see conditions.

Adding the condition
Adding the condition

Now that we’ve added the condition to this text fragment, we’re almost done. We only need to put the text fragment in the template After that’s done, we’re ready! If the user choose a guarantee, it will be added. If not, the sentence “3. Buyer gets a guarantee of [number of years] years.” will simply be removed!