Skip to content

Examples

yogeshnachnani edited this page Jun 27, 2016 · 16 revisions

The following script compiles the flux runtime.

./build.sh noTests

To run the end-to-end examples, you must have a mysql installation running on your system. To keep it simple we assume that the root user has create database privileges and works without a password. If these are not the settings on your system, please change setup_db.sh appropriately

Run the following script to setup a skeleton database for use in Flux

./setup_db.sh

Example: Concurrent execution of tasks

We've put up an example to demonstrate the power of flux to run multiple independent tasks concurrently. For this, please check out class com.flipkart.flux.examples.concurrent.EmailMarketingWorkflow

To run the class, the codebase must be built and the database setup using steps documented above. Then, you can run the class using:

cd examples
./run_example.sh com.flipkart.flux.examples.concurrent.RunEmailMarketingWorkflow

Or, simply run com.flipkart.flux.examples.concurrent.RunEmailMarketingWorkflow in your IDE


Example: Taking decisions in your workflow

We've put up an example to demonstrate how you can take decisions in your workflow. For this, please check out class com.flipkart.flux.examples.decision.UserVerificationWorkflow

To run the class, the codebase must be built and the database setup using steps documented above Then, you can run the class using:

cd examples
./run_example.sh com.flipkart.flux.examples.decision.RunUserVerificationWorkflow

Or, simply run com.flipkart.flux.examples.decision.RunUserVerificationWorkflow in your IDE


Example: Working with external events

In a lot of cases, Workflows would need to wait for external events. For example, Seller verifications would require manual intervention from the Customer Support team. Once the seller Id is generated, the workflow would essentially involve notifying customer support and waiting for them to verify the seller.

This scenario is captured in com.flipkart.flux.examples.externalevents.ManualSellerVerificationFlow

To run the class, the codebase must be built and the database setup using steps documented above Then, you can run the class using:

cd examples
./run_example.sh com.flipkart.flux.examples.externalevents.RunManualSellerVerificationWorkflow

Or, simply run com.flipkart.flux.examples.externalevents.RunManualSellerVerificationWorkflow in your IDE

Clone this wiki locally