Hi everyone ,
My BPMN is as below
Expected Flow
- an order is created and subsequently a message is created ("In customer lane the process should stop at “Receive the Goods” task.
- Message is used to check whether the goods are available or not
- if they are available the goods are deliver to the user and he can receive the goods
- if the user is happy with the product then the process is completed.
- if the user is not satisfied then user communicates with us and we try to resolve the issue
- if we are unable to resolve the issue we pass it on to the seller.
Problems I’m Facing
- I’m unable to follow the path of Step 2 and Step 6 in both the process i’m trying to move into different lanes and do some stuff
What i have tried
from pyzeebe import ZeebeTaskRouter
from pyzeebe import ZeebeWorker, create_insecure_channel,Job
import asyncio
import random
import nest_asyncio
nest_asyncio.apply()
async def main():
worker = ZeebeWorker(channel)
router = ZeebeTaskRouter()
# ProcessOrderMsg
async def my_exception_handler(exception: Exception, job: Job) -> None:
print(exception)
await job.set_error_status(message= 'itemsOutOfStock', error_code='itemsOutOfStock')
@router.task(task_type="Order", exception_handler=my_exception_handler)
async def Order():
await client.publish_message(name="ProcessOrderMsg", correlation_key="ProcessOrderMsg")
return {}
@router.task(task_type="ProcessOrder", exception_handler=my_exception_handler)
def ProcessOrder():
return {}
@router.task(task_type="DeliverTheGoods", exception_handler=my_exception_handler)
def DeliverTheGoods():
return {}
# testMessage
@router.task(task_type="ReceiveTheGoods", exception_handler=my_exception_handler)
async def ReceiveTheGoods():
return {"status":"complain","msg":"success"}
# EndMsgEvent
@router.task(task_type="Complain", exception_handler=my_exception_handler)
async def Complain(msg: str):
await client.publish_message(name="ComplaintMessage", correlation_key="ComplaintMessage")
@router.task(task_type="ProcessComplaint", exception_handler=my_exception_handler)
async def ProcessComplaint(cool: str):
return {"EndMsgEvent1":"EndMsgEvent1"}
worker.include_router(router)
await worker.work()
asyncio.run(main())
Any Help or guidance will be great help and for any clearification please feel free to ask.