If/Else Examples
This first example shows a mashup with very simple if/else logic based on the incident type for traffic issues:
The"if clause" consists of a single Transformer block that executes if there is at least one issue from construction and builds the mashup result from those issues.
The"else clause" also consists of one Transformer block that executes if there are no issues from construction and builds somewhat different results.
Only one of the Transformer blocks will execute when the mashup is run, so the Merge block simply makes sure that the results that are actually generated become the mashup results.
The next example has multiple conditions based on a user selecting either one of three specific job types or selecting no job type.
There are three"if clauses" which consist of a Filter block to filter the list of jobs to jobs of a type that matches the input parameter. The execution conditions for each Filter block check to see if the value of the input parameter matches the job type for this Filter block. If so, the filter executes.
The"else" clause is the final Filter block. In this case, the execute condition for this Filter block tests to make sure that the value of the input parameter is not one of the three job types covered by the other Filter blocks.
Merge makes sure that the results from whichever Filter block actually executes is used and this becomes the input to a calculation. The final output of the mashup is built in the Document block, mapping fields to the various calculations.