Last active
July 4, 2018 00:25
Revisions
-
adamchester revised this gist
Feb 24, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ type State = Initial | Draft | PendingApproval | Approved | Cancelled | Completed type Action = Create | Cancel | SendForApproval | Approve | Reject | Complete type Role = Creator | Approver | Completor type Transition = { Action:Action; From:State; To:State; Roles:Role list } module Transitions = -
adamchester revised this gist
Feb 24, 2015 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,7 +13,6 @@ module Transitions = Transitions.all |> List.mapi (fun i t -> i, t.Action, t.From, t.To, t.Roles) (* val it : (int * Action * State * State * Role list) list = -
adamchester revised this gist
Feb 24, 2015 . 1 changed file with 6 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -17,9 +17,10 @@ Transitions.all (* val it : (int * Action * State * State * Role list) list = [(0, Create, Initial, Draft, [Creator]); (1, SendForApproval, Draft, PendingApproval, [Creator]); (2, Approve, PendingApproval, Approved, [Approver]); (3, Reject, PendingApproval, Draft, [Approver]); (4, Complete, Approved, Completed, [Completor]); (5, Cancel, Draft, Cancelled, [Creator])] *) -
adamchester revised this gist
Feb 24, 2015 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,15 +1,15 @@ type State = Initial | Draft | PendingApproval | Approved | Cancelled | Completed type Action = | Create | Cancel | SendForApproval | Approve | Reject | Complete type Role = Creator | Approver | Completor type Transition = { Action:Action; From:State; To:State; Roles:Role list } module Transitions = let create = { Action=Create; From=Initial; To=Draft; Roles=[ Creator ] } let cancel = { Action=Cancel; From=Draft; To=Cancelled; Roles=[ Creator ] } let sendForAppr = { Action=SendForApproval; From=Draft; To=PendingApproval; Roles=[ Creator ] } let approve = { Action=Approve; From=PendingApproval; To=Approved; Roles=[ Approver ] } let reject = { Action=Reject; From=PendingApproval; To=Draft; Roles=[ Approver ] } let complete = { Action=Complete; From=Approved; To=Completed; Roles=[ Completor ] } let all = [ create; sendForAppr; approve; reject; complete; cancel; ] Transitions.all |> List.mapi (fun i t -> i, t.Action, t.From, t.To, t.Roles) -
adamchester revised this gist
Feb 24, 2015 . 1 changed file with 10 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,17 +1,19 @@ type State = Initial | Draft | PendingApproval | Approved | Cancelled | Completed type Action = | Create | Cancel | SendForApproval | Approve | Reject | Complete type Role = Creator | Approver | Completor type Transition = { Action:Action; From:State; To:State; Roles:Role list } module Transitions = let create = { Action=Create; From=Initial; To=Draft; Roles=[ Creator ] } let sendForAppr = { Action=SendForApproval; From=Draft; To=PendingApproval; Roles=[ Creator ] } let approve = { Action=Approve; From=PendingApproval; To=Approved; Roles=[ Approver ] } let reject = { Action=Reject; From=PendingApproval; To=Draft; Roles=[ Approver ] } let complete = { Action=Complete; From=Approved; To=Completed; Roles=[ Completor ] } let all = [ create; sendForAppr; approve; reject; complete ] Transitions.all |> List.mapi (fun i t -> i, t.Action, t.From, t.To, t.Roles) |> printfn "%A" (* val it : (int * Action * State * State * Role list) list = -
adamchester created this gist
Feb 24, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ type State = Initial | Draft | PendingApproval | Approved | Cancelled | Completed type Action = Create | Cancel | SendForApproval | Approve | Reject | Complete type Role = Creator | Approver | Completor type Transition = { Action:Action; From:State; To:State; Roles:Role list } let myWorkflow = [ { Action=Create; From=Initial; To=Draft; Roles=[ Creator ] } { Action=SendForApproval; From=Draft; To=PendingApproval; Roles=[ Creator ] } { Action=Approve; From=PendingApproval; To=Approved; Roles=[ Approver ] } { Action=Reject; From=PendingApproval; To=Draft; Roles=[ Approver ] } { Action=Complete; From=Approved; To=Completed; Roles=[ Completor ] } ] myWorkflow |> List.mapi (fun i t -> i, t.Action, t.From, t.To, t.Roles) (* val it : (int * Action * State * State * Role list) list = [(0, Create, Initial, Draft, [Creator]); (1, SendForApproval, Draft, PendingApproval, [Creator]); (2, Approve, PendingApproval, Approved, [Approver]); (3, Reject, PendingApproval, Draft, [Approver]); (4, Complete, Approved, Completed, [Completor])] *)