OpenWorkflow Documentation

OpenWorkflow is a suite of development tools to facilitate the creation and implementation of Wearable Cognitive Assistants (WCA). They key idea of OpenWorkflow is to represent WCA application logic as a finite state machine (FSM). You can read more about the fast prototyping methodology of OpenWorkflow in this document (Section 6.2).

OpenWorkflow provides the following tools.

  • gabrieltool: A Python library to create and persist finite state machine based wearable cognitive assistants.
  • OpenWorkflow State Machine Web Editor: A browser-based GUI to view and edit state machines.
  • gabrieltool CLI (gbt): A command-line tool to launch a gabriel server given an FSM.

Installation

gabrieltool Python Library

First, make sure Docker is installed. You can follow the Docker installation guide.

Option 1. From PyPI (recommended)

$ pip install -U gabrieltool

Option 2. From Source

$ git clone https://github.com/cmusatyalab/OpenWorkflow.git
$ cd OpenWorkflow/
$ python setup.py install

OpenWorkflow State Machine Web Editor

Visit https://cmusatyalab.github.io/OpenWorkflow. Or You can download the build from the repo’s gh-pages branch and open the index.html.

Quickstart

Python Library gabrieltool

Create a Two State FSM

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
 from gabrieltool.statemachine import fsm, predicate_zoo, processor_zoo

 # create a two state state machine
 st_start = fsm.State(
     name='start',
     processors=[fsm.Processor(
         name='proc_start',
         callable_obj=processor_zoo.DummyCallable()
     )],
     transitions=[
         fsm.Transition(
             name='tran_start_to_end',
             predicates=[
                 fsm.TransitionPredicate(
                     callable_obj=predicate_zoo.Always()
                 )
             ]
         )
     ]
 )
 st_end = fsm.State(
     name='end'
 )
 st_start.transitions[0].next_state = st_end

Save the FSM to a file

1
2
3
4
5
6
 # save to disk
 with open('simple.pbfsm', 'wb') as f:
     f.write(fsm.StateMachine.to_bytes(
         name='simple_fsm',
         start_state=st_start
     ))

Launch a gabriel server using the FSM.

$ gbt run ./simple.pbfsm

See Tutorial for a detailed example.

OpenWorkflow State Machine Editor

The editor is hosted at https://cmusatyalab.github.io/OpenWorkflow/. An instruction video is available here.

This web editor provides the following functionalities.

  1. Import to view a saved FSM file. This FSM file can be created either from gabrieltool or from the web editor.
  2. Export a FSM to a file.
  3. Edit FSM states and transitions. Note that only supported operations from processor_zoo and predicate_zoo can be edited. Custom defined functions can not be created or modified in the web editor.

Compared to the gabrieltool Python library, the web editor provides better visualization and is great for creating small FSMs. For more complicated FSMs, consider using the gabrieltool for better reproducibility and efficiency.

Gabrieltool CLI (gbt)

The gabrieltool cli (gbt) provides a convenient method to launch a gabriel server given an FSM, created by the python library or the web editor.

$ gbt run <path-to-fsm>
$ # for usage details, see gbt -h

Indices and tables