Syntax FACTORY_DEF TestFactory [FACTORY_NAME ] [INPUT FEATURE_TYPE [ ]* []*]* [TEST_GROUP] [TEST [ENCODED]]+ [STRING_TEST [ENCODED]]+ [CASE_SENSITIVE_TEST [ENCODED]]+ [CASE_INSENSITIVE_TEST [ENCODED]]+ [DATETIME_TEST [ENCODED]]+ [BOOLEAN_OPERATOR (AND|OR)] [PASSED_TEST_GROUP_OUTPUT (FIRST|ALL)] [OUTPUT (PASSED|PASSED_n|FAILED) FEATURE_TYPE [ ]* []*]* Overview This factory takes a feature and performs the tests defined by the TEST clauses. If the result of the tests is true, then the feature will be output using the PASSED tag. If the result is false, then the feature will be output by the FAILED tag. If the PASSED clause is not specified, then features that pass the test will be destroyed. If the FAILED clause is not specified, then features that fail the test will be destroyed. Either PASSED or FAILED must be present. The is one of <, >, =, ==, !=, >=, or <=. The may be a literal constant, an attribute name preceded by the value-of operator (&), or an attribute value function. If it is an attribute value function, the function will be executed on the current feature and the result will be used for the test. If the keyword ENCODED is included with any test, then that test's s are expected to be FMEParsableText-encoded, and will be decoded prior to test execution. Example TEST clauses include: TEST @Area() < 100 TEST &numLanes > 2 STRING_TEST "Joe" = "Jerry" At run-time the TestFactory decides to invoke numeric comparisons or string comparisons, as greater than and less than, that have different meanings depending on the type of operands. If both arguments may be converted to numbers, then numeric comparisons will be used; otherwise, string comparisons will be used. If multiple TEST or STRING_TEST clauses are present, the test will only pass if all of the TESTs are true, unless the BOOLEAN_OPERATOR OR clause is specified. (By default, the Boolean clause used between multiple tests is AND.) The STRING_TEST clause forces string comparison of the equation, and the TEST clause (which is the default) indicates that a basic evaluation of the tests is performed. Note: You cannot directly test for the value of TEST. However, you can perform the test by following the steps below: In Workbench, use an AttributeCreator to add a new attribute, and set its value to TEST. Use the value of the new attribute to test against. The TEST_GROUP clause is used to support multiple output ports. When this clause is specified, it starts a new group of tests. All the following TEST/STRING_TEST/etc clauses, plus the BOOLEAN_OPERATOR and COMPOSITE_TEST_EXPR clauses, apply to the current test group. When a feature passes a test group, it will be output via PASSED_n (where n is the 0-based index of the group). For example, the following set of clauses would specify that if attr is in the range [0, 10) it will be output via PASSED_0, and if it is in the range [20, 30) it will be output via PASSED_1: TEST_GROUP TEST @Value(attr) >= 0 TEST @Value(attr) < 10 BOOLEAN_OPERATOR AND TEST_GROUP TEST @Value(attr) >= 20 TEST @Value(attr) < 30 BOOLEAN_OPERATOR AND The PASSED_TEST_GROUP_OUTPUT clause specifies whether features should be output for the first test group they pass, or all test groups they pass. Output Tags The TestFactory supports the following output tags. PASSED Applied to features where the TEST clause is true, when no TEST_GROUP clauses are present. PASSED_n Applied to features that pass the nth TEST_GROUP. FAILED Applied to features that do not pass any tests.