Skip to content

Instantly share code, notes, and snippets.

@jstoppa
Created April 5, 2020 08:57
Show Gist options
  • Save jstoppa/f07236fa11fd356fd7fc535507735f8b to your computer and use it in GitHub Desktop.
Save jstoppa/f07236fa11fd356fd7fc535507735f8b to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// - XState (all XState exports)
const moveState = stateId =>
fetch(`https://jsonplaceholder.typicode.com/todos/${stateId}`).then(response => response.json());
const fetchMachine = Machine({
id: 'bpmn-test',
initial: 'task_initialmeeting',
context: {
retries: 0
},
states: {
task_initialmeeting: {
on: {
Complete: {
target: 'subprocess_kyc'
}
}
},
subprocess_kyc: {
on: {
Complete: {
target: 'task_compliance'
}
}
},
task_compliance: {
on: {
Complete: {
target: 'exclusivegateway_01'
}
}
},
exclusivegateway_01: {
on: {
Normal: {
target: 'task_selectproducts'
},
PEP: {
target: 'parallelgateway_split'
}
}
},
task_selectproducts: {
on: {
Complete: {
target: 'task_getapproval'
}
}
},
task_getapproval: {
on: {
Complete: {
target: 'exclusivegateway_02'
}
}
},
exclusivegateway_02: {
on: {
Reject: {
target: 'task_selectproducts'
},
Approve: {
target: 'subprocess_openproducts'
}
}
},
subprocess_openproducts: {
on: {
Complete: {
target: 'subprocess_funding'
}
}
},
subprocess_funding: {
on: {
Complete: {
target: 'endevent_won'
}
}
},
endevent_won: {
type: 'final'
},
parallelgateway_split: {
type: 'parallel',
states: {
Notify_FCA: {
initial: 'Notify_FCA0',
states: {
Notify_FCA0: {
on: {
Complete0: {
target: 'done0'
}
}
},
done0: {
type: 'final'
}
}
},
Get_Client_Signed_Authorisation: {
initial: 'Get_Client_Signed_Authorisation1',
states: {
Get_Client_Signed_Authorisation1: {
on: {
Complete1: {
target: 'done1'
}
}
},
done1: {
type: 'final'
}
}
}
},
onDone: '#bpmn-test.task_selectproducts'
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment