Document Engine Complex Conditionals

Overview

Use Complex Conditionals functionality to insert complex condition statements with multiple if...else clauses inline within the content of a document, using the Document Editor and without having to create custom XSL snippets.

Create complex conditionals within the Complex Conditional Expression Editor, using simple filters to set up <if...then> conditional statements.

The content within a conditional can be created in a WYSIWYG editor. All editor functionality such as formatting, text, hyperlinks, images, tables, dynamic data, repeating sections and conditionals are available within this editor.

You cannot insert a complex conditional within a complex conditional.

The page code reflects the conditional in the following format:

<xsl:call-template name="Condition1">< xsl:call-template>

Example Use Case:  In the case of headers and footers, if you have to make a change to a logo or perhaps office location information, you can simply make the change in the complex conditional and the information will update in all places that the complex conditional is located.

Administration

ClosedAdding a Complex Conditional

Create complex conditional statements using the Complex Conditional Expression Editor. The <if...else> statements can be Always True or they can be evaluated using simple filters.

  1. Click Admin to go to the Admin Home Page.

  2. Click Documents under Commerce and Documents.

The Document Engine Management Center appears.

  1. Click the name of an existing document, or click the pencil icon for a document and then click Open Document Engine.

    The Document Engine appears.

  1. Double-click the page you wish to edit.
  2. Click Complex Conditionals on the Dynamic tab to open the Complex Conditional Expression Editor dialog box.

    Add Complex condition

  1. Enter a unique name for the complex conditional.
  2. Choose a Category from the drop-down.

    If no Categories are available, or the appropriate Category is unavailable, type a new category name in the text field.
  3. If this complex conditional is Always True, select the box next to Always True. This hides the filters section.
Once a Complex Conditional is saved as Always True, it cannot be changed.
  1. If the complex conditional is not Always True, create simple filters:
    • Data Field: Select from the exiting data columns that are in commerce. Click on the field and select from the single-select drop-down.
    • Operator: Select from the list of operators in the field by clicking this field. The operators enable comparing the data field with the Attribute Value to search for, and generate the filter result.
    • Attribute Value: Specify the value of the data field to filter in this field.
    • Add Row: If you need to add additional rows to filter, click Add Row.
    • Row Grouping (Order of Operations): Use this section to define the full expression logic and logical operations between each attribute. Each row can be referenced by its index number assigned by the system. By default, all condition rows are AND-ed.
      • Click AND ALL to AND all the attributes in the order of their creation (index number).
      • Click OR ALL to OR all the attributes in the order of their creation.
      • Use parentheses to further control the order of operations.
      • You do not need to use any order for your attribute indexed while defining the order of operations. The attribute indexes can be referenced multiple times in the order of operations to define the correct condition. The order of operation defined is validated by the system when you click Create.

Expression Editor

  1. Format text, insert hyperlinks, images, tables, dynamic data, repeating sections, and conditionals within the Clause Content section.

    This functions similarly to the WYSIWYG editor used throughout Document Engine.

    You cannot insert a complex conditional.
  1. Click Create.

    Create clause content

  1. Click the pencil icon to add the Clause Content for the "Else" statement.

    add the Clause Content for the "Else" statement

  1. Format text, insert hyperlinks, images, tables, dynamic data, repeating sections, and conditionals within the Clause Content section.

    This functions similarly to the WYSIWYG editor used throughout Document Engine.

    You cannot insert a complex conditional.
  1. Click Save.

    Edit Clause content and save

    Clauses within a complex conditionals can be reordered after creation.
    Conditional sections that contain a lot of data, or that are nested tables/loops/conditions, should be replaced with complex conditionals.

    It is Best Practice to store headers, footers, and terms and conditions in complex conditionals.

ClosedUsing the Complex Conditionals Library

The functionality of Complex Conditionals provides the ability to insert complex condition statements with multiple if...else clauses inline within the content of a document, using the Document Editor and without having to create custom XSL snippets.

Once you have created a complex conditional, it is stored in the Complex Conditional Library. The Complex Conditionals Library is part of the Dynamic Data feature.

  1. Click Admin to go to the Admin Home Page.

  2. Click Documents under Commerce and Documents.

The Document Engine Management Center appears.

  1. Click the name of an existing document, or click the pencil icon for a document and then click Open Document Engine.

The Document Engine appears.

  1. Double-click an item in the Flow tab to edit it.

The item opens in editing mode.

  1. Click Dynamic Data on either the Product List or Dynamic toolbar.

    The Dynamic Content dialog box appears.

    Dynamic Content dialog

  1. Click the Complex Conditionals tab in the Dynamic Content dialog box.

     Click the Complex Conditionals tab in the Dynamic Content dialog


  1. Search the library for your complex conditional by entering the entire name or part of the name in the Find field.
  2. Narrow down the complex conditionals by category by selecting categories in the drop-down.
  3. Click Search to list all complex conditionals that meet your search requirements.

    Searching the Complex Conditionals Library

  1. Select the complex conditional you searched for.

    You can edit or delete the complex conditional, or insert it into your page.

    Select the complex conditional you searched for



ClosedPlacing Tables back into Conditionals

If a Table somehow ends up residing outside of the Conditionals they were created in, follow these steps to easily replace Tables within Conditionals.

This allows you to recreate the Conditional instead of the entire Table.
  1. Click within the Table that has slipped outside of the Conditional.

    The level at which you are editing appears at the bottom of the Document Engine, as Node Selector buttons.

  2. Click < Table > to select the entire table.
  3. Select the Dynamic tab.
  4. Click the Conditional button.
  5. Enter the conditions under which you'd like the table to appear.

    Tables cannot be copied and pasted.

Notes

Page numbers can be dynamically inserted into the content of a Complex Conditional. The value of the page number within a Complex Conditional reflects the page number of the current page of the document.

Clauses within a Complex Conditional can be reordered after they have been created. Saved Complex Conditionals can be used in all documents within a Commerce Process; access them from the Complex Conditionals Library.
Content must be saved before anyone can use dynamic data, repeating sections, and rows in the Content Editor.

Complex Conditionals are shared globally across all documents.

An Always True Complex Conditional cannot be changed to one with multiple conditions after it has been created.

But, a complex conditional with one or more conditionals can be changed into an Always True complex conditional.

However, a complex conditional that has once been saved as Always True cannot be changed to one with one or more conditional blocks.

Therefore, only use the Always True option when you are sure that no conditionals will be required.

Related Topics

Related Topics Link IconSee Also