Skip to content
This repository has been archived by the owner on Apr 27, 2021. It is now read-only.
/ flows Public archive

Repository for definition and runner for RapidPro flow engine.

License

Notifications You must be signed in to change notification settings

rapidpro/flows

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RapidPro Flows

Java implementation of the RapidPro flow engine.

Usage

Org org = new Org("RW", "eng", ZoneId.of("Africa/Kigali"), DateStyle.DAY_FIRST, false);
List<Field> fields = new ArrayList();
Contact contact = new Contact(...);
Flow flow = Flow.fromJson("...");

Runner runner = new RunnerBuilder()
    .withLocationResolver(...)
    .build();

RunState run = runner.start(org, fields, contact, flow);

List<Step> steps = run.getCompletedSteps();
List<Field> fieldsToCreate = run.getCreatedFields();

runner.resume(run, Input.of("Yes"));

String json = run.toJson(); // run state can be serialized as JSON

RunState restored = RunState.fromJson(json, flow); // and then de-serialized when needed

runner.resume(run, Input.of(123));

Notes

For use on Android, replace regular ThreeTen dependency with https://github.com/JakeWharton/ThreeTenABP

About

Repository for definition and runner for RapidPro flow engine.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages