Skip to content

Instantly share code, notes, and snippets.

@saadshahd
Last active September 7, 2020 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saadshahd/b7566849d96676ac76bca2bd758e8f51 to your computer and use it in GitHub Desktop.
Save saadshahd/b7566849d96676ac76bca2bd758e8f51 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const statusMachine = Machine({
id: "status",
type: "parallel",
states: {
info: {
initial: "Created",
states: {
Created: {
on: {
OFFICIALLY_SCHEDULED: "OfficiallyScheduled"
}
},
OfficiallyScheduled: {
entry: ["scheduleVideo", "scheduleLineups"],
on: {
READY_FOR_COLLECTION: "ReadyForCollection"
}
},
ReadyForCollection: {
on: {
READY_FOR_IQ: "ReadyForIQ"
}
},
ReadyForIQ: {
type: "final"
}
}
},
ops: {
initial: "Unassigned",
states: {
Unassigned: {
on: {
ASSIGN: "Assigned"
}
},
Assigned: {
on: {
UNASSIGN: "Unassigned"
}
}
}
},
video: {
initial: "Unavailable",
states: {
Unavailable: {
on: {
FOUND: "Available"
}
},
Available: {
type: "final"
}
}
},
collection: {
initial: "NotStarted",
states: {
NotStarted: {
on: {
START: "Started"
}
},
Started: {
on: {
COMPLETE_TAG: "PendingValidation"
}
},
PendingValidation: {
on: {
VALIDATE: "Complete",
INVALIDATE: "Invalid",
NO_FF: "WithoutFF",
NO_LOCATION: "WithoutLocation",
NO_DIRECTION: "WithoutDirection"
}
},
WithoutLocation: {
on: {
LOCATION_ADDED: "PendingValidation"
}
},
WithoutFF: {
on: {
FF_ADDED: "PendingValidation"
}
},
WithoutDirection: {
on: {
DIRECTION_ADDED: "PendingValidation"
}
},
Invalid: {
on: {
VALIDATE: "PendingValidation"
}
},
Complete: {
type: "final"
}
}
},
qa: {
// type: 'parallel',
initial: "Unreviewed",
states: {
Unreviewed: {
on: {
FACTS_REVIEW: "FactsReviewed"
}
},
FactsReviewed: {
on: {
PASSIVE_REVIEW: "Passive",
ACTIVE_REVIEW: "Active"
}
},
Passive: {
type: "parallel",
states: {
RawData: {
initial: "NotStarted",
states: {
NotStarted: {
on: {
PASSIVE_REVIEW_RAWDATA_START: "Started"
}
},
Started: {
on: {
PASSIVE_REVIEW_RAWDATA_CHANGE: "Changed",
PASSIVE_REVIEW_RAWDATA_COMPLETE: "Completed"
}
},
Changed: {
type: "final"
},
Completed: {
type: "final"
}
}
},
Location: {
initial: "NotStarted",
states: {
NotStarted: {
on: {
PASSIVE_REVIEW_LOCATION_START: "Started"
}
},
Started: {
on: {
PASSIVE_REVIEW_LOCATION_CHANGE: "Changed",
PASSIVE_REVIEW_LOCATION_COMPLETE: "Completed"
}
},
Changed: {
type: "final"
},
Completed: {
type: "final"
}
}
},
FreezeFrame: {
initial: "NotStarted",
states: {
NotStarted: {
on: {
PASSIVE_REVIEW_FREEZEFRAME_START: "Started"
}
},
Started: {
on: {
PASSIVE_REVIEW_FREEZEFRAME_CHANGE: "Changed",
PASSIVE_REVIEW_FREEZEFRAME_COMPLETE: "Completed"
}
},
Changed: {
type: "final"
},
Completed: {
type: "final"
}
}
}
},
on: {
ACTIVE_REVIEW: "Active"
}
},
Active: {
type: "parallel",
states: {
RawData: {
initial: "NotStarted",
states: {
NotStarted: {
on: {
ACTIVE_REVIEW_RAWDATA_START: "Started"
}
},
Started: {
on: {
ACTIVE_REVIEW_RAWDATA_CHANGE: "Changed",
ACTIVE_REVIEW_RAWDATA_COMPLETE: "Completed"
}
},
Changed: {
type: "final"
},
Completed: {
type: "final"
}
}
}
}
}
}
},
importer: {
initial: "NotStarted",
states: {
NotStarted: {
on: {
START: "InProgress"
}
},
InProgress: {
on: {
SUCCESS: "Complete",
FAIL: "Failed"
}
},
Complete: {
type: "final",
on: {
UPDATE: "InProgress"
}
},
Failed: {
on: {
RETRY: "InProgress"
}
}
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment