Last active
July 10, 2020 10:28
-
-
Save blinkylights23/d6970864c106fb5e31ae27441ae59d67 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
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 characters
Machine({ | |
id: 'pub', | |
initial: 'unpublished', | |
context: { | |
arcId: null | |
}, | |
states: { | |
unpublished: { | |
on: { | |
PUBLISH: { | |
target: 'published', | |
actions: ['notifyCMC_RL', 'notifyOutbound_RL'] | |
}, | |
UNPUBLISH: 'unpublished', | |
DELETE: { | |
target: 'deleted', | |
actions: ['notifyCMC_DL', 'notifyOutbound_DL'] | |
} | |
}, | |
meta: { | |
chosunStatus: 'WT' | |
} | |
}, | |
published: { | |
on: { | |
PUBLISH: { | |
target: 'published', | |
actions: ['notifyCMC_RL', 'notifyOutbound_RL'] | |
}, | |
UNPUBLISH: { | |
target: 'unpublished', | |
actions: ['notifyCMC_WT', 'notifyOutbound_DL'] | |
}, | |
DELETE: { | |
target: 'deleted', | |
actions: ['notifyCMC_WT', 'notifyCMC_DL', 'notifyOutbound_DL'] | |
} | |
}, | |
meta: { | |
chosunStatus: 'RL' | |
} | |
}, | |
deleted: { | |
type: 'final', | |
meta: { | |
chosunStatus: 'DL' | |
} | |
} | |
}, | |
actions: { | |
notifyCMC_RL: (event, context) => { | |
console.log('Notifying CMC: RL') | |
}, | |
notifyCMC_WT: (event, context) => { | |
console.log('Notifying CMC: WT') | |
}, | |
notifyCMC_DL: (event, context) => { | |
console.log('Notifying CMC: DL') | |
}, | |
notifyOutbound_RL: (event, context) => { | |
console.log('Notifying Outbound feeds: RL') | |
}, | |
notifyOutbound_WT: (event, context) => { | |
console.log('Notifying Outbound feeds: WT') | |
}, | |
notifyOutbound_DL: (event, context) => { | |
console.log('Notifying Outbound feeds: DL') | |
} | |
}, | |
guards: {}, | |
activities: {}, | |
services: {} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment