Zeebe Message Correlation Java

We could not find any clear working example of Zeebe message correlation when we needed to implement it. After trying different things we have figured out how it works. This project simulates packaging multiple items in a order with message correlation where order id is the unique key.

  • The workflow BPMN: The BPMN file is included in the resources of the github project.

  • For single item the bottom flow gets executed based on the condition.

  • For multiple items message gets correlated in “Collect Items” Receive Task and collected item count gets incremented upon receiving a new message. It runs through the loop at the top the diagram until total number of items are received. This is implemented in the PackageItemsJobHandler of this Java project.

  • Message correlation workflow setting in the BPMN file

  • Workflow instance with 2 items to package is

  • Timeout is implemented so that it doesn’t wait in the loop forever if next messages are not sent. In this project 5 minutes is passed as timeout to Zeeke workflow. Interrupting timer boundary event is included to timeout after a duration which is provided as expression by accessing a variable.

The complete project is available on github https://github.com/mahfuzulamin/zeebe-message-correlation-java

原文链接:Zeebe Message Correlation Java

© 版权声明
THE END
喜欢就支持一下吧
点赞12 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容