Use the If/Else Block to test for a condition and only run certain Blocks depending on the results of the test.
For example, you may wish to check if accounts in your source system are still active. If they are active, update the target system, but if accounts are not active, delete them from the target instead. To accomplish this task, do the following:
Note: You can leave either the If or Else clause empty.
Note: If the condition evaluates to True, TIBCO Scribe® Online always processes the Blocks nested within the If. If the condition evaluates to False, the Blocks within the Else are processed.
Note: Depending on your requirements, you can use the Result Fields to look at the results from a previous Block, such as a Lookup Block.
After you drag and drop the If/Else Block into your Map, change the labels to add more details about the If or Else operations.
Define one or more Boolean conditions. A Boolean condition is a statement that evaluates to either true or false. For example, does the value in the Name field equal "Dave". If the value does equal "Dave" the condition is true. TIBCO Scribe® Online uses the defined condition to determine the execution of the Map.
The Conditions in the If/Else Block determine the set of Blocks to be executed. If the rule has both AND's and OR's, all of the AND's are evaluated first. In the example below there are several combinations of data values that would to evaluate to True.
And/Or |
Field |
Operator |
Value |
---|---|---|---|
|
Customers.CompanyName |
equals |
"McDonald's" |
or |
Customers.CompanyName |
equals |
"Burger King" |
and |
Customers.CreditAmount |
is greater than |
1000 |
or |
Customers.CreditAmount |
is greater than |
5000 |
These settings are interpreted by TIBCO Scribe® Online as follows:
( CompanyName = McDonalds OR (CompanyName = Burger King AND CreditAmount > 1000) OR CreditAmount > 5000)
To evaluate to TRUE, the record must meet at least one of these three conditions:
If there are any errors or warnings for this Block, the Errors and Warnings tab displays the number of errors or warnings in the tab name. See Block And Map Errors And Warnings.
Once you have corrected the errors, select the Validate button to update the Errors and Warnings tab.