The “Filter” node is the simplest of the routing nodes and provides a simple “If-Then-Else” routing mechanism within a Message Flow. The “Filter” node is an ESQL node. The ESQL executed in this node must terminate with an ESQL RETURN statement. This statement must return a Boolean value. The route taken from this node depends upon the value of the RETURN statement.
This node has four output terminals. These terminals are:
- Failure (A failure in the ESQL code)
- True (ESQL code returns a “True” value)
- False (ESQL code returns a “False” value)
- Unknown (ESQL code returns a “NULL” value or does not “RETURN” a boolean)
You must use these different correlation names because there is only one message to which to refer in a Database or Filter node; you cannot create an output message in these nodes. Use a Compute node to create an output message.
Example:
CREATE FILTER MODULE HTTPInputMessageFlow_Filter
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
DECLARE space1 NAMESPACE 'namespace1';
IF Body.space1:root.space1:example = 'ABCDE' THEN
RETURN TRUE;
ELSE
RETURN FALSE;
END IF;
END;
END MODULE;