wf = add_workflow(u'Applications workflow', 'Application')
rcvd = wf.add_state(_('received'), initial=True)
schd = wf.add_state(_('interview scheduling'))
plan = wf.add_state(_('interview planned'))
deci = wf.add_state(_('decision pending'))
nrej = wf.add_state(_('notify reject'))
nacp = wf.add_state(_('notiy accept'))
recp = wf.add_state(_('recruitment pending'))
recd = wf.add_state(_('recruited'))
rejt = wf.add_state(_('rejected'))
canc = wf.add_state(_('canceled'))

wf.add_transition(_('cancel application'), (rcvd, schd, plan, deci, nrej, nacp, recp),  canc)
wf.add_transition(_('schedule interview'), (rcvd, deci), schd)
wf.add_transition(_('reject application'), (rcvd, deci), nrej)
wf.add_transition(_('accept application'), (deci,), nacp)
wf.add_transition(_('send negative answer'), (nrej,), rejt)
wf.add_transition(_('accept interview'), (schd,), plan)
wf.add_transition(_('send positive answer'), (nacp,), recp)
wf.add_transition(_('recruited accepted'), (recp,), recd)
wf.add_transition(_('interview done'), (plan,), deci)

commit()
