Skip to content

Instantly share code, notes, and snippets.

@rjcorwin
Created September 20, 2019 16:45
Show Gist options
  • Save rjcorwin/dac83456ef60d901c1e10b5a184e14d7 to your computer and use it in GitHub Desktop.
Save rjcorwin/dac83456ef60d901c1e10b5a184e14d7 to your computer and use it in GitHub Desktop.
// When viewing a form, the EventInstance's ID will be at position 5 in the URL hash.
const eventInstanceId = window.location.hash.split('/')[5]
// With the eventInstanceId, we can find the matching eventInstance in caseService.case.events.
const eventInstance = caseService.case.events.find(eventInstance => eventInstance.id === eventInstanceId)
// With the eventInstance handy, we can use the eventInstance.caseEventDefinitionId to find the EventDefinition inside of caseService.caseDefinition.eventDefinitions.
const eventDefinition = caseService.caseDefinition.eventDefinitions.find(eventDefinition => eventDefinition.id === eventInstance.caseEventDefinitionId)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment