diagram = SequenceDiagram([s, w, c, r])
diagram.setParam('objectSpacing', 0.5)

diagram.step()
w.active()
diagram.async()

s.message(w, 'liftReceiver')
diagram.sync()
w.message(s, 'setDialTone()')
diagram.async()
s.message(w, '*dialDigit(d)')
w.lconstraint('{dialing.executionTime < 30s}')
w.callMethod(w, 'routeCalls(s,n)')

w.createInstance(c, 'c:Convers')
c.active()
c.pushMethod(r, 'ring()')
diagram.async()
r.message(c, 'liftReceiver')
diagram.sync()
c.message(w, 'connect(r,s)')
w.message(s, 'connect(r)')
w.message(r, '')
w.lconstraint('connect(s)')

diagram.step()

# Render the diagram into an SVG file named "authentication.svg".
diagram.svg('lifelineConstraints')
# This example is drawn from the example from the UMLGraph documentation
# http://umlgraph.org/doc/uml-appa.html

from sequenceplot import SequenceObject, Placeholder, SequenceDiagram

# declare objects
e = Placeholder()
t = SequenceObject("t:thread")
o = SequenceObject(":Toolkit")
p = Placeholder()

diagram = SequenceDiagram([e, t, o, p])
diagram.setParam('objectSpacing', 1.75)

# use pushMethod() to nest activations
e.pushMethod(t, "a1: run(3)")
t.pushMethod(o, "run()")
o.callMethod(o, "callbackLoop()")

o.createInstance(p, "p:Peer")
o.callMethod(p, "handleExpose()", "", responseSync=True)
o.destroyInstance(p)

t.inactive()
o.inactive()
diagram.step(2)

# Render the diagram into an SVG file named "authentication.svg".
diagram.svg('nestedActivation')
from sequenceplot import SequenceObject, Placeholder, SequenceDiagram

# declare objects

c = SequenceObject('c:Client')
t = Placeholder()
p = SequenceObject('p:ODBCProxy')

diagram = SequenceDiagram([c, t, p])
diagram.params.boxWidth = 1.1
diagram.params.objectSpacing = 0.5

diagram.step()
c.active()
c.createInstance(t, ':Transaction')
diagram.oconstraint('{Transient}')

c.pushMethod(t, "setActions(a,d,o)")

diagram.sync()

t.message(p, 'setValues(d,3,4)')
p.active()
diagram.step()
p.inactive()

t.message(p, 'setValues(a, "CO")')
p.active()
diagram.step()
p.inactive()