-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.ts
More file actions
48 lines (35 loc) · 1.75 KB
/
main.ts
File metadata and controls
48 lines (35 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import * as ns from "./Workflow/TickedWorkflow/TicketStateMachine";
import * as rq from "./Workflow/TickedWorkflow/Contracts/SupportRequest";
class Startup {
static stateMachine = new ns.Workflow.TicketStateMachine();
private static AccountNumber: string = "AC001";
private static CompleteWorkflow() {
let menus = Startup.stateMachine.DisplayPrimaryPath().reverse();
console.log();
console.log("------------------------------------------------------------");
console.log("Menu paths: " + menus.join(" > "));
console.log("------------------------------------------------------------");
console.log();
Startup.stateMachine.startStep.Initiate()
Startup.stateMachine.startStep.CompleteStep();
let supportRequest = new rq.Workflow.SupportRequest(this.AccountNumber);
Startup.stateMachine.startStep.Support.Transition(supportRequest);
Startup.stateMachine.supportStep.CompleteStep();
Startup.stateMachine.supportStep.SupportProductB.Transition("Ironman figurine");
Startup.stateMachine.supportProductB.CompleteStep(true);
Startup.stateMachine.DisplayRemainingWorkflow();
}
public static main(): number {
console.log('This will demo the Front End Workflow structures');
this.CompleteWorkflow();
// Show workflow in state completed
Startup.stateMachine.DisplayEntireWorkflow();
Startup.stateMachine.supportStep.CompleteStep();
// Show workflow with last step undone because of change
Startup.stateMachine.DisplayEntireWorkflow();
let stepOutputModel = Startup.stateMachine.supportStep.Model;
console.log(stepOutputModel);
return 0;
}
}
Startup.main();