kubectl port-forward svc/zeebe-cluster-zeebe-gateway 26500:26500 -n zeebe-thorbjorn # Run in a terminal of it's owncd app
bin/worker # Run in a terminal of it's own
bin/console
Order
import{Duration}from'zeebe-node'importOrderWorkflowfrom'@workflows/orderPlaced'// Will be a success :-)letorderId=1OrderWorkflow.orderPlaced({orderId,country: 'Norway'})OrderWorkflow.client.publishMessage({name: 'paymentReceived',correlationKey: orderId.toString(),timeToLive: Duration.seconds.of(60),variables: {receivedAmount: 100}})// Will fail, payment issueorderId=2OrderWorkflow.orderPlaced({orderId,country: 'Norway'})// Change order id to 3, just to make it passOrderWorkflow.client.publishMessage({name: 'paymentReceived',correlationKey: '3',timeToLive: Duration.seconds.of(60),variables: {receivedAmount: 100}})// Show business error, sending is too largeorderId=5OrderWorkflow.orderPlaced({orderId,country: 'sweden'})OrderWorkflow.client.publishMessage({name: 'paymentReceived',correlationKey: orderId.toString(),timeToLive: Duration.seconds.of(60),variables: {receivedAmount: 100}})