flowon failurefmla_request v1fmla_request.flow · dandori doc
An employee asks for FMLA leave: the eligibility notice, the certification, the designation, and the leave held in the book until it is taken. From 29 CFR 825.300 and 825.305
flowon failure| Line | Call | Calls | Retries | Timeout | When it fails | Case after |
|---|---|---|---|---|---|---|
| 97 | e = eligibility(…) | rule fmla_eligibility.rule | 2 times, after 1 second and 2 (failure, timeout) | 10 seconds | timeout, failure → on failure | — |
| 98 | notice = deadlines.notice(…) | the date notice of fmla_deadlines.cal | 2 times, after 1 second and 2 (failure, timeout) | 10 seconds | timeout, failure → on failure | — |
| 99 | give_eligibility_notice(…) | a task you write, idempotent | — | — | timeout, failure → on failure | — |
| 103 | asked = deadlines.certification(…) | the date certification of fmla_deadlines.cal | 2 times, after 1 second and 2 (failure, timeout) | 10 seconds | timeout, failure → on failure | — |
| 104 | c = get_certification(…) | a task you write, answered by a callback | — | 1 minute to hand the id on | timeout, failure → on failure | — |
| 105 | designation = deadlines.notice(…) | the date notice of fmla_deadlines.cal | 2 times, after 1 second and 2 (failure, timeout) | 10 seconds | timeout, failure → on failure | — |
| 108 | give_notice_of_no_designation(…) | a task you write, idempotent | — | — | timeout, failure → on failure | — |
| 111 | limit = entitlement(…) | rule fmla_entitlement.rule | 2 times, after 1 second and 2 (failure, timeout) | 10 seconds | timeout, failure → on failure | — |
| 112 | open_period(…) | book leave.entitle.do | — | — | key_conflict → line 113timeout, failure → on failure | — |
| 114 | hold ← hold_leave(…) | book leave.designate.hold, starts leave.designate | — | — | not_enough_leave → line 115timeout, failure → on failure | hold: held |
| 116 | give_notice_of_no_designation(…) | a task you write, idempotent | — | — | timeout, failure → on failure | — |
| 118 | give_designation_notice(…) | a task you write, idempotent | — | — | timeout, failure → on failure | — |
| 119 | ended = wait_for_the_end_of_leave(…) | a task you write, answered by a callback | — | 1 minute to hand the id on | timeout, failure → on failure | — |
| 122 | hold ← take_leave(…) | book leave.designate.post, sends post | — | — | timeout, failure → on failure | hold: posted |
| 125 | hold ← release_leave(…) | book leave.designate.void, sends void | — | — | already_posted, timeout, failure → on failure | hold: voided |
| 132 | hold ← release_leave(…) | book leave.designate.void, sends void | — | — | already_posted → line 133timeout, failure → line 134 | hold: voided |
| Line | End | hold |
|---|---|---|
| 101 | succeed outcome = not_eligible | not started |
| 109 | succeed outcome = no_certification | not started |
| 117 | succeed outcome = not_enough_leave | not started |
| 123 | succeed outcome = taken | posted |
| 126 | succeed outcome = not_taken | voided |
| 134 | fail NotReleased "the leave held for the request could not be released" leaving hold | handed over as it is: held, posted, voided |
| 134 | on failure runs to its end, and the workflow fails with the error that started it | not started, or posted, voided |
Pick a step to see what the checker knows there. Pick a scenario on the left to light up the way its run goes; the number beside a step is how often the run passes it.
fmla_request v1An employee asks for FMLA leave: the eligibility notice, the certification, the designation, and the leave held in the book until it is taken. From 29 CFR 825.300 and 825.305
request: Requestoutcome: Outcomefmla_request.flowe = eligibility(…) line 97 97 let e = eligibility(months_employed: request.months_employed, hours_of_service: request.hours_of_service, employees_within_75_miles: request.employees_within_75_miles)
hold: not startedfmla_eligibility.ruletimeout, failure → on failure 8 use rule eligibility from "fmla_eligibility.rule"
notice = deadlines.notice(…) line 98 98 let notice = deadlines.notice(counted_from: request.given_on)
hold: not startednotice of fmla_deadlines.caltimeout, failure → on failure 10 use dates deadlines from "fmla_deadlines.cal"
give_eligibility_notice(…) line 99 99 give_eligibility_notice(request: request.id, eligible: e.eligible, why_not: e.why_not, by: notice.day)
hold: not startedidempotenttimeout, failure → on failure45 # 825.300(b)(1), and (b)(2) for the reason when the employee is not eligible. 825.300(c)(1): the notice of 46 # rights and responsibilities goes each time this one does. 47 task give_eligibility_notice(request: string, eligible: bool, why_not: eligibility.why_not, by: date) 48 queue "fmla-notices" 49 idempotent
match e.eligible line 100100 match e.eligible 101 false => succeed outcome = not_eligible 102 true => pass
hold: not startedsucceed outcome = not_eligible line 101 101 false => succeed outcome = not_eligible
hold: not startedhold: not startedasked = deadlines.certification(…) line 103 103 let asked = deadlines.certification(counted_from: request.given_on)
hold: not startedcertification of fmla_deadlines.caltimeout, failure → on failure 10 use dates deadlines from "fmla_deadlines.cal"
c = get_certification(…) line 104 104 let c = get_certification(request: request.id, by: asked.day)
hold: not startedtimeout, failure → on failure51 # 825.305(a): an employer may require a certification, and when it does not, the tool answers at once with 52 # the day the request was given. 825.305(b): the employer asks when the employee gives notice or within 53 # five business days, and this flow counts from the first of those days. The tool answers on or after the 54 # day it was due, which that paragraph moves when giving it in time is not practicable. 55 task get_certification(request: string, by: date) -> Certification 56 callback
designation = deadlines.notice(…) line 105 105 let designation = deadlines.notice(counted_from: c.enough_on)
hold: not startednotice of fmla_deadlines.caltimeout, failure → on failure 10 use dates deadlines from "fmla_deadlines.cal"
match c.provided line 106106 match c.provided 107 false => 110 true => pass
hold: not startedgive_notice_of_no_designation(…) line 108 108 give_notice_of_no_designation(request: request.id, because: no_certification, by: designation.day)
hold: not startedidempotenttimeout, failure → on failure76 # 825.300(d)(1): an employer who will not designate the leave must say so. 77 task give_notice_of_no_designation(request: string, because: NoDesignation, by: date) 78 queue "fmla-notices" 79 idempotent
succeed outcome = no_certification line 109 109 succeed outcome = no_certification
hold: not startedhold: not startedlimit = entitlement(…) line 111 111 let limit = entitlement(reason: request.reason, usual_week: request.usual_week)
hold: not startedfmla_entitlement.ruletimeout, failure → on failure 9 use rule entitlement from "fmla_entitlement.rule"
open_period(…) line 112112 open_period(employee: request.employee, period: request.period, minutes: limit.entitled) 113 on key_conflict => pass
hold: not startedbook leave.entitle.dokey_conflict → line 113timeout, failure → on failure58 # The first request of a period opens it with what its reason gives. A later one that would open it with 59 # another amount leaves it as it is: the book holds one limit for a period, and an employer names the 60 # single 12-month period of 825.200(f), for a covered servicemember's care, as a period of its own. 61 task open_period(employee: string, period: string, minutes: duration[min]) 62 book leave.entitle.do 63 errors key_conflict
hold ← hold_leave(…) line 114114 hold <- hold_leave(request: request.id, employee: request.employee, period: request.period, minutes: request.minutes) 115 on not_enough_leave =>
hold: not startedbook leave.designate.hold, starts leave.designatenot_enough_leave → line 115timeout, failure → on failurehold: held65 # A request for more than is left is refused whole: an employer who designates what is left asks for that. 66 task hold_leave(request: string, employee: string, period: string, minutes: duration[min]) -> leave.designate 67 book leave.designate.hold 68 starts leave.designate 69 errors not_enough_leave
give_notice_of_no_designation(…) line 116 116 give_notice_of_no_designation(request: request.id, because: not_enough_leave, by: designation.day)
hold: not startedidempotenttimeout, failure → on failure76 # 825.300(d)(1): an employer who will not designate the leave must say so. 77 task give_notice_of_no_designation(request: string, because: NoDesignation, by: date) 78 queue "fmla-notices" 79 idempotent
succeed outcome = not_enough_leave line 117 117 succeed outcome = not_enough_leave
hold: not startedhold: not startedgive_designation_notice(…) line 118 118 give_designation_notice(request: request.id, minutes: request.minutes, by: designation.day)
hold: heldidempotenttimeout, failure → on failure71 # 825.300(d)(1), and (d)(6) for the amount that will be counted. 72 task give_designation_notice(request: string, minutes: duration[min], by: date) 73 queue "fmla-notices" 74 idempotent
ended = wait_for_the_end_of_leave(…) line 119 119 let ended = wait_for_the_end_of_leave(request: request.id)
hold: heldtimeout, failure → on failure81 # Someone says in a tool of their own that the leave has ended, and how much of it was taken. 82 task wait_for_the_end_of_leave(request: string) -> LeaveEnded 83 callback
match ended.taken line 120120 match ended.taken 121 true => 124 false =>
hold: heldhold ← take_leave(…) line 122 122 hold <- take_leave(request: request.id, minutes: ended.minutes)
hold: heldbook leave.designate.post, sends posttimeout, failure → on failurehold: posted85 task take_leave(request: string, minutes: duration[min]) -> leave.designate 86 book leave.designate.post 87 sends post
succeed outcome = taken line 123 123 succeed outcome = taken
hold: postedhold: postedhold ← release_leave(…) line 125 125 hold <- release_leave(request: request.id)
hold: heldbook leave.designate.void, sends voidalready_posted, timeout, failure → on failurehold: voided89 task release_leave(request: string) -> leave.designate 90 book leave.designate.void 91 sends void 92 errors already_posted
succeed outcome = not_taken line 126 126 succeed outcome = not_taken
hold: voidedhold: voidedend: succeedsThe flow runs to its end, and the workflow succeeds.
on failure line 128Runs when a call fails and nothing at the call handles the error. When it runs to its end, the workflow fails with that error. It comes here from the calls on lines 97, 98, 99, 103, 104, 105, 108, 111, 112, 114, 116, 118, 119, 122 and 125.
match hold.state line 129129 match hold.state 130 none => pass 131 held =>
hold: not started, or held, posted, voidedhold ← release_leave(…) line 132132 hold <- release_leave(request: request.id) 133 on already_posted => pass 134 on failure => fail NotReleased "the leave held for the request could not be released" leaving hold
hold: held, posted, voidedbook leave.designate.void, sends voidalready_posted → line 133timeout, failure → line 134hold: voided89 task release_leave(request: string) -> leave.designate 90 book leave.designate.void 91 sends void 92 errors already_posted
fail NotReleased line 134 134 on failure => fail NotReleased "the leave held for the request could not be released" leaving hold
hold: held, posted, voidedhold: handed over as it is: held, posted, voidedfails with the same erroron failure runs to its end, and the workflow fails with the error that started it.
hold: not started, or posted, voidede = eligibility(…) oknotice = deadlines.notice(…) okgive_eligibility_notice(…) okmatch e.eligible → falsesucceed outcome = not_eligiblee = eligibility(…) oknotice = deadlines.notice(…) okgive_eligibility_notice(…) failure → not handled hereon failurematch hold.state → nonee = eligibility(…) oknotice = deadlines.notice(…) okgive_eligibility_notice(…) okmatch e.eligible → trueasked = deadlines.certification(…) okc = get_certification(…) okdesignation = deadlines.notice(…) okmatch c.provided → truelimit = entitlement(…) okopen_period(…) okhold ← hold_leave(…) okgive_designation_notice(…) okended = wait_for_the_end_of_leave(…) okmatch ended.taken → truehold ← take_leave(…) oksucceed outcome = takene = eligibility(…) oknotice = deadlines.notice(…) okgive_eligibility_notice(…) okmatch e.eligible → trueasked = deadlines.certification(…) okc = get_certification(…) failure → not handled hereon failurematch hold.state → nonee = eligibility(…) oknotice = deadlines.notice(…) okgive_eligibility_notice(…) okmatch e.eligible → trueasked = deadlines.certification(…) okc = get_certification(…) oke = eligibility(…) oknotice = deadlines.notice(…) okgive_eligibility_notice(…) okmatch e.eligible → trueasked = deadlines.certification(…) okc = get_certification(…) oke = eligibility(…) oknotice = deadlines.notice(…) okgive_eligibility_notice(…) okmatch e.eligible → trueasked = deadlines.certification(…) okc = get_certification(…) okdesignation = deadlines.notice(…) okmatch c.provided → falsegive_notice_of_no_designation(…) oksucceed outcome = no_certificatione = eligibility(…) oknotice = deadlines.notice(…) okgive_eligibility_notice(…) okmatch e.eligible → trueasked = deadlines.certification(…) okc = get_certification(…) okdesignation = deadlines.notice(…) okmatch c.provided → truelimit = entitlement(…) okopen_period(…) okhold ← hold_leave(…) okgive_designation_notice(…) failure → not handled hereon failurematch hold.state → heldhold ← release_leave(…) oke = eligibility(…) oknotice = deadlines.notice(…) okgive_eligibility_notice(…) okmatch e.eligible → trueasked = deadlines.certification(…) okc = get_certification(…) okdesignation = deadlines.notice(…) okmatch c.provided → truelimit = entitlement(…) okopen_period(…) key_conflict → on key_conflicthold ← hold_leave(…) okgive_designation_notice(…) okended = wait_for_the_end_of_leave(…) failure → not handled hereon failurematch hold.state → heldhold ← release_leave(…) oke = eligibility(…) oknotice = deadlines.notice(…) okgive_eligibility_notice(…) okmatch e.eligible → trueasked = deadlines.certification(…) okc = get_certification(…) okdesignation = deadlines.notice(…) okmatch c.provided → truelimit = entitlement(…) okopen_period(…) okhold ← hold_leave(…) okgive_designation_notice(…) okended = wait_for_the_end_of_leave(…) oke = eligibility(…) oknotice = deadlines.notice(…) okgive_eligibility_notice(…) okmatch e.eligible → trueasked = deadlines.certification(…) okc = get_certification(…) okdesignation = deadlines.notice(…) okmatch c.provided → truelimit = entitlement(…) okopen_period(…) okhold ← hold_leave(…) okgive_designation_notice(…) okended = wait_for_the_end_of_leave(…) oke = eligibility(…) oknotice = deadlines.notice(…) okgive_eligibility_notice(…) okmatch e.eligible → trueasked = deadlines.certification(…) okc = get_certification(…) okdesignation = deadlines.notice(…) okmatch c.provided → truelimit = entitlement(…) okopen_period(…) okhold ← hold_leave(…) okgive_designation_notice(…) okended = wait_for_the_end_of_leave(…) okmatch ended.taken → falsehold ← release_leave(…) oksucceed outcome = not_takene = eligibility(…) oknotice = deadlines.notice(…) okgive_eligibility_notice(…) okmatch e.eligible → trueasked = deadlines.certification(…) okc = get_certification(…) okdesignation = deadlines.notice(…) okmatch c.provided → truelimit = entitlement(…) okopen_period(…) okhold ← hold_leave(…) okgive_designation_notice(…) okended = wait_for_the_end_of_leave(…) okmatch ended.taken → truehold ← take_leave(…) Dandori.Failure.over_hold → not handled hereon failurematch hold.state → heldhold ← release_leave(…) oke = eligibility(…) oknotice = deadlines.notice(…) okgive_eligibility_notice(…) okmatch e.eligible → trueasked = deadlines.certification(…) okc = get_certification(…) okdesignation = deadlines.notice(…) okmatch c.provided → falsegive_notice_of_no_designation(…) failure → not handled hereon failurematch hold.state → nonee = eligibility(…) oknotice = deadlines.notice(…) okgive_eligibility_notice(…) okmatch e.eligible → trueasked = deadlines.certification(…) okc = get_certification(…) okdesignation = deadlines.notice(…) okmatch c.provided → truelimit = entitlement(…) okopen_period(…) okhold ← hold_leave(…) not_enough_leave → on not_enough_leavegive_notice_of_no_designation(…) oksucceed outcome = not_enough_leavee = eligibility(…) oknotice = deadlines.notice(…) okgive_eligibility_notice(…) okmatch e.eligible → trueasked = deadlines.certification(…) okc = get_certification(…) okdesignation = deadlines.notice(…) okmatch c.provided → truelimit = entitlement(…) okopen_period(…) okhold ← hold_leave(…) okgive_designation_notice(…) failure → not handled hereon failurematch hold.state → heldhold ← release_leave(…) already_posted → on already_postede = eligibility(…) oknotice = deadlines.notice(…) okgive_eligibility_notice(…) okmatch e.eligible → trueasked = deadlines.certification(…) okc = get_certification(…) okdesignation = deadlines.notice(…) okmatch c.provided → truelimit = entitlement(…) okopen_period(…) okhold ← hold_leave(…) okgive_designation_notice(…) okended = wait_for_the_end_of_leave(…) failure → not handled hereon failurematch hold.state → heldhold ← release_leave(…) oke = eligibility(…) oknotice = deadlines.notice(…) okgive_eligibility_notice(…) okmatch e.eligible → trueasked = deadlines.certification(…) okc = get_certification(…) okdesignation = deadlines.notice(…) okmatch c.provided → truelimit = entitlement(…) okopen_period(…) okhold ← hold_leave(…) okgive_designation_notice(…) okended = wait_for_the_end_of_leave(…) okmatch ended.taken → falsehold ← release_leave(…) already_posted → not handled hereon failurematch hold.state → heldhold ← release_leave(…) already_posted → on already_postede = eligibility(…) oknotice = deadlines.notice(…) okgive_eligibility_notice(…) okmatch e.eligible → trueasked = deadlines.certification(…) okc = get_certification(…) okdesignation = deadlines.notice(…) okmatch c.provided → truelimit = entitlement(…) okopen_period(…) okhold ← hold_leave(…) not_enough_leave → on not_enough_leavegive_notice_of_no_designation(…) failure → not handled hereon failurematch hold.state → nonee = eligibility(…) oknotice = deadlines.notice(…) okgive_eligibility_notice(…) okmatch e.eligible → trueasked = deadlines.certification(…) okc = get_certification(…) okdesignation = deadlines.notice(…) okmatch c.provided → truelimit = entitlement(…) okopen_period(…) okhold ← hold_leave(…) okgive_designation_notice(…) okended = wait_for_the_end_of_leave(…) okmatch ended.taken → falsehold ← release_leave(…) oksucceed outcome = not_takene = eligibility(…) oknotice = deadlines.notice(…) okgive_eligibility_notice(…) okmatch e.eligible → trueasked = deadlines.certification(…) okc = get_certification(…) okdesignation = deadlines.notice(…) okmatch c.provided → truelimit = entitlement(…) okopen_period(…) okhold ← hold_leave(…) okgive_designation_notice(…) okended = wait_for_the_end_of_leave(…) okmatch ended.taken → truehold ← take_leave(…) Dandori.Failure.already_voided → not handled hereon failurematch hold.state → heldhold ← release_leave(…) oke = eligibility(…) oknotice = deadlines.notice(…) okgive_eligibility_notice(…) okmatch e.eligible → trueasked = deadlines.certification(…) okc = get_certification(…) okdesignation = deadlines.notice(…) okmatch c.provided → truelimit = entitlement(…) okopen_period(…) okhold ← hold_leave(…) okgive_designation_notice(…) okended = wait_for_the_end_of_leave(…) okmatch ended.taken → truehold ← take_leave(…) Dandori.Failure.key_conflict → not handled hereon failurematch hold.state → heldhold ← release_leave(…) already_posted → on already_postede = eligibility(…) oknotice = deadlines.notice(…) okgive_eligibility_notice(…) okmatch e.eligible → trueasked = deadlines.certification(…) okc = get_certification(…) okdesignation = deadlines.notice(…) okmatch c.provided → truelimit = entitlement(…) okopen_period(…) okhold ← hold_leave(…) okgive_designation_notice(…) okended = wait_for_the_end_of_leave(…) okmatch ended.taken → truehold ← take_leave(…) oksucceed outcome = taken