ecFlow's documentation is now on readthedocs!
initial pattern, using three limits
#!/usr/bin/env python
from ecf import *

def family_limit(): return (
  Family("lim1").add(
  Inlimit("limits:total"),
  Family("limits").add(
      Defstatus("complete"),
      Limits({"total": 15, 
              "prio": 10, 
              "other": 20})),
      Family("prio").add( # top submitted first
          Inlimit("limits:prio"),

          [Family("%03d" % step).add(
              Task("process"), Edit(STEP=step)) 
           for step in xrange(0, 120+1, 3)]),

      Family("side").add( # take remaning tokens
          Inlimit("limits:other"),
          [Family("%03d" % step).add(
              Task("process"), Edit(STEP=step)) 
           for step in xrange(0, 120, 3)])))

alternatives
#!/usr/bin/env python
from ecf import *
def family_limit(): return (
  Family("lim2").add(
  Inlimit("limits:total"),

  Task("alarm").add(
    Trigger("limits:total gt 90")),

  Family("limits").add(
      Defstatus("complete"),
      Limits("total", 15)), 

  Family("side").add( # weaker above
      Trigger("limits:total le 10"),
      [Family("%03d" % step).add(
          Task("process"), Edit(STEP=step))
       for step in xrange(0, 120, 3)]),
      
  Family("prio").add( 
# favourite shall not lead weak to starve
      Trigger("limits:total le 15"),
      [Family("%03d" % step).add(
          Task("process"), Edit(STEP=step)) 
       for step in xrange(0, 120, 3)])))