Skip to content

Instantly share code, notes, and snippets.

@menski
Created July 21, 2014 07:22
Show Gist options
  • Save menski/cc5789441ad35f3b5445 to your computer and use it in GitHub Desktop.
Save menski/cc5789441ad35f3b5445 to your computer and use it in GitHub Desktop.
Roll the dice
<bpmn2:exclusiveGateway id="gateway" name="Dice">
<bpmn2:extensionElements>
<camunda:executionListener event="start">
<!-- script as execution listener -->
<camunda:script scriptFormat="groovy">
aNumber = new Random().nextInt(6) + 1
println "$aNumber was diced"
execution.setVariable('aNumber', aNumber)
</camunda:script>
</camunda:executionListener>
</bpmn2:extensionElements>
</bpmn2:exclusiveGateway>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment