In this scenario we demonstrate how to use conditional flows.
Link to a screencast of this quickstart on our youtube channel:
<<Click to Play>>
Here we describe using the export so you can get a feel for how things work quickly. If you want to set up your own flows you can follow the video tutorial from above. In the Syndesis UI navigate to Integrations
and click on the Import
button in the right top corner. Now you can select the conditional-export.zip file and start the import.
You can start create a db-2-log flow, using Select * from todo
. Next, add a splitter so that each record turns into message as conditional flows work on single messages. After the splitter is inserted you can now add a Condition Flow
.
Figure 1. Adding Splitter and Conditional Flows
Create a condition for task contains dog
and task contains cat
as well as a default flow.
Figure 2. Main Flow with subflows
Log into the SampleDB using
oc rsh syndesis-db-<name>
psql -Usampledb
insert into todo values (1, "Walk the dog!",0);
insert into todo values (2, "Feed the cat!",0);
insert into todo values (3, "Watch Lucifer Morningstar on Netflix!");
Now in the Activity view we should now see messages being split and processed. You should see the printout DOG FLOW
for tasks containing dog
and CAT FLOW
for tasks containing cat
.
- We learned to use the Splitter
- We learned to use Conditional Flows