Text Condition

Text Condition tasks can be used to perform two different types of tests:

  • To test the presence of a string within the job file. You can, for example, search for the string “Gold member” on the first line of the job file. As another example, you could search for a variable string retrieved via a job info variable or a data selection in a given location in the job file.
  • To compare two strings. As with the test above, this test can also be used to search for a string in a given location. The difference with this test is that it gives you comparison options. Using the “Contains” operator, you can test the presence of the string “Gold member” at a given location in the job file (using a data selection), but the other operators can be used to test whether or not the first string is equal to the second one, whether it is equal or lower than the second one, etc.

The logic of text conditions can sometimes be tricky, especially if it includes variable strings, so you should test it thoroughly.

Task properties

General Tab
  • String: If you want to test the presence of a given string at a given location, enter the string in this box. If you want to compare two strings or perform a numeric comparison, enter the first string in this box. Note that you can enter either a static string, a variable or a data selection in this box. If you enter a variable, PlanetPress Workflow will retrieve the string from the variable before performing the comparison. If you enter a data selection, PlanetPress Workflow will search the job file and retrieve the string found at the referenced location before performing the comparison.
  • Operator: Select the desired operator. Note that neither the “Is found” nor the “Is not found” operator can be used to test XML data.
  • Convert data to uppercase before comparison: This option is only displayed when either “Is found” or “Is not found” is selected in the Operator box. Select to prompt PlanetPress Workflow to convert the string to uppercase before performing the comparison.
  • Numeric comparison: This option is not displayed when either “Is found” or “Is not found” is selected in the Operator box. Select to convert the strings from the String and Comparison string boxes to their corresponding numeric values before performing the comparison. If you chose an operator that compares numeric values, you should select this option.
  • On numeric error: This option is only available when the Numeric comparison option is selected. Select the behavior you prefer when PlanetPress Workflow is unable to successfully perform a numeric comparison. Select ”Return the error”, if you want the Text condition to fail altogether. Select ”Return true”, if you want the condition to be considered True. Select ”Return false”, if you want the condition to be considered False.
  • Location: You can only enter a location when either ”Is found” or ”Is not found” is selected in the Operator box. If you select “at”, you also have to enter a specific line and column. If you select “on line”, you have to enter a given line. If you select “in area”, you have to enter a range of lines and columns. If you select “on the page”, the search area will cover the whole data page (as defined below).
  • Compare to string: You cannot enter a comparison string when either “Is found” or “Is not found” is selected in the Operator box. Enter the second string of the comparison in this box. As with the String box, you can enter a static string, a variable or a data selection in this box.
  • Page range: Select Any page if you do not want to specify a precise data page. Select Pages to specify individual pages or page ranges. The page range setting is only considered when either ”Is found” or ”Is not found” is selected in the Operator box.
  • Range: Entries must be separated by commas. Page ranges are entered using a starting page and an ending page, separated by a dash. For pages 1, 3 and 5 to 7, you would enter the following: 1,3,5-7.
  • Invert condition result: Select to toggle the result of the condition (true becomes false and vice versa).

On Error Tab

For a description of the options on the On Error tab see Using the On Error tab.

Miscellaneous Tab

The Miscellaneous tab is common to all tasks.

It contains a text area (Task comments) that lets you write comments about the task. These comments are saved when the dialog is closed with the OK button and are displayed in The Task Comments Pane.

Check the option Use as step description to display the text next to the icon of the plugin in the Process area.

The tab also provides an option to highlight the task in The Process area with the default color, set in the Preferences (see Colors), or the color selected or defined under Highlight color on this tab.
To revert the selected highlight color to the default color, open this tab, turn the Highlight option off and close the dialog with the OK button; then turn highlighting back on.
Highlighting can also be turned on and off via the task's contextual menu and with the Highlight button on the View ribbon.