แม้ว่าตัว BPMN ถูกออกแบบมาสำหรับทางฝั่ง Business แต่มีการทำบางอย่าง ที่ยังต้องใช้มีการทำวนซ้ำ หรือ ถ้าในภาษา Technical ของ Developer ทั้งหลาย ว่าวนลูป (Loop) ครับ สำหรับใน BPMN สามารถเขียนได้ 2 แบบครับ ได้แก่
- Loop Activity
- Non-Loop Activity
Loop Activity
โดย Loop Activity คือ Loop ที่เกิดกำหนด Property ของตัว Activity ครับ ถึงถ้าไปดูใน Spec ของ BPMN อยู่ในรูปแบบของ XML Tag StandardLoopCharacteristics

มาลองดูตัวอย่างกันครับ ภาพด้านล่าง ผมเอามาจาก Tools Visual Paradigm Modeler ครับ เป็น
- สัญลักษณ์ลูกศรวน บนตัว Activity
- การกำหนด Attribute ใน XML Tag StandardLoopCharacteristics โดยอยู่ในส่วนของ Standard Loop Specification

Note: แต่ Loop Activity BPMN-Engine ที่เป็น Open-Source ณ ปี 2018 ทั้งหมด ยังไม่ Support ครับ
Non-Loop Activity
ส่วน Non-Loop Activity นั้น มองภาพที่ใหญ่ขึ้นจาก Activity เดี๋ยวๆ โดยการสร้าง Loop จากการใช้ Exclusive Gateway นำมาประกอบกันครับ มาลองดูตัวอย่างกันครับ
- อย่าง Loop ที่ถ้าใช้ Loop Activity testBefore=true สามารถปรับเป็น Exclusive Gateway ได้ตาม Pattern ดังนี้ครับ

- อย่าง Loop ที่ถ้าใช้ Loop Activity testBefore=false สามารถปรับเป็น Exclusive Gateway ได้ตาม Pattern ดังนี้ครับ

หมายเหตุ
- คำอธิบายนี้อิงตาม Spec ของ BPMN 2.0 ที่ทาง OMG ได้ประกาศไว้ครับ
- ถ้าไปดูตัว BPMN-Engine อาจจะยังทำไม่ครบตาม Spec ของ OMG อันนี้ผมเข้าใจว่า เพราะมันมี Non-Loop Activity ที่สามารถทำงานทดแทนได้อยู่แล้วครับ
Discover more from naiwaen@DebuggingSoft
Subscribe to get the latest posts sent to your email.